Sub-Accounts
Create and manage sub-accounts under a parent account's quota pool
7 endpoints
Endpoints
Method Path Description
GET /v1/accountsGET /v1/accounts
POST /v1/accountsPOST /v1/accounts
GET /v1/accounts/{id}GET /v1/accounts/{id}
DELETE /v1/accounts/{id}DELETE /v1/accounts/{id}
PATCH /v1/accounts/{id}PATCH /v1/accounts/{id}
GET /v1/accounts/{id}/analyticsGET /v1/accounts/{id}/analytics
POST /v1/accounts/{id}/api-keysPOST /v1/accounts/{id}/api-keys
GET /v1/accounts
GET /v1/accounts
Parameters
Name In Type Required Description
pagequery `integer null` No
per_pagequery `integer null` No
Responses
Status Description
200 Sub-accounts owned by this account
401 Unauthorized
Example
cURL
TypeScript
Python
Rust
Go
curl -X GET https://api.euromail.dev/v1/accounts \
-H "X-EuroMail-Api-Key: em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. listAccounts ();
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.list_accounts()
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . list_accounts () .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. ListAccounts (ctx)
POST /v1/accounts
POST /v1/accounts
Request Body
Field Type Required Description
emailstringYes
monthly_quotaintegerYes
namestringYes
passwordstringYes
Responses
Status Description
201 Sub-account created
401 Unauthorized
404 Parent account not found
409 An account with this email already exists
422 Invalid name/email/password/quota, or the quota pool is exhausted
Example
cURL
TypeScript
Python
Rust
Go
curl -X POST https://api.euromail.dev/v1/accounts \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{ "email": "[email protected] ", "monthly_quota": 0, "name": "example.com", "password": "..." }'
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. createAccount ({
email: "[email protected] " ,
monthly_quota: 0 ,
name: "example.com" ,
password: "..." ,
});
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.create_account(
email = "[email protected] " ,
monthly_quota = 0 ,
name = "example.com" ,
password = "..." ,
)
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . create_account ( & CreateAccountParams {
email : "[email protected] " . into (),
monthly_quota : 0 ,
name : "example.com" . into (),
password : "..." . into (),
.. Default :: default ()
}) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. CreateAccount (ctx, euromail . CreateAccountParams {
Email: "[email protected] " ,
MonthlyQuota: 0 ,
Name: "example.com" ,
Password: "..." ,
})
GET /v1/accounts/{id}
GET /v1/accounts/{id}
Parameters
Name In Type Required Description
idpath stringYes Sub-account id
Responses
Status Description
200 The sub-account
401 Unauthorized
404 Sub-account not found
Example
cURL
TypeScript
Python
Rust
Go
curl -X GET https://api.euromail.dev/v1/accounts/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. getAccount ( "id_..." );
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.get_account( "id_..." )
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . get_account ( "id_..." ) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. GetAccount (ctx, "id_..." )
DELETE /v1/accounts/{id}
DELETE /v1/accounts/{id}
Parameters
Name In Type Required Description
idpath stringYes Sub-account id
Responses
Status Description
204 Sub-account deleted
401 Unauthorized
404 Sub-account not found
Example
cURL
TypeScript
Python
Rust
Go
curl -X DELETE https://api.euromail.dev/v1/accounts/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. deleteAccount ( "id_..." );
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.delete_account( "id_..." )
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . delete_account ( "id_..." ) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. DeleteAccount (ctx, "id_..." )
PATCH /v1/accounts/{id}
PATCH /v1/accounts/{id}
Parameters
Name In Type Required Description
idpath stringYes Sub-account id
Request Body
Field Type Required Description
is_active`boolean null` No
monthly_quota`integer null` No
name`string null` No
Responses
Status Description
200 Sub-account updated
401 Unauthorized
404 Sub-account not found
422 Invalid quota, or the quota pool is exhausted
Example
cURL
TypeScript
Python
Rust
Go
curl -X PATCH https://api.euromail.dev/v1/accounts/{id} \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{}'
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. updateAccount ({});
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.update_account(
)
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . update_account ( & UpdateAccountParams {
.. Default :: default ()
}) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. UpdateAccount (ctx, euromail . UpdateAccountParams {
})
GET /v1/accounts/{id}/analytics
GET /v1/accounts/{id}/analytics
Parameters
Name In Type Required Description
idpath stringYes Sub-account id
periodquery `string null` No
fromquery `string null` No
toquery `string null` No
Responses
Status Description
200 Analytics summary for the sub-account
401 Unauthorized
404 Sub-account not found
422 Invalid period
Example
cURL
TypeScript
Python
Rust
Go
curl -X GET https://api.euromail.dev/v1/accounts/{id}/analytics \
-H "X-EuroMail-Api-Key: em_live_..."
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. getAccountDetail ( "id_..." );
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.get_account_detail( "id_..." )
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . get_account_detail ( "id_..." ) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. GetAccountDetail (ctx, "id_..." )
POST /v1/accounts/{id}/api-keys
POST /v1/accounts/{id}/api-keys
Parameters
Name In Type Required Description
idpath stringYes Sub-account id
Request Body
Field Type Required Description
namestringYes
scopesstring[]No
Responses
Status Description
201 API key created for the sub-account (raw key returned only at creation)
401 Unauthorized
404 Sub-account not found
422 Invalid name or scope
Example
cURL
TypeScript
Python
Rust
Go
curl -X POST https://api.euromail.dev/v1/accounts/{id}/api-keys \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{ "name": "example.com" }'
import { EuroMail } from "@euromail/sdk" ;
const euromail = new EuroMail ({ apiKey: "em_live_..." });
const result = await euromail. getAccountDetail ({
name: "example.com" ,
});
from euromail import EuroMail
client = EuroMail( api_key = "em_live_..." )
result = client.get_account_detail(
name = "example.com" ,
)
use euromail :: EuroMail ;
let client = EuroMail :: new ( "em_live_..." );
let result = client . get_account_detail ( & GetAccountDetailParams {
name : "example.com" . into (),
.. Default :: default ()
}) .await? ;
client := euromail. NewClient ( "em_live_..." )
result, err := client. GetAccountDetail (ctx, euromail . GetAccountDetailParams {
Name: "example.com" ,
})