Revoke a card grant
/v1/businesses/{id}/memberships/{membershipId}/card-grants/{grantId}/revokeRequires an API client bearer token.
Ends an active grant (409 grant_not_active otherwise). Without effective_at, or with one not after now, the grant ends at once: its card is terminated, card.closing announces it with closes_at now, and card_grant.ended is emitted. With a later effective_at the end is scheduled: card.closing announces that date for the grant's card, and the grant ends then. A scheduled revoke is never rescheduled (409 revoke_already_scheduled, whatever the date; revoke now to end it sooner), and never at or after the grant's own valid_until (409 revoke_after_grant_end), so no closure is announced later than the real one. A grant whose card is already lost, stolen or terminated ends at once whatever the effective_at, since its card has already closed. Requires an Idempotency-Key. An API client names its acting person in X-Rigid-Acting-Person (400 acting_person_required without it); the person needs an active membership of the business with can_grant_cards, else 403 acting_person_not_permitted. Every call the route decides (the release flag on, a well-formed body, and a valid Idempotency-Key not already used with a different body), allowed or refused, writes one audit intent with the API client, the asserted person, the business and the decision; a replay of a stored outcome writes none, and neither does a 5xx. While the `business-cards` release flag is off for the caller's mode this route answers 404 to every authenticated, well-formed request not replaying an outcome stored while it was on, as if absent.
Parameters
Path parameters
| Name | Required | Description |
|---|---|---|
| id | required | |
| membershipId | required | |
| grantId | required |
Header parameters
| Name | Required | Description |
|---|---|---|
| Idempotency-Key | required | Client-chosen. An identical retry with the same key returns the stored response; reusing the key with a different payload returns 409. |
| X-Rigid-Acting-Person | optional |
Request body
Example
curl -X POST https://api.rigid.fi/v1/businesses/{id}/memberships/{membershipId}/card-grants/{grantId}/revoke \
-H "Authorization: Bearer $RIGID_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"effective_at": "date-time"
}'Responses
200The grant, ended or with its end scheduled.
+ show properties− hide properties
One of
Option 1
{
"type": "string",
"enum": [
"revoked",
"expired",
"membership_removed",
"business_closed"
]
}Option 2
{
"type": "null"
}Option 3
{
"type": "null"
}400Validation error
401Authentication required
403The acting person is not permitted; admin_kyc_not_complete
404Business or grant not found, or the business routes are not released
409Idempotency-Key reused with a different payload; grant_not_active; revoke_already_scheduled; revoke_after_grant_end; business_closed
500Internal server error