post_allocations_by_orgid_revoke
Calls POST /api/allocations/{orgId}/revoke as the signed-in person · REST reference
Take back part of an organization's unspent voucher budget
Debits CENTS from the organization's ORG_ALLOCATION account, returning them to what the pool may grant. Only the UNSPENT allocation can be revoked — what batches already committed stays committed. The reason is recorded on the ledger transaction. TWO GATES, NOT ONE. The platform-staff middleware is the outer one; the caller's own bearer token is then forwarded so the DAL evaluates the real actor against execute:RevokeOrgAllocationCommand. A platform staffer without that command is refused by the DAL with 403. A non-positive amount, more than the unspent allocation, an organization with no allocation account, a reason under 10 characters or a non-UUID orgId answer 400. An organization that does not exist answers 404. A revoke that lost a race with another write to the same allocation answers 409 — retry it. A DAL that does not answer is 503.
Arguments
| Argument | Type | Description | |
|---|---|---|---|
orgIdpath | string (uuid) | required | Organization whose allocation to reduce. |
bodyJSON | object | required | The request body, as a JSON object. Its fields are listed below. |
Fields of body
| Field | Type | Description | |
|---|---|---|---|
amount | integer | required | CENTS to take back. A positive integer, at most the organization's unspent allocation. |
currency | string | Currency of the allocation account. Defaulted by the DAL, not here. | |
reason | string | required | Why, recorded on the ledger transaction. At least 10 characters. |
Example call
A client sends this over the MCP session; Claude and other agents build it for you. The values are placeholders — the shape is real.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "post_allocations_by_orgid_revoke",
"arguments": {
"orgId": "11111111-1111-4111-8111-111111111111",
"body": {
"amount": 1,
"reason": "string",
"currency": "USD"
}
}
}
}Result
On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.
The allocation was reduced, verbatim as the DAL reports it.
{
"accountId": "11111111-1111-4111-8111-111111111111",
"amount": 1,
"currency": "string",
"newBalance": 1,
"orgId": "11111111-1111-4111-8111-111111111111",
"transactionId": "11111111-1111-4111-8111-111111111111"
}Fields
| Field | Type | Description |
|---|---|---|
accountId | string (uuid) | The ORG_ALLOCATION account debited. |
amount | integer | Amount revoked by THIS call, in CENTS. |
currency | string | |
newBalance | integer | The org's allocation balance after the revoke, in CENTS. |
orgId | string (uuid) | |
transactionId | string (uuid) | Ledger transaction recording the revoke. |
When it fails
A failed call returns isError: true with the API's message as text. A change the person declines, or lets time out, also comes back this way and nothing changes.
400The request was malformed or failed a guard.
403Authenticated, but the caller holds none of the required permissions.
404No such resource — or none this caller may see.
409The resource is not in a state that allows this operation.
What the model is shown
This is the tool exactly as the server lists it in tools/list. The description starts with the REST call it makes.
{
"name": "post_allocations_by_orgid_revoke",
"description": "POST /api/allocations/{orgId}/revoke — Debits CENTS from the organization's ORG_ALLOCATION account, returning them to what the pool may grant. Only the UNSPENT allocation can be revoked — what batches already committed stays committed. The reason is recorded on the ledger transaction. TWO GATES, NOT ONE. The platform-staff middleware is the outer one; the caller's own bearer token is then forwarded so the DAL evaluates the real actor against `execute:RevokeOrgAllocationCommand`. A platform staffer without that command is refused by the DAL with 403. A non-positive amount, more than the unspent allocation, an organization with no allocation account, a reason under 10 characters or a non-UUID `orgId` answer 400. An organization that does not exist answers 404. A revoke that lost a race with another write to the same allocation answers 409 — retry it. A DAL that does not answer is 503.\n\nThis changes data. The person is asked to confirm it before it runs, and nothing happens if they decline.",
"inputSchema": {
"type": "object",
"properties": {
"orgId": {
"type": "string",
"description": "Organization whose allocation to reduce."
},
"body": {
"type": "string",
"description": "The JSON request body: { amount*: integer (CENTS to take back.); currency: string (Currency of the allocation account.); reason*: string (Why, recorded on the ledger transaction.) }"
}
},
"required": [
"orgId",
"body"
]
},
"annotations": {
"readOnlyHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": false
}
}