SendlySendly
API ReferenceCampaigns

Send or schedule a campaign

POST
/api/v1/campaigns/{id}/send

Start sending immediately, or park the campaign in SCHEDULED by passing scheduled_for (which must be in the future). The request body may be omitted entirely to send now.

Send an Idempotency-Key. This is the operation that cannot be undone: a retry without one starts a second fan-out over the same audience. The key is scoped to this campaign, so the same key on a different campaign is a 422 idempotency_key_reused rather than a replay of the first campaign's response.

Answers 400 when the campaign is not DRAFT/SCHEDULED or has no recipients, and 403 when the send would exceed the project's billing limit.

Requires the campaigns:send scope — Send or schedule your campaigns to their audience.

Authorization

AuthorizationBearer <token>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

In: header

Path Parameters

id*string

Resource id.

Header Parameters

Idempotency-Key?string

Replay-safety key (24h TTL). Reuse it only to retry the identical request.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for POST /api/v1/campaigns/{id}/send.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/api/v1/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08/send" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "status": "DRAFT",
  "subject": "string",
  "audience_type": "ALL",
  "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",
  "topic_id": "646807af-5da6-43aa-83d3-8ac1d15ab4e5",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "sent_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "stats": {
    "total_recipients": 0,
    "sent": 0,
    "delivered": 0,
    "opened": 0,
    "clicked": 0,
    "bounced": 0
  }
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "errors": [
    {
      "pointer": "string",
      "code": "string",
      "message": "string"
    }
  ]
}