Organizations
Get a list of sub accounts for the specified organization. You must have sub account management permissions for this organization.
Pass the API token in the Api-Token
Unique organization ID
1001Returns the list of sub accounts belonging to the organization.
Represents a sub account within an organization
The unique identifier of the sub account
12345The name of the sub account
Development Team AccountReturns unauthorized error message. Check your credentials.
Insufficient organization permissions or wrong organization.
curl -X GET https://mailtrap.io/api/organizations/{organization_id}/sub_accounts \
-H 'Authorization: Bearer YOUR_API_KEY'
[
{
"id": 12345,
"name": "Development Team Account"
},
{
"id": 12346,
"name": "QA Team Account"
}
]Create a new sub account under the specified organization. You must have sub account management permissions for this organization.
Pass the API token in the Api-Token
Unique organization ID
1001Sub account created successfully.
Represents a sub account within an organization
The unique identifier of the sub account
12345The name of the sub account
Development Team AccountBad request - invalid parameters.
Returns unauthorized error message. Check your credentials.
Insufficient organization permissions or wrong organization.
Unprocessable entity - validation errors.
curl -X POST https://mailtrap.io/api/organizations/{organization_id}/sub_accounts \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"account": {
"name": "New Team Account"
}
}'
{
"id": 12347,
"name": "New Team Account"
}Last updated
Was this helpful?

