Skip to content

List all subaccounts

Request

Fetch all subaccounts

Security
basicAuth
Query
sortstring

Sort order

Enum ValueDescription
asc

Sort by ascending order of name field

desc

Sort by descending order of name field

filterstring

Name of account to filter by

limitinteger, [ 1 .. 1000 ]

Number of subaccounts to return

Default:10
skipinteger

Number of subaccounts to skip

Default:0
enabledboolean

Indicate to include enabled subaccounts (true) or disabled accounts (false). Leave unspecified to allow for either, depending on other parameters provided.

closedboolean

Indicate to include closed subaccounts (true) or exclude closed accounts (false). Leave unspecified to allow for either, depending on other parameters provided.

curl -i -X GET \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v5/accounts/subaccounts?sort=asc&filter=string&limit=10&skip=0&enabled=true&closed=true'

Responses

A 200 response

Bodyapplication/json
subaccountsArray of objects(github.com-mailgun-accounts-api-Subaccount)
totalinteger

The total number of subaccounts

Response
{ "subaccounts": [ {} ], "total": 1 }