---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/nl/api-reference/receive-emails/drafts/list-drafts

E-mails ontvangen: concepten

# List Drafts

Toon de concepten van de mailbox, nieuwste eerst. Hetzelfde resultaat als list_messages op de map Concepten.

POST `https://g.sendcorex.com/v1` command: list_drafts

Concepten die in de webmail zijn opgeslagen, verschijnen hier ook. Gebruik get_draft om er een te lezen met body en bijlagen.

## Argumenten

- `limit` number optioneel
Hoeveel per pagina, 1 tot 100. Standaard 25.
- `cursor` string optioneel
De `next_cursor` van de vorige pagina.
- `after` string optioneel
Alleen concepten die na dit tijdstip zijn opgeslagen (RFC 3339, `YYYY-MM-DD` of epoch ms).
- `before` string optioneel
Alleen concepten die vóór dit tijdstip zijn opgeslagen.

## Snel starten

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "list_drafts",
        args: {
          limit: 25
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);
```

## Response

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "list_drafts",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "messages": [
          {
            "message_uid": "Vj0xRFJBRlQx",
            "thread_id": "thr_9a1c4e72",
            "folder": "Drafts",
            "subject": "Proposal",
            "preview": "Hi Ana, here is the proposal.",
            "from_name": "Marcos",
            "from_email": "marcos@yourdomain.com",
            "has_attachments": true,
            "size_bytes": 2210,
            "is_read": true,
            "is_starred": false,
            "is_important": false,
            "is_spam": false,
            "snoozed_until": null,
            "received_at": "2026-10-27T02:10:00Z"
          }
        ],
        "has_more": false,
        "next_cursor": null
      }
    }
  ]
}
```

### Responsevelden

- `messages[].message_uid`
De `draft_id`.
- `messages[].received_at`
Wanneer het concept voor het laatst is opgeslagen.
- `has_more / next_cursor`
Stuur `next_cursor` als `cursor` voor de volgende pagina.

## Fouten

Fouten op HTTP-niveau geven `type`, `code` en `message` terug. Fouten met CMD komen terug in het resultaat van de opdracht, met HTTP 200.

- 401`TOKEN_EXPIRED`
De access token is verlopen. Roep Refresh Token aan en herhaal het request.
- 401`INVALID_TOKEN`
De token is ongeldig, onbekend of ingetrokken.
- 429`RATE_LIMITED`
Meer dan 15 requests/s of 15 tegelijk voor hetzelfde IP + mailbox. Wacht het aantal seconden uit Retry-After.
- CMD`INVALID_ARGS`
Een verplicht argument ontbreekt of is ongeldig.
- CMD`INVALID_CURSOR`
De cursor is ongeldig of hoort bij een ander account of een andere map.
- CMD`INTERNAL`
Serverfout. Het detail wordt alleen in het serverlog geschreven.
