# API-Referenz: Submandanten

> Endpunkte der Gruppe «Submandanten» der Sendtide API mit Parametern, Request-Body, Antworten und curl-Beispielen. Die Referenz ist auf Englisch.

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

6 Endpunkte der Gruppe «Submandanten». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.
## List sub-accounts

GET /v1/tenants
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| 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. |
### Beispiel

```
curl "https://api.sendtide.ch/v1/tenants" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 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
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| slug * | string | Example: baeckerei-moser |
| name | string | |
### Beispiel

```
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"}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 201 | Added Tenant |
## Remove a sub-account with its data

DELETE /v1/tenants/{slug}
Admin endpoint, needs an admin key.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
### Beispiel

```
curl -X DELETE "https://api.sendtide.ch/v1/tenants/baeckerei-moser" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 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).
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| name | string | |
| env | enum: live / test | |
| scope | enum: full / send / read | |
### Beispiel

```
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"}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 201 | Created ApiKey |
| 403 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
## Adapt a main template for a sub-account (locked blocks stay)

PUT /v1/tenants/{slug}/templates/{alias}
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
| alias * | path | string | |
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| alias | string | |
| name | string | |
| kind | enum: visual / code | |
| style | object | |
| langs | object | |
| sub_allow | boolean | |
| publish | boolean | |
| note | string | |
### Beispiel

```
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"}}}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Adapted Template |
## Back to the main template

DELETE /v1/tenants/{slug}/templates/{alias}
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
| alias * | path | string | |
### Beispiel

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