Ga naar inhoud

List policies

GET
/api/v1/policies
curl --request GET \
--url https://example.com/api/v1/policies \
--cookie bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E

OK.

Media typeapplication/json

A page of a list. next_cursor is null on the last page.

object
items
required
Array

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
next_cursor

Pass as cursor for the next page.

string | null

Example generated

{
"items": [
{
"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"
}
],
"next_cursor": "example"
}

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