workspace

Update a workspace flag

Changed on

Enable or disable a flag for your workspace. Use workspace.getFlags to find flag slugs and check whether they can be enabled or disabled.

Required Permissions

Your root key must have the following permission:

  • unkey:v1:<workspace_id>:flags#write
post/v2/workspace.updateFlag

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/workspace.updateFlag
  • Auth
    HTTP bearer

Request body

slugstring required

Lowercase snake_case slug of the flag to update, as returned by workspace.getFlags.

enabledboolean required

Set to true to enable the flag or false to disable it, regardless of the flag's default.

Response

Flag updated successfully. The data object is empty.

dataEmptyResponse required

Empty response object by design. A successful response indicates this operation was successfully executed.

Example response

{
  "meta": {
    "requestId": "req_123"
  }
}

Changes