Aller à la documentation
API

Brouillons

Chaque opération de ce groupe : ce qu'elle accepte, ce qu'elle retourne et les erreurs qu'elle peut renvoyer.

Opérations

GET/drafts

List drafts

Portéesdrafts:readLit

Requires the drafts:read scope.

Paramètres de requête

querystring

The same search syntax as GET /threads, read against each draft's subject, sender and the first 4,000 characters of its body. Plain words match loosely and a quoted phrase has to appear as written, filler words are dropped when something else is left to search for, and a value the search cannot use is ignored rather than narrowing. Recipients are not searched, so to:, cc: and bcc: match nothing here. The drafts folder always applies, so in: and folder is: operators cannot widen the search beyond drafts, in:anywhere included. A draft saved with no subject is stored as (no subject), so subject:"no subject" finds it.

limitinteger

Drafts per page, a whole number from 1 to 100. Defaults to 25.

Au moins 1Au plus 100
pageTokenstring

Opaque. Pass back what you were given, never construct one.

Retourne

200

A page of drafts.

Erreurs

Les erreurs que toute opération peut renvoyer400401403404422500Catalogue des erreurs

Aussi disponible dans

SDK
drafts.list()drafts.listAll()drafts.iterate()
CLI
openemail drafts list
MCP
listDrafts

GET/drafts/{id}

Retrieve a draft

Portéesdrafts:readLit

Requires the drafts:read scope.

Paramètres de chemin

idstringObligatoire

Draft id, which starts with draft-.

Retourne

200

The draft.

Erreurs

Les erreurs que toute opération peut renvoyer400401403404422500Catalogue des erreurs

Aussi disponible dans

SDK
drafts.get()
CLI
openemail drafts get
MCP
getDraft

PATCH/drafts/{id}

Update a draft

Portéesdrafts:writeModifie des données

A partial update, not an upsert. An unknown id, or the id of a thread that is not a draft, is a 404. The draft keeps the id you passed, and the response echoes it.

Requires the drafts:write scope.

Paramètres de chemin

idstringObligatoire

Draft id, which starts with draft-.

Retourne

200

Saved.

Erreurs

Les erreurs que toute opération peut renvoyer400401403404422500Catalogue des erreurs

Aussi disponible dans

SDK
drafts.update()
CLI
openemail drafts update
MCP
createDraftupdateDraft

DELETE/drafts/{id}

Delete a draft

Portéesdrafts:writeSupprime

Requires the drafts:write scope.

Paramètres de chemin

idstringObligatoire

Draft id, which starts with draft-.

Retourne

200

Deleted.

Erreurs

Les erreurs que toute opération peut renvoyer400401403404422500Catalogue des erreurs

Aussi disponible dans

SDK
drafts.delete()
CLI
openemail drafts delete
MCP
deleteDraft