How to authenticate HTTP requests to Mailtrap APIs
There are several ways to send authenticated HTTP requests:
Send a HTTP header Api-Token: {api_token}, where {api_token} is your API token
Api-Token: {api_token}
{api_token}
Send a HTTP header Authorization: Bearer {api_token}, where {api_token} is your API token (more info: Token Access Authenticationarrow-up-right)
Authorization: Bearer {api_token}
You can manage your API token on the API Tokensarrow-up-right page. API token does not have an expiration date, you may reset it manually.
All requests must be sent over HTTPS protocol.
Allowed HTTP requests include:
POST
Create a resource
PATCH
Update a resource
PUT
Replace a resource
GET
Get a resource or a list of resources
DELETE
Delete a resource
Here is the description of common server responses:
200
OK
The request was successful (some API calls may return 201 instead)
204
No Content
The request was successful but there is no representation to return (i.e. the response is empty)
401
Unauthorized
Authentication failed or user doesn't have permissions for requested operation
403
Forbidden
Access denied
404
Not Found
Resource was not found
422
Unprocessable Entity
Requested data contain invalid values
429
Too Many Requests
Rate limit exceeded. Reduce request frequency and retry later
Last updated 2 months ago
Was this helpful?