# API reference: Sub-accounts

> Endpoints of the Sub-accounts group of the Sendtide API with parameters, request body, responses and curl examples.

URL: https://sendtide.ch/en/docs/api/sub-accounts/

6 endpoints of the Sub-accounts group.
## List sub-accounts

GET /v1/tenants
### Parameters
| Name | In | Type | Description |
| --- | --- | --- | --- |
| limit | query | integer | Page size. The default and the maximum depend on the endpoint (emails 50 up to 500, received mail 50 up to 200, audit up to 200, the others 100 up to 500 or 1000). Default: 100 |
| cursor | query | string | The next_cursor of the previous page. Opaque; pass it unchanged to the same endpoint with the same filters. |
### Example

```
curl "https://api.sendtide.ch/v1/tenants" \
  -H "Authorization: Bearer sk_test_…"
```
### Responses
| Status | Description |
| --- | --- |
| 200 | Sub-accounts |
## Add a sub-account (Business up to 10, Scale unlimited)

POST /v1/tenants
Admin endpoint, needs an admin key.
### Request body application/json
| Field | Type | Description |
| --- | --- | --- |
| slug * | string | Example: baeckerei-moser |
| name | string | |
### Example

```
curl -X POST "https://api.sendtide.ch/v1/tenants" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"slug":"baeckerei-moser","name":"Bäckerei Moser"}'
```
### Responses
| Status | Description |
| --- | --- |
| 201 | Added Tenant |
## Remove a sub-account with its data

DELETE /v1/tenants/{slug}
Admin endpoint, needs an admin key.
### Parameters
| Name | In | Type | Description |
| --- | --- | --- | --- |
| slug * | path | string | |
### Example

```
curl -X DELETE "https://api.sendtide.ch/v1/tenants/baeckerei-moser" \
  -H "Authorization: Bearer sk_test_…"
```
### Responses
| Status | Description |
| --- | --- |
| 204 | Removed |
## Create a key of a sub-account

POST /v1/tenants/{slug}/keys
Admin endpoint, needs an admin key. The scope of the new key follows the rules of Create an API key (never admin through a key).
### Parameters
| Name | In | Type | Description |
| --- | --- | --- | --- |
| slug * | path | string | |
### Request body application/json
| Field | Type | Description |
| --- | --- | --- |
| name | string | |
| env | enum: live / test | |
| scope | enum: full / send / read | |
### Example

```
curl -X POST "https://api.sendtide.ch/v1/tenants/baeckerei-moser/keys" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Bäckerei Moser","env":"live","scope":"send"}'
```
### Responses
| Status | Description |
| --- | --- |
| 201 | Created ApiKey |
| 403 | Error in the usual format, [errors and limits](https://sendtide.ch/en/docs/errors-and-limits/) |
## Adapt a main template for a sub-account (locked blocks stay)

PUT /v1/tenants/{slug}/templates/{alias}
### Parameters
| Name | In | Type | Description |
| --- | --- | --- | --- |
| slug * | path | string | |
| alias * | path | string | |
### Request body application/json
| Field | Type | Description |
| --- | --- | --- |
| alias | string | |
| name | string | |
| kind | enum: visual / code | |
| style | object | |
| langs | object | |
| sub_allow | boolean | |
| publish | boolean | |
| note | string | |
### Example

```
curl -X PUT "https://api.sendtide.ch/v1/tenants/baeckerei-moser/templates/welcome" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"langs":{"de-CH":{"subject":"Willkommen bei der Bäckerei Moser"}}}'
```
### Responses
| Status | Description |
| --- | --- |
| 200 | Adapted Template |
## Back to the main template

DELETE /v1/tenants/{slug}/templates/{alias}
### Parameters
| Name | In | Type | Description |
| --- | --- | --- | --- |
| slug * | path | string | |
| alias * | path | string | |
### Example

```
curl -X DELETE "https://api.sendtide.ch/v1/tenants/baeckerei-moser/templates/welcome" \
  -H "Authorization: Bearer sk_test_…"
```
### Responses
| Status | Description |
| --- | --- |
| 204 | Reset |
