SendlySendly
API ReferenceLists

Subscribe a contact to a list

POST
/api/lists/{id}/subscribe

Add a contact to a list, creating the contact if it does not exist. When the list has doubleOptIn enabled the membership is created as PENDING and the response carries a confirmToken — Sendly does NOT send the confirmation email, so the caller must deliver /api/lists/confirm-subscription?token=<confirmToken> to the contact itself.

Accepts SENDING_ONLY (pk_*) keys so it can back a public subscribe form.

Re-subscribing after an opt-out. If the email already holds an UNSUBSCRIBED membership on this list, the call fails with 409 RESUBSCRIBE_CONFIRMATION_REQUIRED unless the body sets allowResubscribe: true. Reversing an opt-out is a consent decision, so it is never the default — set the flag only when the contact themselves asked to be re-subscribed.

previousStatus reports the membership's status before the call (null when it did not exist); prefer it over created when describing what changed, since created: false is equally true for an unchanged membership and for a reactivated one.

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

List id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for POST /api/lists/{id}/subscribe.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/lists/string/subscribe" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com"  }'
{
  "success": true,
  "data": {
    "membershipId": "8072cc74-4782-4f2c-827c-699c48ce2092",
    "status": "PENDING",
    "created": true,
    "previousStatus": "PENDING",
    "confirmToken": "string"
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}
{
  "success": false,
  "error": {
    "message": "string",
    "code": "string",
    "details": {
      "errors": [
        null
      ]
    }
  }
}