Skip to content

Assign a role

POST
/role-assignments
curl --request POST \
--url https://example.com/api/v1/role-assignments \
--header 'Content-Type: application/json' \
--cookie __Host-shardkeep_session=<__Host-shardkeep_session> \
--data '{ "roleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "teamId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scope": { "kind": "GLOBAL", "teamId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "serverId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } }'

Give a role to exactly one of a user or a team, at a global, team or server scope. Node permissions only take effect at global scope.

Media typeapplication/json

Set exactly one of userId and teamId.

object
roleId
required
string format: uuid
userId
string format: uuid
teamId
string format: uuid
scope
required

Where an assignment applies. GLOBAL covers everything; TEAM covers the servers the team owns (set teamId); SERVER covers one server (set serverId).

object
kind
required
string
Allowed values: GLOBAL TEAM SERVER
teamId
string format: uuid
serverId
string format: uuid

Role assigned.

Media typeapplication/json
object
id
required
string format: uuid
roleId
required
string format: uuid
userId
string format: uuid
teamId
string format: uuid
scope
required

Where an assignment applies. GLOBAL covers everything; TEAM covers the servers the team owns (set teamId); SERVER covers one server (set serverId).

object
kind
required
string
Allowed values: GLOBAL TEAM SERVER
teamId
string format: uuid
serverId
string format: uuid
createdAt
required
string format: date-time
Example
{
"scope": {
"kind": "GLOBAL"
}
}

The request is invalid.

Media typeapplication/problem+json

An RFC 9457 problem with a machine-readable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
code
required

Stable machine-readable error code.

string
Example
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"code": "conflict"
}

Not signed in, or the credentials are invalid.

Media typeapplication/problem+json

An RFC 9457 problem with a machine-readable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
code
required

Stable machine-readable error code.

string
Example
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"code": "conflict"
}

Signed in, but not allowed.

Media typeapplication/problem+json

An RFC 9457 problem with a machine-readable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
code
required

Stable machine-readable error code.

string
Example
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"code": "conflict"
}

Clashes with existing data or state.

Media typeapplication/problem+json

An RFC 9457 problem with a machine-readable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
code
required

Stable machine-readable error code.

string
Example
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"code": "conflict"
}