Skip to main content
PUT
Upsert many roles

Authorizations

X-API-Key
string
header
required

Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.

Query Parameters

update
string[]
required

Columns to overwrite when the row already exists. Repeat the parameter for each column: a single comma-separated value is read as one column name and fails at the database. Without the parameter the request is rejected with 400.

Body

application/json
name
string
required

Role name. At least one character.

Minimum string length: 1
id
string<uuid>

Unique id. Generated on create unless you supply one.

description
string | null

What the role is for.

permissions
string[]

Legacy flat permission strings. Defaults to empty.

Legacy permission string.

permissionsV2
object[]

Fine-grained permission statements. This is the form the app writes today.

isApiKey
boolean
default:false

true for the synthetic role behind an API key. Leave it alone on roles you create.

createdAt
string<date-time>

When the record was created.

updatedAt
string<date-time>

When the record last changed.

Response

The upserted roles.

values
object[]
required