# API-Referenz: Konto

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

URL: https://sendtide.ch/docs/api/account/

8 Endpunkte der Gruppe «Konto». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.
## Single sign-on of the dashboard (owner or admin in the dashboard)

GET /v1/account/sso
### Beispiel

```
curl "https://api.sendtide.ch/v1/account/sso" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | The configuration (without the secret) SSO |
## Configure OpenID Connect single sign-on (Business and Scale)

PUT /v1/account/sso
Issuer (https, discovery at /.well-known/openid-configuration is checked now), client id and secret (stored encrypted; omit it to keep the stored one), the email domains that may sign in (no webmail domains; each needs proof of ownership, see domains of GET and POST /v1/account/sso/domains/{domain}/verify: a domain only counts for login and enforcement once it is verified, and a domain verified by one account cannot be claimed by another), the role of new users, and enforce: members then cannot use a password (owners can, with two-factor authentication; every owner needs it before this can be set). The redirect URI to register at the provider is redirect_uri of GET. A session from SSO opens this account only.
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| issuer * | string | |
| client_id * | string | |
| client_secret | string | |
| email_domains * | array | |
| default_role * | enum: admin / developer / readonly | |
| enforce | boolean | |
| enabled | boolean | Default: true |
### Beispiel

```
curl -X PUT "https://api.sendtide.ch/v1/account/sso" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"issuer":"string","client_id":"string","email_domains":["string"],"default_role":"admin"}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Saved SSO |
| 403 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
| 409 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
| 422 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
## Remove single sign-on (sessions that came from it end)

DELETE /v1/account/sso
### Beispiel

```
curl -X DELETE "https://api.sendtide.ch/v1/account/sso" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 204 | Removed |
## Look for the TXT record of an SSO email domain now (owner or admin in the dashboard)

POST /v1/account/sso/domains/{domain}/verify
Each email domain of the single sign-on needs proof that the account owns it: publish the TXT record from domains[].record (_sendtide-sso.<domain>, value sendtide-sso-verification=<token>), or have a sending domain of the same account verified by SES (DKIM), which proves the domain automatically. The scheduler looks every five minutes; this call looks right away. 409 sso_domain_taken: another account has already verified the domain. 429: at most 30 checks per 15 minutes.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| domain * | path | string | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/v1/account/sso/domains/{domain}/verify" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | The domain with its status SSODomain |
| 404 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
| 409 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
| 429 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
| 502 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
## The account, its status, retention and reputation

GET /v1/account
### Beispiel

```
curl "https://api.sendtide.ch/v1/account" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Account |
## Rename the account or change its settings (admin)

PATCH /v1/account
settings.retention_content_days and settings.retention_metadata_days shorten how long content and metadata are kept (never longer than the plan).
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| name | string | |
| settings | object | |
### Beispiel

```
curl -X PATCH "https://api.sendtide.ch/v1/account" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme AG","settings":{"tracking":false}}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | The account |
| 422 | Invalid settings |
## Delete the account and all its data (owner, dashboard session only)

DELETE /v1/account
Sending stops at once (status paused, reason deleting). Then a final invoice for the usage so far is charged, the SES identities and tracking sets are deleted, and all data is removed. Invoices are kept (accounting records). Not possible with an API key, and not for a sub-account (use DELETE /v1/tenants/{slug}).
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| confirm * | string | The exact account name |
### Beispiel

```
curl -X DELETE "https://api.sendtide.ch/v1/account" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"confirm":"string"}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 202 | Deletion started |
| 403 | Not an owner session |
| 422 | The name does not match |
## Erase a recipient (GDPR), scope full or admin

DELETE /v1/recipients/{email}
Removes the content of every mail to or from the address in this account and replaces the address in mails, events, webhook deliveries, inbound mail and API logs by a hashed marker (erased-<hash>@erased.invalid), so statistics stay. The suppression entry is deleted too, unless keep_suppression=true.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| email * | path | string | |
| keep_suppression | query | boolean | Keep the address on the suppression list |
| tenant | query | string | Slug of a sub-account to act for. |
### Beispiel

```
curl -X DELETE "https://api.sendtide.ch/v1/recipients/anna@example.org" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Erased |
| 422 | Not a valid address |
