For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get API token

Returns a single API token by id.

get
Authorizations
Api-TokenstringRequired

Pass the API token in the Api-Token

Path parameters
idinteger · int64Required

API token ID

Example: 12345
Responses
200

API token

application/json
idinteger · int64Optional

API token ID

namestringOptional

Token display name

last_4_digitsstringOptional

Last 4 characters of the token (full token is only shown on create or reset)

created_bystringOptional

Name of the user or token that created this token

expires_atstring · date-time · nullableOptional

When the token expires (ISO 8601); null if the token does not expire

get/api/api_tokens/{id}
curl -X GET https://mailtrap.io/api/api_tokens/{id} \
  -H 'Authorization: Bearer YOUR_API_KEY'
{
  "id": 12345,
  "name": "My API Token",
  "last_4_digits": "x7k9",
  "created_by": "user@example.com",
  "expires_at": null,
  "resources": [
    {
      "resource_type": "account",
      "resource_id": 3229,
      "access_level": 100
    }
  ]
}

Last updated

Was this helpful?