Cancel a setup

Stop an open line setup; its link stops working

POST/v1/line-setups/{setupId}/cancel

Stops an open setup; its one-time setup link stops working. Cancelling a setup that is already closed returns it unchanged. A setup that bound its line is refused with a 409: disconnect the line in the console instead.

Example request

curl -X POST https://api.mapier.ai/v1/line-setups/0192a7d0-7a8b-7c9d-8eaf-b0c1d2e3f405/cancel \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-mapier-version: 2026-12-01" \
  -d '{}'

Response

200 OK
{
  "id": "0192a7d0-7a8b-7c9d-8eaf-b0c1d2e3f405",
  "channel": "imessage",
  "method": "operator",
  "purpose": "connect",
  "state": "cancelled",
  "checks": {
    "credentials": {
      "state": "pending",
      "detail": "Mapier is attaching a number.",
      "reason": null,
      "retryable": true,
      "checkedAt": null,
      "docUrl": "https://docs.mapier.ai/convo/guides/connect/imessage#request-a-line",
      "fixUrl": null,
      "sub": null
    },
    "webhook": {
      "state": "pending",
      "detail": "Waiting for the line to connect.",
      "reason": null,
      "retryable": true,
      "checkedAt": null,
      "docUrl": "https://docs.mapier.ai/convo/guides/connect/imessage#request-a-line",
      "fixUrl": null,
      "sub": null
    },
    "platform_approval": {
      "state": "n/a",
      "detail": "Not needed.",
      "reason": null,
      "retryable": false,
      "checkedAt": null,
      "docUrl": null,
      "fixUrl": null,
      "sub": null
    },
    "policy_ack": {
      "state": "n/a",
      "detail": "Not needed.",
      "reason": null,
      "retryable": false,
      "checkedAt": null,
      "docUrl": null,
      "fixUrl": null,
      "sub": null
    },
    "inbound_proof": {
      "state": "n/a",
      "detail": "Not needed.",
      "reason": null,
      "retryable": false,
      "checkedAt": null,
      "docUrl": null,
      "fixUrl": null,
      "sub": null
    },
    "outbound_proof": {
      "state": "n/a",
      "detail": "Not needed.",
      "reason": null,
      "retryable": false,
      "checkedAt": null,
      "docUrl": null,
      "fixUrl": null,
      "sub": null
    }
  },
  "nextStep": null,
  "handoffUrl": null,
  "handoffExpiresAt": null,
  "identity": null,
  "lineId": null,
  "number": null,
  "failureReason": null,
  "createdAt": "2026-10-18T17:02:11.000Z",
  "updatedAt": "2026-10-18T17:10:00.000Z",
  "expiresAt": null
}

Errors

StatusCodeCause
400bad_requestWith a personal access token, no x-mapier-project header
401invalid_credentialsNo key, or one that is unknown, revoked or expired
403forbiddenA personal access token not made for this environment, or whose owner's role no longer allows this
403insufficient_scopeThe key does not carry the lines:write scope
404not_foundA setup this key cannot see, or none
409conflictThe setup bound its line; disconnect the line instead
409project_archivedThe project is archived
422validation_failedAn x-mapier-version the API does not support
429rate_limitedOver this route's budget; the Retry-After header says how long to wait
500internal_errorMapier failed on its side; give requestId to support
503service_busyMapier is busy and did nothing; wait details.retryAfter seconds and call again
503upstream_unavailableMapier could not answer right now; retry with backoff

Guide