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
{
"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
| Status | Code | Cause |
|---|---|---|
400 | bad_request | With a personal access token, no x-mapier-project header |
401 | invalid_credentials | No key, or one that is unknown, revoked or expired |
403 | forbidden | A personal access token not made for this environment, or whose owner's role no longer allows this |
403 | insufficient_scope | The key does not carry the lines:write scope |
404 | not_found | A setup this key cannot see, or none |
409 | conflict | The setup bound its line; disconnect the line instead |
409 | project_archived | The project is archived |
422 | validation_failed | An x-mapier-version the API does not support |
429 | rate_limited | Over this route's budget; the Retry-After header says how long to wait |
500 | internal_error | Mapier failed on its side; give requestId to support |
503 | service_busy | Mapier is busy and did nothing; wait details.retryAfter seconds and call again |
503 | upstream_unavailable | Mapier could not answer right now; retry with backoff |