Ga naar inhoud

Change a policy

PUT
/api/v1/policies/{id}
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" } ] } ] }'
id
required
string

The id of the policy.

Media typeapplication/json

A policy in the terms of the management API; rendered as ODRL in the catalog.

object
id
required
string
title
string
description
string | null
permissions
Array<object>

A permission, prohibition or obligation.

object
action
required

E.g. use, read, write.

string
constraints
Array<object>

A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].

object
left_operand
required

bl:membership, bl:role, bl:participant, odrl:dateTime, odrl:purpose or bl:signedRequests.

string
operator
required

eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.

string
right_operand
required

A string, a list of strings, a date-time or a boolean.

prohibitions
Array<object>

A permission, prohibition or obligation.

object
action
required

E.g. use, read, write.

string
constraints
Array<object>

A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].

object
left_operand
required

bl:membership, bl:role, bl:participant, odrl:dateTime, odrl:purpose or bl:signedRequests.

string
operator
required

eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.

string
right_operand
required

A string, a list of strings, a date-time or a boolean.

obligations
Array<object>

A permission, prohibition or obligation.

object
action
required

E.g. use, read, write.

string
constraints
Array<object>

A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].

object
left_operand
required

bl:membership, bl:role, bl:participant, odrl:dateTime, odrl:purpose or bl:signedRequests.

string
operator
required

eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.

string
right_operand
required

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"
}
]
}
]
}

OK.

Media typeapplication/json

A policy as the management API shows it.

object
id
required
string
title
string
description
string | null
permissions
Array<object>

A permission, prohibition or obligation.

object
action
required

E.g. use, read, write.

string
constraints
Array<object>

A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].

object
left_operand
required

bl:membership, bl:role, bl:participant, odrl:dateTime, odrl:purpose or bl:signedRequests.

string
operator
required

eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.

string
right_operand
required

A string, a list of strings, a date-time or a boolean.

prohibitions
Array<object>

A permission, prohibition or obligation.

object
action
required

E.g. use, read, write.

string
constraints
Array<object>

A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].

object
left_operand
required

bl:membership, bl:role, bl:participant, odrl:dateTime, odrl:purpose or bl:signedRequests.

string
operator
required

eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.

string
right_operand
required

A string, a list of strings, a date-time or a boolean.

obligations
Array<object>

A permission, prohibition or obligation.

object
action
required

E.g. use, read, write.

string
constraints
Array<object>

A condition of a rule, e.g. bl:role isAnyOf [climate_optimizer].

object
left_operand
required

bl:membership, bl:role, bl:participant, odrl:dateTime, odrl:purpose or bl:signedRequests.

string
operator
required

eq, isAnyOf, isNoneOf, lt, lteq, gt or gteq.

string
right_operand
required

A string, a list of strings, a date-time or a boolean.

odrl
required

The policy as ODRL, as it goes into the catalog.

object
summary
required

The policy in a sentence, for people.

string

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.

Media typeapplication/json

The body of every failed call to a management API.

object
error
required
object
code
required

Stable, machine-readable: invalid_request, unauthenticated, forbidden, not_found, conflict, upstream_unavailable, unavailable, internal, or a more specific code of the operation.

string
message
required

For people; may change between versions.

string

Example

{
"error": {
"code": "not_found",
"message": "unknown negotiation"
}
}

No valid session, DPoP-bound token or API key.

Media typeapplication/json

The body of every failed call to a management API.

object
error
required
object
code
required

Stable, machine-readable: invalid_request, unauthenticated, forbidden, not_found, conflict, upstream_unavailable, unavailable, internal, or a more specific code of the operation.

string
message
required

For people; may change between versions.

string

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).

Media typeapplication/json

The body of every failed call to a management API.

object
error
required
object
code
required

Stable, machine-readable: invalid_request, unauthenticated, forbidden, not_found, conflict, upstream_unavailable, unavailable, internal, or a more specific code of the operation.

string
message
required

For people; may change between versions.

string

Example

{
"error": {
"code": "not_found",
"message": "unknown negotiation"
}
}

Not found.

Media typeapplication/json

The body of every failed call to a management API.

object
error
required
object
code
required

Stable, machine-readable: invalid_request, unauthenticated, forbidden, not_found, conflict, upstream_unavailable, unavailable, internal, or a more specific code of the operation.

string
message
required

For people; may change between versions.

string

Example

{
"error": {
"code": "not_found",
"message": "unknown negotiation"
}
}