Skip to main content
POST
Create or update a role

Restrictions

Usage

  • Omit role_id (or set it to 0) to create a role; a new ID is always assigned. Pass the ID of a custom role of your account to update it; any other ID returns 400 InvalidParameter (no role found by id), and a built-in role ID (2, 6, 8) returns 400 InvalidParameter (Preset roles cannot be modified.).
  • role_name must be unique in the account, including the built-in names Admin, Responder, and Viewer; a conflict returns 400.
  • An update overwrites role_name, description, and permission_ids together: omitting description clears it, and omitting permission_ids removes every permission from the role.
  • Updating a disabled role keeps it disabled; call POST /role/enable to enable it.
  • Every ID in permission_ids must be a permission returned by POST /role/permission/list (with with_all: true); otherwise the call returns 400 and nothing changes.
  • Every call is recorded in the account audit log. Don’t put secrets in request fields.

Authorizations

app_key
string
query
required

APP Key created in the Flashduty console under My → APP Key. Send it as the app_key query parameter or in the Fd-App-Key request header. Its effective access is the intersection of the key's permission scope and the creator's current role permissions. Keep it secret.

Body

application/json

Parameters for creating or updating a custom role.

role_name
string
required

Role display name. 1–39 characters.

Required string length: 1 - 39
role_id
integer<uint64>

ID of the custom role to update. Omit or set to 0 to create a new role. Do not pass the built-in role IDs 2, 6, or 8.

description
string

Role description, up to 499 characters. Omitting it on update clears the stored description.

Maximum string length: 499
permission_ids
integer<uint64>[]

IDs of the permissions the role grants (from POST /role/permission/list). Replaces the existing set; omitting it or sending an empty array leaves the role with no permissions.

Response

Success

Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.

request_id
string
required

Unique ID for this request. Mirrored in the Flashcat-Request-Id response header. Include it when reporting issues.

Example:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

data
object

Role create/update result.