Exchange Context Not Active
URI: https://docs.ankatech.co/errors/exchange-context-not-active
HTTP Status: 409 Conflict
When you see this
The request needs an ACTIVE Exchange Context, and the context it names, or the context of the Exchange it acts on, is not active. Nothing was written.
It answers these operations:
- creating a Capability Grant in the context (
createCapabilityGrant), or adding a grant to an Exchange in it (createExchangeGrant); - creating a Cryptographic Exchange in the context (
createExchange), or moving an Exchange to it (updateExchange); - activating an Exchange whose context is not active (
activateExchange); - resuming a
CLOSEDcontext (resumeExchangeContext).
The context's current status travels as the status extension member, so a client tells the two cases apart on a value:
SUSPENDEDis reversible. The context accepts no new grant or Exchange until it is resumed.CLOSEDis terminal. The context accepts no new grant or Exchange and can never be resumed. Its grants and Exchanges were retired when it closed, and they stay readable.
Common Causes
- Adding a grant while the context is suspended for an incident or a contract review.
- Building a new Exchange in a context that was closed when the relationship ended.
- A provisioning script that reuses a context id from an earlier run.
- Trying to bring a closed context back with resume.
Response Example
{
"type": "https://docs.ankatech.co/errors/exchange-context-not-active",
"title": "Exchange Context Not Active",
"status": 409,
"detail": "Exchange Context 5a9d3e7f-1b2c-4d6e-8f0a-2c4e6a8b0d13 is CLOSED, which is terminal: it accepts no new grant or Exchange and cannot be resumed.",
"instance": "/api/v3/admin/tenants/7c9e6679-7425-40de-944b-e07fc1f90ae7/capability-grants",
"timestamp": 1730000000,
"extensions": {
"status": "CLOSED",
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Content-Type: application/problem+json, following RFC 9457 Problem Details. The context id in detail is the one your request named, in your own tenant; a context of another tenant is answered 404 instead.
How to Resolve
- Read
extensions.status. SUSPENDED: resume the context withresumeExchangeContextwhen the reason for the suspension is settled, then repeat the request.CLOSED: the context is finished. Create a new Exchange Context withcreateExchangeContextand build the grant or Exchange there.- To keep one relationship running while another in the same context is held, suspend the Exchange (
suspendExchange) rather than the context.
For full schema definitions, examples, and interactive testing, see the Developer Hub Reference.