auto_write
cs

Create or change one action the CS agent may take through a connector. A new action always starts in test mode; set test

Changed on

Create or change one action the CS agent may take through a connector. A new action always starts in test mode; set test_mode false to let the agent use it with real customers. approval: off (never offered), approve (a person approves every run), auto (the agent runs it). A money action can never be auto. request is a template: method, path, query, headers, body with placeholders {{input.<field>}}, {{customer.email}}, {{customer.name}}, {{customer.external_id}} (the customer's id in your own system), {{order.name}}, {{thread.id}}, {{store.id}}. response: result_path, expose_fields (what the agent may see), success_when. Every change bumps version; a decision made on an older version is refused. A change that widens what the agent may do on its own (out of test mode, approval up, effect class down, customer check off, or any change to a live action) is refused needs_person; the refusal says how to ask a person to approve it in the dashboard. Other changes apply at once. sensitivity (identity, address, payout, money): with step-up on for the store, the action runs only after the customer confirmed a one-time code sent to their address on record; a money action counts as sensitive regardless.

post/api/v1/tools/cs_action_upsert

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopescs:write

Headers

Idempotency-Key, string

Required, here or as idempotency_key in the body. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.

Request body

object required
key, string required

The action key (lower_snake_case, or connector.action for a built-in).

connector_key, string required

The connector key (lower_snake_case).

display_name, string required
description, string required

What the action does, as the agent should understand it.

when_to_use, string
input_schema, object

JSON Schema (type object) of what the agent must fill in.

effect, 'read' | 'write' | 'money'
approval, 'off' | 'approve' | 'auto'
test_mode, boolean
enabled, boolean
customer_must_be_verified, boolean
sensitivity, 'identity' | 'address' | 'payout' | 'money' | 'null' nullable
request, object
response, object
idempotency_key, string required

Required. A unique string you choose for this request. Send the SAME key when retrying after a timeout and Magistry returns the original outcome instead of performing the write twice. Reusing a key with different arguments is refused rather than replayed.

Response

Tool result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision