Skip to main content
POST
Upsert routing rule

Restrictions

Usage

  • The whole rule is replaced: cases, sections or default missing from the request are removed. version increases on every call and the previous version is kept in the route history.
  • At least one of cases or default is required; a default with empty channel_ids counts as absent.
  • Only shared integrations have routing rules: a channel-exclusive or unknown integration_id, or a channel ID that does not exist, returns InvalidParameter.
  • When the integration belongs to a team, the caller must be the account owner or an admin, the integration’s creator, or a member of that team; otherwise AccessDenied.
  • A successful response carries only request_id, with no data field.
  • Every call is recorded in the account audit log.

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

Creates the integration's routing rule, or replaces it entirely when one exists. At least one of cases or default must be provided.

integration_id
integer<int64>
required

Shared integration ID; obtain it from POST /integration/list. Channel-exclusive integrations are rejected with InvalidParameter.

cases
object[]

Ordered list of case branches. Cases are evaluated top to bottom.

sections
object[]

Optional sections that group consecutive cases for display.

default
object

Fallback branch used when no case yields a channel. Omitting it removes any existing default branch.

version
integer<int64>

Ignored. The server increments version on every upsert and does not compare it with this value.

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

No payload. Depending on the operation, data is {} or omitted from the envelope; rely only on the HTTP 200 status and the absence of error.