Change a policy
const url = 'https://example.com/api/v1/policies/example';const options = { method: 'PUT', headers: { cookie: 'bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E', 'Content-Type': 'application/json' }, body: '{"id":"example","title":"example","description":"example","permissions":[{"action":"example","constraints":[{"left_operand":"example","operator":"example","right_operand":"example"}]}],"prohibitions":[{"action":"example","constraints":[{"left_operand":"example","operator":"example","right_operand":"example"}]}],"obligations":[{"action":"example","constraints":[{"left_operand":"example","operator":"example","right_operand":"example"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/policies/example \ --header 'Content-Type: application/json' \ --cookie bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E \ --data '{ "id": "example", "title": "example", "description": "example", "permissions": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "prohibitions": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "obligations": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the policy.
Request Bodyrequired
Section titled “Request Bodyrequired”A policy in the terms of the management API; rendered as ODRL in the catalog.
object
A permission, prohibition or obligation.
object
E.g. use, read, write.
A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].
object
bl:membership, bl:role, bl:participant, odrl:dateTime,
odrl:purpose or bl:signedRequests.
eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.
A string, a list of strings, a date-time or a boolean.
A permission, prohibition or obligation.
object
E.g. use, read, write.
A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].
object
bl:membership, bl:role, bl:participant, odrl:dateTime,
odrl:purpose or bl:signedRequests.
eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.
A string, a list of strings, a date-time or a boolean.
A permission, prohibition or obligation.
object
E.g. use, read, write.
A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].
object
bl:membership, bl:role, bl:participant, odrl:dateTime,
odrl:purpose or bl:signedRequests.
eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.
A string, a list of strings, a date-time or a boolean.
Example generated
{ "id": "example", "title": "example", "description": "example", "permissions": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "prohibitions": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "obligations": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ]}Responses
Section titled “Responses”OK.
A policy as the management API shows it.
object
A permission, prohibition or obligation.
object
E.g. use, read, write.
A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].
object
bl:membership, bl:role, bl:participant, odrl:dateTime,
odrl:purpose or bl:signedRequests.
eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.
A string, a list of strings, a date-time or a boolean.
A permission, prohibition or obligation.
object
E.g. use, read, write.
A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].
object
bl:membership, bl:role, bl:participant, odrl:dateTime,
odrl:purpose or bl:signedRequests.
eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.
A string, a list of strings, a date-time or a boolean.
A permission, prohibition or obligation.
object
E.g. use, read, write.
A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].
object
bl:membership, bl:role, bl:participant, odrl:dateTime,
odrl:purpose or bl:signedRequests.
eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.
A string, a list of strings, a date-time or a boolean.
The policy as ODRL, as it goes into the catalog.
object
The policy in a sentence, for people.
Example generated
{ "id": "example", "title": "example", "description": "example", "permissions": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "prohibitions": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "obligations": [ { "action": "example", "constraints": [ { "left_operand": "example", "operator": "example", "right_operand": "example" } ] } ], "odrl": {}, "summary": "example"}The request is not valid.
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" }}