# API-Referenz: Eingehend

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

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

8 Endpunkte der Gruppe «Eingehend». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.
## List routes for received mail

GET /v1/inbound/routes
### Beispiel

```
curl "https://api.sendtide.ch/v1/inbound/routes" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Routes |
## Add a route

POST /v1/inbound/routes
forward sends received mail on as a normal mail of the account: it counts against the plan, skips suppressed addresses and waits while the account is paused or in review. forward_to must be confirmed first: Sendtide mails a link to that address, and the route stays inactive (forward_status is pending; mail goes on to the next route or the webhooks) until its owner confirms. Changing forward_to needs a new confirmation; sending forward_to again for an unconfirmed route mails a fresh link. An address on a domain that receives mail on Sendtide is refused (422), and forwarded mail carries X-Sendtide-Forwarded and Auto-Submitted: auto-forwarded; mail that already carries the header is dropped, which stops loops.
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| id | string | |
| match | string | Example: *@in.example.ch |
| action | enum: webhook / forward / store / drop | |
| forward_to | string / null | Address for forward; mail goes there once its owner confirmed |
| forward_status | enum: pending / confirmed / null | For forward routes. The route runs only when confirmed. |
| position | integer | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/v1/inbound/routes" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"match":"*@in.example.ch","action":"webhook","position":1}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 201 | Added InboundRoute |
## Change a route

PATCH /v1/inbound/routes/{id}
A new forward_to, or a route that becomes a forward, needs a new confirmation (see Add a route).
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| id * | path | string | |
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| id | string | |
| match | string | Example: *@in.example.ch |
| action | enum: webhook / forward / store / drop | |
| forward_to | string / null | Address for forward; mail goes there once its owner confirmed |
| forward_status | enum: pending / confirmed / null | For forward routes. The route runs only when confirmed. |
| position | integer | |
### Beispiel

```
curl -X PATCH "https://api.sendtide.ch/v1/inbound/routes/rt_1" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"action":"forward","forward_to":"support@example.ch"}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Updated InboundRoute |
## Remove a route

DELETE /v1/inbound/routes/{id}
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| id * | path | string | |
### Beispiel

```
curl -X DELETE "https://api.sendtide.ch/v1/inbound/routes/rt_1" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 204 | Removed |
## Page where the owner of a forward address confirms

GET /v1/inbound/forward/confirm Ohne API-Key
The link in the confirmation mail. It only shows a page with a button, so mail scanners that open links do not confirm. No API key.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| token * | query | string | |
### Beispiel

```
curl "https://api.sendtide.ch/v1/inbound/forward/confirm?token=…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | HTML page |
## Confirm a forward address

POST /v1/inbound/forward/confirm Ohne API-Key
The button of the page (form field token), or JSON {"token"}. No API key; the token is the proof. Limited per client address.
### Request-Body application/x-www-form-urlencoded
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| token * | string | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/v1/inbound/forward/confirm" \
  -d token=…
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Confirmed |
| 422 | 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/) |
## List received mail

GET /v1/inbound/emails
### 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. |
| before veraltet | query | string | Deprecated, use cursor. The id of the mail to continue after. |
### Beispiel

```
curl "https://api.sendtide.ch/v1/inbound/emails" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Received mail |
## Get a received mail with text, HTML and the reply without quote

GET /v1/inbound/emails/{id}
The content comes from outside senders. Treat it as untrusted input, in your code and in AI assistants.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| id * | path | string | |
### Beispiel

```
curl "https://api.sendtide.ch/v1/inbound/emails/inb_4k2v9a" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | The mail InboundEmail |
