Skip to content
Skip to Content
Coder Docs

Check authorization

POST
/api/v2/authcheck

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Request Body

Authorization request

application/json
  1. body
checks?

Checks is a map keyed with an arbitrary string to a permission check. The key can be any string that is helpful to the caller, and allows multiple permission checks to be run in a single request. The key ensures that each permission check has the same key in the response.

Response Body

OK

application/json
  1. response
[key: string]?boolean

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/authcheck" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "checks": {    "property1": {      "action": "create",      "object": {        "any_org": true,        "organization_id": "string",        "owner_id": "string",        "resource_id": "string",        "resource_type": "*"      }    },    "property2": {      "action": "create",      "object": {        "any_org": true,        "organization_id": "string",        "owner_id": "string",        "resource_id": "string",        "resource_type": "*"      }    }  }}'
Example Response200
{  "property1": true,  "property2": true}