Skip to content

Give a member access, or change it

POST
/api/v1/grants
curl --request POST \
--url http://localhost:3000/api/v1/grants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "user": "example", "resource": "organization", "resourceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scope": "read" }'

A scope on the organization (its admins only), a project, a collection or one asset (admins of the project), held by a member (user) or a group (group). Grants add up and reach down. Only for people already in the organization; invite anyone else. With project, a share: another project of the organization reads a brand, collection or asset where it is (admin on it shares it).

Any caller; the scope needed is checked on what it acts on.

Media typeapplication/json
Any of:
object
user
required

A member’s user id, from /api/v1/members

string
>= 1 characters <= 64 characters
resource
required

What the grant is on; it reaches everything inside it

string
Allowed values: organization project collection asset brand
resourceId
required

The organization’s, project’s, collection’s or asset’s id

string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
scope
required
string
Allowed values: read propose write admin

The grant, or the share

Media typeapplication/json
object
data
required
Any of:
object
id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
resource
required
string
Allowed values: organization project collection asset brand
resourceId
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
projectId
required
Any of:
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
label
required

The name of what it is on

string | null
scope
required
string
Allowed values: read propose write admin
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
Example
{
"data": {
"resource": "organization",
"scope": "read"
}
}

An error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": "example"
}
}