AgentMessage
Phone numbers

Detach a campaign from a phone number

DELETE
/v1/phone-numbers/{id}/campaign

Remove the campaign association from a phone number you own. Carrier-side unbinding happens during reconciliation after this call.

This call is idempotent: a number that already has no campaign returns 200 OK with the current resource, so you can detach without checking the prior state first.

Validation:

  • Number not owned by your organization returns 404 NOT_FOUND.
  • Number that is not currently assigned returns 409 NUMBER_NOT_ASSIGNED.

Requires the numbers: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

application/json

curl -X DELETE "https://example.com/v1/phone-numbers/497f6eca-6276-4993-bfeb-53cbbbba6f08/campaign"
{
  "success": true,
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string",
    "details": {
      "property1": "string",
      "property2": "string"
    }
  },
  "meta": {
    "total": 0,
    "limit": 0,
    "offset": 0,
    "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNC0yNlQxMjowMDowMFoiLCJpZCI6IjAxOTAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMSJ9",
    "last_event_at": "2019-08-24T14:15:22Z"
  },
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "number": "string",
    "number_type": "local",
    "inbound_url": "http://example.com",
    "status_url": "http://example.com",
    "label": "string",
    "campaign_id": "78614b6c-fe7c-41e2-8e25-c9b3a3c91904",
    "carrier_line_option_status": "pending",
    "carrier_line_option_propagated_at": "2019-08-24T14:15:22Z",
    "sms_enabled": true,
    "mms_enabled": true,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "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"
  }
}
{
  "success": false,
  "error": {
    "code": "NUMBER_NOT_ASSIGNED",
    "message": "phone number is not assigned",
    "request_id": "01JTBQH2FZ8K1RXC0WJ4Z9P3VM"
  }
}