# Cerbos (latest)

Download OpenAPI specification: [Download](blob:https://docs.cerbos.dev/4ef322e7-0b55-4c2a-bafd-432bdb18545b)

Cerbos: [info@cerbos.dev](mailto:info@cerbos.dev)URL: [https://cerbos.dev](/content/site-root.html)

## CerbosService

Cerbos Policy Decision Point

### Check Deprecated

[Deprecated: Use CheckResources API instead] Check whether a principal has permissions to perform the given actions on a set of resource instances.

#### Request Body schema: application/json  required

|     |     |
| --- | --- |
| requestId | string<br>Optional application-specific ID useful for correlating logs for analysis. |
| actions<br>required | Array of strings non-empty  unique <br>List of actions being performed on the set of resources. |
| principal<br>required | object (enginev1Principal) <br>A person or application attempting to perform the actions on the set of resources. |
| resource<br>required | object (v1ResourceSet) <br>Set of resources to check |
| includeMeta | boolean<br>Opt to receive request processing metadata in the response. |
| auxData | object (cerbosrequestv1AuxData) <br>Structured auxiliary data useful for evaluating the request |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Request samples

- Payload

Content type

application/json

```json
{"requestId": "c2db17b8-4f9f-4fb1-acfd-9162a02be42b",

"actions": ["view:public",

"comment"

],

"principal": {"id": "bugs_bunny",

"policyVersion": "default",

"roles": ["user"

],

"attr": {"beta_tester": true

},

"scope": "acme.corp"

},

"resource": {"kind": "album:object",

"policyVersion": "default",

"instances": {"XX125": {"attr": {"owner": "bugs_bunny",

"public": false,

"flagged": false

}

},

"XX225": {"attr": {"owner": "daffy_duck",

"public": true,

"flagged": false

}

}

},

"scope": "^(0(\.)*)*$"

},

"includeMeta": true,

"auxData": {"jwt": {"token": "eyJhbGciOiJFUzM4NCIsImtpZCI6IjE5TGZaYXRFZGc4M1lOYzVyMjNndU1KcXJuND0iLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsiY2VyYm9zLWp3dC10ZXN0cyJdLCJjdXN0b21BcnJheSI6WyJBIiwiQiIsIkMiXSwiY3VzdG9tSW50Ijo0MiwiY3VzdG9tTWFwIjp7IkEiOiJBQSIsIkIiOiJCQiIsIkMiOiJDQyJ9LCJjdXN0b21TdHJpbmciOiJmb29iYXIiLCJleHAiOjE5NDk5MzQwMzksImlzcyI6ImNlcmJvcy10ZXN0LXN1aXRlIn0.WN_tOScSpd_EI-P5EI1YlagxEgExSfBjAtcrgcF6lyWj1lGpR_GKx9goZEp2p_t5AVWXN_bjz_sMUmJdJa4cVd55Qm1miR-FKu6oNRHnSEWdMFmnArwPw-YDJWfylLFX",

"keySetId": "my-keyset"

}

}
```

### Response samples

- 200
- default

### Check resources

Check a principal's permissions to a batch of heterogeneous resources and actions.

#### Request Body schema: application/json  required

|     |     |
| --- | --- |
| requestId | string<br>Optional application-specific ID useful for correlating logs for analysis. |
| includeMeta | boolean<br>Add request processing metadata to the response. |
| principal<br>required | object (enginev1Principal) <br>A person or application attempting to perform the actions on the set of resources. |
| resources<br>required | Array of objects (CheckResourcesRequestResourceEntry)  non-empty  unique <br>List of resources and actions. |
| auxData | object (cerbosrequestv1AuxData) <br>Structured auxiliary data useful for evaluating the request |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Request samples

- Payload

Content type

application/json

```json
{"requestId": "c2db17b8-4f9f-4fb1-acfd-9162a02be42b",

"includeMeta": true,

"principal": {"id": "bugs_bunny",

"policyVersion": "default",

"roles": ["user"

],

"attr": {"beta_tester": true

},

"scope": "acme.corp"

},

"resources": [{"actions": ["view",

"comment"

],

"resource": {"kind": "album:object",

"policyVersion": "default",

"id": "XX125",

"attr": {"owner": "bugs_bunny",

"public": false,

"flagged": false

}}}],

"keySetId": "my-keyset"

}

}
```

### Response samples

- 200
- default

## CerbosAdminService

Cerbos administration service

### List audit log entries

- Authorizations:

_BasicAuth_

#### path Parameters

|     |     |
| --- | --- |
| kind<br>required | string<br>Enum:"KIND_UNSPECIFIED" "KIND_ACCESS" "KIND_DECISION"<br>Kind of log entry |

#### query Parameters

|     |     |
| --- | --- |
| tail | integer <int64> <br>Last N entries. |
| between.start<br>required | string <date-time> <br>Start date in ISO 8601 format. |
| between.end<br>required | string <date-time> <br>End date in ISO 8601 format. |
| since | string<br>Entries since N hours/minutes ago |
| lookup | string^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$<br>By Call ID |

### Responses

**200**

A successful response.(streaming responses)

**default**

An unexpected error response.

### Request samples

- 200
- default

### List policies

- Authorizations:

_BasicAuth_

#### query Parameters

|     |     |
| --- | --- |
| includeDisabled | boolean<br>Include disabled policies |
| nameRegexp | string<br>Filter policies by name with regexp |
| scopeRegexp | string<br>Filter policies by scope with regexp |
| versionRegexp | string<br>Filter policies by version with regexp |
| policyId | Array of strings<br>For blob, disk, git stores use file name (.yaml). For mysql, postgres, sqlite3 use id (..) of the policy |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Inspect policies

- Authorizations:

_BasicAuth_

#### query Parameters

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Get policy

- Authorizations:

_BasicAuth_

#### query Parameters

|     |     |
| --- | --- |
| id<br>required | Array of strings<br>For blob, disk, git stores use file name (.yaml). For mysql, postgres, sqlite3 use id (..) of the policy |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Disable policy

- Authorizations:

_BasicAuth_

#### query Parameters

|     |     |
| --- | --- |
| id<br>required | Array of strings<br>Unique identifier for the policy |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Add or update policies

- Authorizations:

_BasicAuth_

#### Request Body schema: application/json  required

|     |     |
| --- | --- |
| policies<br>required | Array of objects (v1Policy)  \[ 1 .. 100 \] items <br>List of policies. |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Get schema

- Authorizations:

_BasicAuth_

#### query Parameters

|     |     |
| --- | --- |
| id<br>required | Array of strings<br>Unique identifier for the schema |

### Responses

**200**

A successful response.

**default**

An unexpected error response.

### Reload store

- Authorizations:

_BasicAuth_

#### query Parameters

|     |     |
| --- | --- |
| wait | boolean<br>Wait until the reloading process finishes |

### Responses

**200**

A successful response.

**default**

An unexpected error response.
