Sub-Accounts
Create and manage sub-accounts under a parent account's quota pool
7 endpoints
Endpoints
| Method | Path | Description |
| GET | /v1/accounts | GET /v1/accounts |
| POST | /v1/accounts | POST /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}/analytics | GET /v1/accounts/{id}/analytics |
| POST | /v1/accounts/{id}/api-keys | POST /v1/accounts/{id}/api-keys |
GET /v1/accounts
GET /v1/accounts
Parameters
| Name | In | Type | Required | Description |
page | query | integer | null | No | |
per_page | query | integer | null | No | |
Responses
| Status | Description |
| 200 | Sub-accounts owned by this account |
| 401 | Unauthorized |
Example
curl -X GET https://api.euromail.dev/v1/accounts \
-H "Authorization: Bearer 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 |
email | string | Yes | |
monthly_quota | integer | Yes | |
name | string | Yes | |
password | string | Yes | |
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 -X POST https://api.euromail.dev/v1/accounts \
-H "Authorization: Bearer em_live_..." \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"monthly_quota": 1,
"name": "...",
"password": "..."
}'
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.createAccount({
email: "[email protected]",
monthly_quota: 1,
name: "...",
password: "..."
});
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.create_account(
email="[email protected]",
monthly_quota=1,
name="...",
password="...",
)
use euromail::{EuroMail, CreateAccountParams};
let client = EuroMail::new("em_live_...");
let result = client.create_account(&CreateAccountParams {
email: "[email protected]".into(),
monthly_quota: 1,
name: "...".into(),
password: "...".into(),
..Default::default()
}).await?;
client := euromail.NewClient("em_live_...")
result, err := client.CreateAccount(ctx, euromail.CreateAccountParams{
Email: "[email protected]",
MonthlyQuota: 1,
Name: "...",
Password: "...",
})
GET /v1/accounts/{id}
GET /v1/accounts/{id}
Parameters
| Name | In | Type | Required | Description |
id | path | string | Yes | Sub-account id |
Responses
| Status | Description |
| 200 | The sub-account |
| 401 | Unauthorized |
| 404 | Sub-account not found |
Example
curl -X GET https://api.euromail.dev/v1/accounts/{id} \
-H "Authorization: Bearer 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 |
id | path | string | Yes | Sub-account id |
Responses
| Status | Description |
| 204 | Sub-account deleted |
| 401 | Unauthorized |
| 404 | Sub-account not found |
Example
curl -X DELETE https://api.euromail.dev/v1/accounts/{id} \
-H "Authorization: Bearer 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 |
id | path | string | Yes | 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 name or quota, or the quota pool is exhausted |
Example
curl -X PATCH https://api.euromail.dev/v1/accounts/{id} \
-H "Authorization: Bearer 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, UpdateAccountParams};
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 |
id | path | string | Yes | Sub-account id |
period | query | string | null | No | |
from | query | string | null | No | |
to | query | 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 -X GET https://api.euromail.dev/v1/accounts/{id}/analytics \
-H "Authorization: Bearer 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 |
id | path | string | Yes | Sub-account id |
Request Body
| Field | Type | Required | Description |
name | string | Yes | |
scopes | string[] | No | |
Responses
| Status | Description |
| 201 | API key created for the sub-account (raw key returned only at creation) |
| 401 | Unauthorized |
| 403 | The caller may not manage sub-accounts |
| 404 | Sub-account not found |
| 422 | Invalid name or scope |
Example
curl -X POST https://api.euromail.dev/v1/accounts/{id}/api-keys \
-H "Authorization: Bearer em_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "..."
}'
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.getAccountDetail({
name: "..."
});
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_account_detail(
name="...",
)
use euromail::{EuroMail, GetAccountDetailParams};
let client = EuroMail::new("em_live_...");
let result = client.get_account_detail(&GetAccountDetailParams {
name: "...".into(),
..Default::default()
}).await?;
client := euromail.NewClient("em_live_...")
result, err := client.GetAccountDetail(ctx, euromail.GetAccountDetailParams{
Name: "...",
})