---
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/get-draft

E-mails ontvangen: concepten

# Get Draft

Lees één concept klaar om te bewerken: ontvangers, onderwerp, body, bijlagen en follow-up.

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

## Argumenten

- `id` string verplicht
De `draft_id`.

## Snel starten

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "get_draft",
        args: {
          id: "Vj0xRFJBRlQx"
        }
      }
    ]
  },
  { 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": "get_draft",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "draft_id": "Vj0xRFJBRlQx",
        "thread_id": "thr_9a1c4e72",
        "mode": "new",
        "to": "ana@client.com",
        "cc": [],
        "bcc": [],
        "subject": "Proposal",
        "html": "<p>Hi Ana, here is the proposal.</p>",
        "updated_at": "2026-10-27T02:10:00Z",
        "compose_uid": "Vj0xQ01QMDAx",
        "track_opens": true,
        "track_clicks": false,
        "unsubscribe": false,
        "attachments": [
          {
            "attachment_id": "6f1c2a9e-4b7d-4e21-9a3f-0c8d5e7b1a42",
            "file_name": "proposal.pdf",
            "mime_type": "application/pdf",
            "size_bytes": 182340
          }
        ]
      }
    }
  ]
}
```

### Responsevelden

- `mode`
`new`, `reply` of `forward`.
- `to_emails`
Elk adres in `to`. `to` is nog steeds het eerste.
- `id`
Het oorspronkelijke bericht, voor `reply` en `forward`. Ontbreekt bij `new`.
- `updated_at`
Wanneer het concept voor het laatst is opgeslagen.
- `compose_uid / attachments`
De bestanden van het concept. Stuur `compose_uid` terug met nieuwe uploads om er meer toe te voegen.
- `followup_after_hours`
De follow-upherinnering, als die er is.
- `track_opens / track_clicks / unsubscribe`
De trackingkeuze die in het concept is opgeslagen. Alleen teruggegeven als het concept er een heeft.
- `last_send_error`
Alleen als een ingeplande verzending werd geweigerd en de e-mail terugkwam in Concepten: waarom hij werd geweigerd.

## 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`DRAFT_NOT_FOUND`
Het concept bestaat niet meer: het is verstuurd, verwijderd of opnieuw opgeslagen (elke opslag geeft een nieuwe draft_id).
- CMD`INTERNAL`
Serverfout. Het detail wordt alleen in het serverlog geschreven.
