Revoke an agreement
const url = 'https://example.com/api/v1/agreements/example/revoke';const options = { method: 'POST', headers: { cookie: 'bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E', 'Content-Type': 'application/json' }, body: '{"reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/agreements/example/revoke \ --header 'Content-Type: application/json' \ --cookie bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E \ --data '{ "reason": "example" }'As provider: no new transfers under the agreement, running ones end, and a new request of the consumer waits for approval. The reason goes to the consumer.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the agreement.
Request Bodyrequired
Section titled “Request Bodyrequired”object
At most 500 characters; travels to the counterparty.
Example generated
{ "reason": "example"}Responses
Section titled “Responses”OK.
An agreement as the management API shows it.
object
The negotiation that closed it; none for an agreement for own use.
The aanwijzing an agreement for own use comes from (decisions #74).
The agreement as ODRL.
object
provider or consumer: our side.
List only.
List only.
Single agreement only: its transfers (id, state, role, updated_at).
object
Set when the provider revoked the agreement.
Set when the agreement was terminated.
The objects the agreement covers.
The points it covers; null: all points of the objects.
Data from before this moment is not covered.
Provider only: how the consumer uses the agreement (decisions #76, #77).
object
The consumer has a running transfer.
Not running: since when; never used: since the agreement.
A data plane told how it was used; otherwise only running is known.
Example
{ "role": "provider", "negotiation_state": "INITIAL"}The reason is too long.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}No valid session, DPoP-bound token or API key.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}The caller lacks the role this operation needs; or a change with the session cookie came from a page of another site (cross_site_request, decisions #83).
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}Not found.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}Not ours to revoke, or already revoked.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}