# calypso.routing_manage: Set the Calypso routing rule of an account.

`PUT /v2/accounts/{accountId}/calypso/routing` · MCP tool `calypso_routing_manage` · [Calypso (AI chatter)](/v2/reference/calypso/)

## What it does

Set the Calypso routing rule of an account.

## When to use it

Sets the Calypso routing rule of one account: the conditions that send a fan to the team instead of Calypso. Replaces the whole rule. Simulate first with POST .../calypso/routing/preview. A rule already saved as schema_version 3 cannot be written back as 2 (state_conflict). Rejected with invalid_request, naming the condition: a condition whose value does not fit its field and operator; an in_list condition naming a list id that does not exist on the account, or a system list; a list added to a schema_version 2 rule (it would never match). Does not walk any OnlyFans list from /v2 (the 60-second sweep keeps list membership current). Writes to fans by changing who Calypso answers. Counts against the daily limit of rule changes on this account.

## Permission and cost

| | |
| --- | --- |
| Permission | `calypso:write` |
| Effect | Reaches fans or the public (for example a message or a sale). Daily limits apply per key and per account. |
| Cost class | `store` — costs 1 unit (reads the copy VENUZ keeps) |
| Scope | One account the key can use. |
| Preview and retry | Send `dry_run=true` to preview without changing anything; a real write requires an `Idempotency-Key` header: a retry with the same key within 24 hours returns the first result instead of repeating the change. With a `vzk_test_` key every write is a dry run. |

> If an AI agent writes messages that reach fans, you are responsible for AI-disclosure laws and OnlyFans rules on AI content ([VENUZ Terms](https://app.venuz.ai/legal/terms-of-service) §10.4–10.6).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Id of the account, from `accounts.list` or `api.whoami`. |
| `dry_run` | query | one of "true", "false" | no | Set to "true" to preview the change without making it: nothing is changed and the response carries a preview_id. Only the literal values "true" and "false" are accepted. |
| `preview_id` | query | string | no | The preview_id returned by a preview of this exact request (same operation, path, query and body). Required by operations that say so; valid for 15 minutes and once. |
| `Idempotency-Key` | header | string, up to 255 characters | no | Required unless dry_run=true. A unique value you generate per change (a UUID works). Retrying with the SAME key returns the original result instead of doing the change twice; keys are remembered for 24 hours. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean | yes | The rule is applied. When false it is saved but not applied, and Calypso answers every fan of the account. |
| `ruleset` | object | yes | The conditions of the rule. A fan who matches them is handled by the team (people); every other fan is answered by Calypso. |
| `ruleset.schema_version` | always 2 or always 3 | yes | Format of the rule. 3: in_list values are VENUZ list ids. 2 (older): in_list values are OnlyFans list ids, which never match a fan, so a list cannot be added to a schema_version 2 rule; every other condition means the same in both. |
| `ruleset.logic` | one of "and", "or" | yes | and: the fan matches every group. or: the fan matches at least one group. |
| `ruleset.groups` | array of object | yes |  |
| `ruleset.groups[].logic` | one of "and", "or" | yes | and: the fan meets every condition of the group. or: at least one. |
| `ruleset.groups[].conditions` | array of object | yes |  |
| `ruleset.groups[].conditions[].field` | one of "total_spent", "in_list", "subscription_duration_days", "subscribed_within_hours", "is_subscribed", "total_tips", "total_ppv_purchased", "subscription_price", "auto_renew", "is_performer", "last_active_days", "is_new_fan", … (14 values) | yes | What the condition looks at. total_spent, total_tips, total_ppv_purchased and subscription_price are USD. subscription_duration_days: days subscribed. last_active_days: days since the fan was last active. is_new_fan: the fan has sent fewer than value messages. is_subscribed, auto_renew, is_performer (the fan is a creator) and is_muted are yes/no. in_list: the fan is in lists of the account. language: the language the fan writes in, as ISO 639-1 codes or unknown (a language detected before 2026-10-07T14:15Z counts as unknown). |
| `ruleset.groups[].conditions[].operator` | one of "eq", "gt", "gte", "lt", "lte", "between", "is_any_of", "is_none_of", "is_not", "not_between", "is_empty", "is_not_empty" | yes | Numbers: eq, gt, gte, lt, lte, between and not_between (value to value2), is_empty and is_not_empty (no value). Yes/no fields: is_any_of or is_not. in_list and language: is_any_of or is_none_of. |
| `ruleset.groups[].conditions[].value` | number or boolean or array of string or array of boolean or any, or null | yes | What the field is compared with: a number, yes/no values, list ids for in_list, or language codes (two lowercase letters, or unknown) for language. Null for is_empty and is_not_empty. |
| `ruleset.groups[].conditions[].value2` | number, or null | yes | Upper end for between and not_between; else null. |

## Example request (test mode)

With a test key in `VENUZ_API_KEY` (`export VENUZ_API_KEY=vzk_test_…`), this request changes nothing: test keys answer from a sample dataset.

```bash
curl -X PUT "https://open.venuz.ai/v2/accounts/3a9e1c7b-2d4f-4b8a-9c6e-1f0d2b3a4c5e/calypso/routing?dry_run=true" \
  -H "Authorization: Bearer $VENUZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"ruleset":{"schema_version":2,"logic":"and","groups":[{"logic":"and","conditions":[{"field":null,"operator":null,"value":null,"value2":null}]}]}}'
```

## Example response (200)

```json
{
  "dry_run": true,
  "preview_id": "pv_test_00000000-0000-4000-8000-000000000000",
  "expires_at": "2030-01-01T00:00:00.000Z",
  "preview": {
    "before": null,
    "after": {
      "enabled": true,
      "ruleset": {
        "schema_version": 2,
        "logic": "or",
        "groups": [
          {
            "logic": "and",
            "conditions": [
              {
                "field": "total_spent",
                "operator": "gte",
                "value": 500,
                "value2": null
              }
            ]
          }
        ]
      }
    },
    "undo": {
      "status": "unavailable",
      "reason": "This account had no routing rule before this change: undoing would have to delete the rule, which this API does not do."
    }
  }
}
```

## Response fields

### When the change is made

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | object | yes | The OnlyFans account this data belongs to, with its connection state. |
| `account.id` | string (uuid) | yes |  |
| `account.name` | string | yes | Display name of the account in VENUZ, set by the agency. |
| `account.connection` | object | yes |  |
| `account.connection.state` | one of "connected", "connecting", "disconnected" | yes | Connection state of the OnlyFans account in VENUZ, from our stored record. Some accounts not yet moved to the new connection may read disconnected here; checks on the account are not available for them yet. |
| `account.connection.last_connected_at` | string (date-time), or null | yes | When VENUZ last saw the account connected. Null if never. |
| `enabled` | boolean | yes | The rule is applied. When false it is saved but not applied, and Calypso answers every fan of the account. |
| `ruleset` | object | yes | The conditions of the rule. A fan who matches them is handled by the team (people); every other fan is answered by Calypso. |
| `ruleset.schema_version` | always 2 or always 3 | yes | Format of the rule. 3: in_list values are VENUZ list ids. 2 (older): in_list values are OnlyFans list ids, which never match a fan, so a list cannot be added to a schema_version 2 rule; every other condition means the same in both. |
| `ruleset.logic` | one of "and", "or" | yes | and: the fan matches every group. or: the fan matches at least one group. |
| `ruleset.groups` | array of object | yes |  |
| `ruleset.groups[].logic` | one of "and", "or" | yes | and: the fan meets every condition of the group. or: at least one. |
| `ruleset.groups[].conditions` | array of object | yes |  |
| `ruleset.groups[].conditions[].field` | one of "total_spent", "in_list", "subscription_duration_days", "subscribed_within_hours", "is_subscribed", "total_tips", "total_ppv_purchased", "subscription_price", "auto_renew", "is_performer", "last_active_days", "is_new_fan", … (14 values) | yes | What the condition looks at. total_spent, total_tips, total_ppv_purchased and subscription_price are USD. subscription_duration_days: days subscribed. last_active_days: days since the fan was last active. is_new_fan: the fan has sent fewer than value messages. is_subscribed, auto_renew, is_performer (the fan is a creator) and is_muted are yes/no. in_list: the fan is in lists of the account. language: the language the fan writes in, as ISO 639-1 codes or unknown (a language detected before 2026-10-07T14:15Z counts as unknown). |
| `ruleset.groups[].conditions[].operator` | one of "eq", "gt", "gte", "lt", "lte", "between", "is_any_of", "is_none_of", "is_not", "not_between", "is_empty", "is_not_empty" | yes | Numbers: eq, gt, gte, lt, lte, between and not_between (value to value2), is_empty and is_not_empty (no value). Yes/no fields: is_any_of or is_not. in_list and language: is_any_of or is_none_of. |
| `ruleset.groups[].conditions[].value` | number or boolean or array of string or array of boolean or any, or null | yes | What the field is compared with: a number, yes/no values, list ids for in_list, or language codes (two lowercase letters, or unknown) for language. Null for is_empty and is_not_empty. |
| `ruleset.groups[].conditions[].value2` | number, or null | yes | Upper end for between and not_between; else null. |
| `change` | object | yes |  |
| `change.id` | string (uuid) | yes | The id of this change in the agency activity log. To reverse it, call POST /v2/changes/{changeId}/undo with this id. |
| `change.undo` | object | yes | Whether POST /v2/changes/{changeId}/undo can reverse this change. |
| `change.undo.status` | always "available" | yes |  |
| `change.undo.reason` | string | yes | Why this change cannot be undone (for example, it is final or it deleted data). |

### Dry run (`dry_run=true`, and every write with a test key)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dry_run` | always true | yes | This was a preview: nothing was changed. |
| `preview_id` | string | yes | Send it as preview_id with the exact same request to make the change. |
| `expires_at` | string (date-time) | yes | The preview_id cannot be used after this time. |
| `preview` | object | yes | What the change would do. |
| `preview.before` | object, or null | yes | What there is now (null if it does not exist yet). |
| `preview.before.enabled` | boolean | yes | The rule is applied. When false it is saved but not applied, and Calypso answers every fan of the account. |
| `preview.before.ruleset` | object | yes | The conditions of the rule. A fan who matches them is handled by the team (people); every other fan is answered by Calypso. |
| `preview.before.ruleset.schema_version` | always 2 or always 3 | yes | Format of the rule. 3: in_list values are VENUZ list ids. 2 (older): in_list values are OnlyFans list ids, which never match a fan, so a list cannot be added to a schema_version 2 rule; every other condition means the same in both. |
| `preview.before.ruleset.logic` | one of "and", "or" | yes | and: the fan matches every group. or: the fan matches at least one group. |
| `preview.before.ruleset.groups` | array of object | yes |  |
| `preview.before.ruleset.groups[].logic` | one of "and", "or" | yes | and: the fan meets every condition of the group. or: at least one. |
| `preview.before.ruleset.groups[].conditions` | array of object | yes |  |
| `preview.after` | object, or null | yes | What there would be after the change (null if it would stop existing). |
| `preview.after.enabled` | boolean | yes | The rule is applied. When false it is saved but not applied, and Calypso answers every fan of the account. |
| `preview.after.ruleset` | object | yes | The conditions of the rule. A fan who matches them is handled by the team (people); every other fan is answered by Calypso. |
| `preview.after.ruleset.schema_version` | always 2 or always 3 | yes | Format of the rule. 3: in_list values are VENUZ list ids. 2 (older): in_list values are OnlyFans list ids, which never match a fan, so a list cannot be added to a schema_version 2 rule; every other condition means the same in both. |
| `preview.after.ruleset.logic` | one of "and", "or" | yes | and: the fan matches every group. or: the fan matches at least one group. |
| `preview.after.ruleset.groups` | array of object | yes |  |
| `preview.after.ruleset.groups[].logic` | one of "and", "or" | yes | and: the fan meets every condition of the group. or: at least one. |
| `preview.after.ruleset.groups[].conditions` | array of object | yes |  |
| `preview.undo` | object | yes | Whether POST /v2/changes/{changeId}/undo can reverse this change. |
| `preview.undo.status` | always "available" | yes |  |
| `preview.undo.reason` | string | yes | Why this change cannot be undone (for example, it is final or it deleted data). |

## Errors and what to do

Every error is `{ "error", "message", "fix", "docs_url", "request_id" }`. Branch on `error`; do what `fix` says.

| Error | HTTP | What to do |
| --- | --- | --- |
| [`invalid_request`](/errors/#invalid_request) | 400 | A condition cannot be saved: details.invalid_fields names it (group and index) and says what its field and operator need. Or an in_list condition names a list id that does not exist on this account or is a system list (use one of its own, non-system list ids), or adds a list to a schema_version 2 rule (ask VENUZ support to convert the rule to schema_version 3). |
| [`idempotency_key_required`](/errors/#idempotency_key_required) | 400 | Send a unique "Idempotency-Key" header (for example a UUID you generate) with the request. Reuse the SAME key only to retry the SAME request. |
| [`preview_required`](/errors/#preview_required) | 400 | Call the same operation with dry_run=true: a preview needs no Idempotency-Key and changes nothing. Check it, then repeat the exact same request with preview_id set to the preview_id it returned and an Idempotency-Key. |
| [`invalid_request`](/errors/#invalid_request) | 400 | Correct the request, then retry. When details.invalid_fields is present, each entry names a field and what it needs (its message); when details.reason is present, it says what is wrong. The parameters and body of every operation are in the specification. |
| [`invalid_api_key`](/errors/#invalid_api_key) | 401 | Send a valid key as "Authorization: Bearer vzk_live_..." (or vzk_test_...). If you lost the key, ask the agency to create a new one. |
| [`api_key_expired`](/errors/#api_key_expired) | 401 | Ask the agency to rotate the key or create a new one. Keys last at most 366 days. |
| [`api_key_revoked`](/errors/#api_key_revoked) | 401 | Stop using this key. Ask the agency for a new one if you still need access. |
| [`account_not_allowed`](/errors/#account_not_allowed) | 403 | The account in the path is not one this key can use. Call GET /v2/whoami and use one of its accounts. |
| [`api_key_suspended`](/errors/#api_key_suspended) | 403 | If details.reason is creator_withdrawn, ask the agency owner to create a new key from an active member of the team. If it is suspended_by_venuz, contact VENUZ support: the same key works again as soon as the suspension is lifted, so do not delete it. |
| [`agency_inactive`](/errors/#agency_inactive) | 403 | The agency's VENUZ account is suspended or closed; access resumes when it is active again. Do not delete the key. |
| [`api_not_enabled`](/errors/#api_not_enabled) | 403 | Ask VENUZ support to enable API access for the agency. Keep the key: it works as soon as access is enabled. |
| [`ip_not_allowed`](/errors/#ip_not_allowed) | 403 | Send the request from one of the addresses allowed on the key, or ask the agency to update the allowed addresses. |
| [`insufficient_scope`](/errors/#insufficient_scope) | 403 | Call GET /v2/whoami to see what this key can do. Ask the agency to grant the missing permission (listed in details.missing_scopes) or to use a key that has it. If details.withheld_by_creator is true, the key has the permission but the person who created it cannot do this in VENUZ today: they need the role permissions in details.creator_missing_permissions (when details.creator_needs is any_of, any one of them is enough), or the agency must use a key created by someone who has them. |
| [`browser_write_blocked`](/errors/#browser_write_blocked) | 403 | Nothing was changed. Run this write from a server (your agent backend), not from a web page. To preview it from a browser, add dry_run=true to the same request. |
| [`writes_not_enabled`](/errors/#writes_not_enabled) | 403 | This request changed nothing. Reads, webhooks and previews (dry_run=true) keep working. Ask VENUZ support to enable API writes for the agency. Keep the key: writes work as soon as they are enabled. |
| [`resource_not_found`](/errors/#resource_not_found) | 404 | The account does not exist in VENUZ anymore. Call GET /v2/whoami to list the accounts this key can use. |
| [`state_conflict`](/errors/#state_conflict) | 409 | This account already has a rule saved in the newer format (schema_version 3): it cannot be written back as schema_version 2. Read it first with GET /v2/calypso/routing?account_id=... and send it back with the same schema_version. |
| [`idempotency_key_reused`](/errors/#idempotency_key_reused) | 409 | Use a new Idempotency-Key for a new request. Reuse a key only to retry exactly the same request (same operation, path, query and body). |
| [`idempotency_in_progress`](/errors/#idempotency_in_progress) | 409 | Wait for the number of seconds in the Retry-After header, then retry with the SAME Idempotency-Key to get its result. Do not use a new key: that could do the action twice. |
| [`idempotency_outcome_unknown`](/errors/#idempotency_outcome_unknown) | 409 | Do NOT retry with a new Idempotency-Key. Check the current state first (for a message, use its status operation with details.execution_id); only if it did not happen, send it again with a new key. |
| [`preview_invalid`](/errors/#preview_invalid) | 409 | Call the operation again with dry_run=true and exactly the parameters you want to send, then use the new preview_id within 15 minutes. A preview can be used once. |
| [`rate_limited`](/errors/#rate_limited) | 429 | Wait for the number of seconds in the Retry-After header, then retry. Spread requests out instead of retrying in a loop. Each request costs the units of its cost class (header X-Request-Cost: 1 for stored data, 2 for a realtime call to the OnlyFans account or a heavy query), and the RateLimit-* headers show how many units are left for this key and its agency in the current minute. |
| [`internal_error`](/errors/#internal_error) | 500 | Retry once after a few seconds; do not retry in a loop. If the request was a write, retry with the SAME Idempotency-Key, never a new one. If it keeps failing, contact VENUZ support and include the request_id. |
| [`api_halted`](/errors/#api_halted) | 503 | Wait for the number of seconds in the Retry-After header, then retry. Your key is still valid. |
| [`write_store_unavailable`](/errors/#write_store_unavailable) | 503 | Nothing was changed. Retry once after a few seconds with the SAME Idempotency-Key; do not retry in a loop. If it keeps failing, contact VENUZ support and include the request_id. |
| [`limits_unavailable`](/errors/#limits_unavailable) | 503 | Nothing was changed. Wait for the number of seconds in the Retry-After header, then retry once with the SAME Idempotency-Key; do not retry in a loop. Reads keep working in the meantime. |

VENUZ is independent software for agencies. It is not affiliated with, endorsed or sponsored by OnlyFans. OnlyFans is a trademark of its owner.
