Exchange Not Activatable
URI: https://docs.ankatech.co/errors/exchange-not-activatable
HTTP Status: 422 Unprocessable Content · 409 Conflict (the Exchange owns no live grant)
When you see this
You asked to activate a Cryptographic Exchange, activateExchange (POST /api/v3/admin/exchanges/{id}/activate), and the Exchange cannot be activated as it stands. Nothing was written. The type answers two causes, told apart by the status:
- 422: the Exchange is not
READY. Activation is the one transition that starts only fromREADY: aDRAFThas not passedvalidateExchangeyet, anACTIVEorSUSPENDEDExchange is already in force, andREVOKED,EXPIREDandCONSUMEDare terminal. - 409: the Exchange is
READYbut owns no live grant. Activation creates no grant and names no capability; it makes the grants the Exchange already owns authorize. With none, activating would authorize nothing.
previewExchangeActivation (GET /api/v3/admin/exchanges/{id}/activation-preview) returns the 422 refusal, with the same type, for an Exchange that is DRAFT, REVOKED, EXPIRED or CONSUMED: a state activation can never start from, so there is nothing to preview. For an ACTIVE or SUSPENDED Exchange the preview answers normally.
The Exchange's current status travels as the exchangeStatus extension member in both cases, so a client reads a value instead of parsing detail.
This is distinct from Invalid State Transition, which the other lifecycle verbs of an Exchange (suspend, resume, revoke, validate, discard) answer. Activation has its own type because a provisioning script needs to tell "already activated on an earlier run" apart from every other activation refusal without parsing prose. On this type it can re-read the Exchange and treat ACTIVE as work already done; on any other, it must stop.
Common Causes
- Activating a
DRAFTthat has not been validated yet. - Activating a
READYExchange before adding its grants withcreateExchangeGrant. - Re-running a provisioning script against an Exchange a previous run already activated.
- Activating an Exchange that was revoked, has expired or was consumed.
Response Example
Not READY:
{
"type": "https://docs.ankatech.co/errors/exchange-not-activatable",
"title": "Exchange Not Activatable",
"status": 422,
"detail": "Exchange status DRAFT cannot be activated; only READY",
"instance": "/api/v3/admin/exchanges/7d2f4a10-9c31-4b8e-a5d6-2f11c0b47e93/activate",
"timestamp": 1730000000,
"extensions": {
"exchangeStatus": "DRAFT",
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
READY with no live grant:
{
"type": "https://docs.ankatech.co/errors/exchange-not-activatable",
"title": "Exchange Not Activatable",
"status": 409,
"detail": "This Exchange owns no live Capability Grant, so activating it would authorize nothing. Add a grant with createExchangeGrant first.",
"instance": "/api/v3/admin/exchanges/7d2f4a10-9c31-4b8e-a5d6-2f11c0b47e93/activate",
"timestamp": 1730000000,
"extensions": {
"exchangeStatus": "READY",
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Content-Type: application/problem+json, following RFC 9457 Problem Details.
How to Resolve
- Read the status and
extensions.exchangeStatus. 409withREADY: add at least one grant withcreateExchangeGrant, then activate.DRAFT: runvalidateExchange; when it reports no violations the Exchange becomesREADY.ACTIVE: the Exchange is already active — there is nothing to do.SUSPENDED: useresumeExchange, not activation.REVOKED,EXPIREDorCONSUMED: the Exchange is terminal. Clone it withcloneExchange, add its grants and activate the clone.
For full schema definitions, examples, and interactive testing, see the Developer Hub Reference.