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

Organizations

Get organization sub accounts

get

Get a list of sub accounts for the specified organization. You must have sub account management permissions for this organization.

Authorizations
Api-TokenstringRequired

Pass the API token in the Api-Token

Path parameters
organization_idinteger · int64 · min: 1Required

Unique organization ID

Example: 1001
Responses
200

Returns the list of sub accounts belonging to the organization.

application/json

Represents a sub account within an organization

idintegerOptional

The unique identifier of the sub account

Example: 12345
namestringOptional

The name of the sub account

Example: Development Team Account
get/api/organizations/{organization_id}/sub_accounts
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 organization sub account

post

Create a new sub account under the specified organization. You must have sub account management permissions for this organization.

Authorizations
Api-TokenstringRequired

Pass the API token in the Api-Token

Path parameters
organization_idinteger · int64 · min: 1Required

Unique organization ID

Example: 1001
Body
Responses
200

Sub account created successfully.

application/json

Represents a sub account within an organization

idintegerOptional

The unique identifier of the sub account

Example: 12345
namestringOptional

The name of the sub account

Example: Development Team Account
post/api/organizations/{organization_id}/sub_accounts
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?