Skip to main content
Salfio Docs

Search documentation

Type to search this documentation.

On this pageOverview

Replace a client's assignment rules

Replace-all upsert of the client's assignment rules. Each rule binds an integration to the client via **either** a raw `filterCriteria` object **or**, for Slack, the `slackChannels` shorthand — a list of channel names the server expands into the equivalent criteria, so you never have to hand-build the query structure. The two are mutually exclusive, and `slackChannels` is only valid on a Slack integration. Replace semantics: any integration **omitted** from `rules` has its existing rule removed. Send an empty `rules` array to clear every rule. A save re-applies the rules to the client's existing conversations (see `reapplyStats`) and can start a Slack history backfill. Use a GET-then-PUT flow to avoid unintentionally wiping rules you didn't mean to touch. Cross-tenant clients and integrations return `404 not_found` / `400 invalid_argument` with no existence leak.

PUT

/clients/{clientId}/assignment-rules

bearerAuth``

AuthorizationBearer <token>

Salfio API tokens start with the literal prefix sk_live_ followed by 32 base62 characters (≈190 bits of entropy). Tokens are hashed at rest with argon2id and shown to the user only once at creation.

In: header

clientId*string

Client UUID.

Formatuuid

application/json

TypeScript Definitions

Use the request body type in TypeScript.

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://api.salfio.com/v1/clients/497f6eca-6276-4993-bfeb-53cbbbba6f08/assignment-rules" \  -H "Content-Type: application/json" \  -d '{    "rules": [      {        "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e"      }    ]  }'

{
  "meta": {
    "cursor": "string",
    "hasMore": true
  },
  "data": {
    "rules": [
      {
        "ruleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
        "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e",
        "integrationType": "slack",
        "providerEmail": "string",
        "filterCriteria": null,
        "enabled": true,
        "priority": 0,
        "readOnly": true,
        "rulesHidden": true,
        "chatLabels": {
          "property1": "string",
          "property2": "string"
        },
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z"
      }
    ],
    "reapplyStats": {
      "conversationsEvaluated": 0,
      "conversationsMatched": 0,
      "assignmentsCreated": 0,
      "assignmentsRemoved": 0
    }
  }
}

{
  "error": {
    "code": "invalid_argument",
    "message": "limit must be an integer between 1 and 100"
  }
}

{
  "error": {
    "code": "unauthorized",
    "message": "Authentication required"
  }
}

{
  "error": {
    "code": "not_found",
    "message": "client not found"
  }
}

{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded",
    "details": {
      "retry_after_seconds": 30
    }
  }
}
Export
Suggest an edit to this page

Documentation menu