API reference

Drafts and attachments

Build composer flows with private attachment storage.

POST/drafts
API key

Create a composer draft

Create a composer draft

Request
curl https://sendhq.cc/api/v1/drafts \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"hello@example.com","to":["customer@example.net"],"subject":"Hello"}'
201 Response
{
  "id": "dr_…",
  "attachments": []
}
GET/drafts
API key

List composer drafts

List composer drafts

Request
curl https://sendhq.cc/api/v1/drafts \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 Response
{
  "data": [],
  "count": 0
}
GET/drafts/:id
API key

Retrieve a draft and attachments

Retrieve a draft and attachments

Request
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 Response
{
  "id": "dr_…",
  "attachments": []
}
PUT/drafts/:id
API key

Replace draft content

Replace draft content

Request
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X PUT \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"hello@example.com","to":["customer@example.net"],"subject":"Updated subject","text":"Updated body"}'
200 Response
{
  "id": "dr_…"
}
DELETE/drafts/:id
API key

Discard a draft

Discard a draft

Request
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 Response
{
  "ok": true
}
POST/drafts/:id/attachments
API key

Upload an attachment to a draft

Upload raw file bytes. Set Content-Type and X-Filename. A message can contain at most 10 files and 10 MB total.

Optional headersX-Filename
Request
curl https://sendhq.cc/api/v1/drafts/id_value/attachments \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/pdf" \
  -H "X-Filename: invoice.pdf" \
  --data-binary @invoice.pdf
201 Response
{
  "id": "att_…",
  "filename": "invoice.pdf",
  "sizeBytes": 48231,
  "available": true
}
GET/attachments/:id
API key

Download a private attachment

Download a private attachment

Request
curl https://sendhq.cc/api/v1/attachments/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
DELETE/attachments/:id
API key

Delete a private attachment

Delete a private attachment

Request
curl https://sendhq.cc/api/v1/attachments/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 Response
{
  "ok": true
}
GET/sending-identities
API key

List verified sender identities

List verified sender identities

Request
curl https://sendhq.cc/api/v1/sending-identities \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 Response
{
  "domains": [],
  "addresses": [],
  "localParts": []
}