Skip to main content
POST
/
orgs
/
{org_id}
/
k2
/
{kb_id}
/
policies
/
{policy_id}
/
assignments
cURL
curl --request POST \
  --url https://api.timbal.ai/orgs/{org_id}/k2/{kb_id}/policies/{policy_id}/assignments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "role_id": "<string>",
  "enabled": true,
  "priority": 123,
  "valid_from": "2023-11-07T05:31:56Z",
  "valid_until": "2023-11-07T05:31:56Z"
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "enabled": true,
  "granted_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "policy_id": "<string>",
  "priority": 123,
  "role_id": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "granted_by": "<string>",
  "revoked_at": "2023-11-07T05:31:56Z",
  "revoked_by": "<string>",
  "valid_from": "2023-11-07T05:31:56Z",
  "valid_until": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required
kb_id
string
required
policy_id
string
required

Body

application/json
role_id
string
required
combine_mode
enum<string>

Postgres-RLS-style combination semantic for a policy binding.

Available options:
restrictive,
permissive
enabled
boolean
priority
integer<int32>
valid_from
string<date-time> | null
valid_until
string<date-time> | null

Response

Assignment created or re-attached

combine_mode
enum<string>
required

Postgres-RLS-style combination semantic for a policy binding.

Available options:
restrictive,
permissive
created_at
string<date-time>
required
enabled
boolean
required
granted_at
string<date-time>
required
id
string
required
policy_id
string
required
priority
integer<int32>
required
role_id
string
required
updated_at
string<date-time>
required
granted_by
string | null
revoked_at
string<date-time> | null
revoked_by
string | null
valid_from
string<date-time> | null
valid_until
string<date-time> | null