1
    authorizing-api-requests

    authorizing-api-requests

    by Daryna Ivanova

    Secure authentication and account resolution for Mailtrap Email Sending, Sandbox, and Account APIs.

    Updated Jun 2026
    0 installs

    Free

    Included in download

    • Downloadable skill package
    • 2 permissions declared
    • Instant install

    Sample input

    I need to make an API call to list my Mailtrap contact lists. How should I set up the auth headers and the account ID in the URL?

    Sample output

    To list contact lists, use the account-scoped endpoint.

    1. Fetch your ID: export MAILTRAP_ACCOUNT_ID=$(curl -s https://mailtrap.io/api/accounts -H "Authorization: Bearer $MAILTRAP_API_TOKEN" | jq '.[0].id')
    2. Request: GET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/contacts/lists

    About This Skill

    A reference skill for any agent working with the Mailtrap API. Covers the two accepted auth header formats (Bearer and Api-Token), how to scope tokens to the minimum required surface (transactional, bulk, sandbox, account-level), where to store tokens safely across environments (local dev, CI, production), and a one-liner to resolve account_id dynamically so it never gets hardcoded. Includes a common-mistakes table covering the most frequent auth failures.

    Use Cases

    • Securely manage API tokens for production, staging, and sandbox environments.
    • Dynamically resolve account_id to prevent hardcoding in multi-tenant setups.
    • Identify the correct token scope for Email Sending vs. Email Testing.
    • Setting up auth before writing any Mailtrap API call

    Reviews

    No reviews yet - be the first to share your experience.

    Only users who have downloaded or purchased this skill can leave a review.

    Security Scanned

    Passed automated security review

    Permissions

    Network Access
    Environment Variables

    Allowed Hosts

    mailtrap.io
    docs.mailtrap.io
    send.api.mailtrap.io
    sandbox.api.mailtrap.io

    No special requirements. Works with any SKILL.md-compatible agent.

    Frequently Asked Questions

    More Premium Skills

    Free