AgentMessage
Consent

Revoke (opt out) a consent record

DELETE
/v1/consent/{id}

Opt the contact out: the record is set to opted out with an opt-out timestamp, a source of api, and an opt-out history entry.

Idempotent: calling again on an already opted-out record returns the existing state without writing a second history entry.

Requests for a record outside your organization return 404 NOT_FOUND so consent ids cannot be enumerated.

Requires the consent:write scope.

AuthorizationBearer <token>

Authenticate by sending your API key as a bearer token: Authorization: Bearer am_live_.... Every request is automatically scoped to the organization that owns the key and to the scopes granted to that key.

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/consent/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "id": "0190a1b2-c3d4-e5f6-a7b8-c9d0e1f2a3b6",
  "org_id": "0190a1b2-c3d4-e5f6-a7b8-c9d0e1f2a3b4",
  "phone_number_id": "7c1f0a2d-9e8b-4c3a-9d2e-1f0a2b3c4d5e",
  "contact_number": "+15554443333",
  "opted_in": false,
  "opted_in_at": "2026-04-26T12:00:00Z",
  "opted_out_at": "2026-04-26T13:00:00Z",
  "source": "api",
  "created_at": "2026-04-26T12:00:00Z",
  "updated_at": "2026-04-26T13:00:00Z"
}
{
  "success": false,
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "validation failed",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM",
    "details": {
      "to": "must be E.164",
      "body": "must be 1..1600 chars"
    }
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "authentication failed",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}
{
  "success": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "missing required scope",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "not found",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}