authorizing-api-requests
Installation
SKILL.md
Authorizing Mailtrap API requests
Overview
Every Mailtrap API request needs two things:
- An API token in an auth header — proves identity and carries the scope.
- For account-scoped endpoints (most of them outside of the send hosts), an
account_idin the URL path.
This skill is the single source of truth for both. Other skills (sending-emails, testing-with-sandbox, using-email-templates, managing-contacts, setting-up-sending-domain) reference these conventions instead of duplicating them.
When to use
- Before writing any Mailtrap API call from code, scripts, CI, IaC, or an AI agent
- Picking which token scope and stream to provision
- Deciding where to store a token (env, secret manager, CI)
- Resolving the
account_idfor an account-scoped endpoint - Debugging
401 Unauthorized/403 Forbiddenresponses