Actions

Create scenario

Create a new Callr Actions scenario.

post/actions

Request

  • Base URL
    https://api.callr.com/v2.0
  • URL
    https://api.callr.com/v2.0/actions
  • Auth
    • API key in header x-api-key
    • or HTTP basic

Request body

namestring required

Name of the scenario (1 to 64 characters, with at least one letter)

scriptstring required

The scenario, in YAML. It must follow the Callr Actions schema (https://api.callr.com/assets/callr-actions-schema.yaml). See https://docs.callr.com/docs/callr-actions.

formatstring

Format of the script. Only yaml is supported (default).

Example request

{
  "name": "Call Forwarding",
  "script": "compat:\n  version: '2025-09-01'\nbranches:\n  inbound-call:\n    actions:\n      - action: gather@v4\n        params:\n          maxDigits: 1\n          tts:\n            text: Welcome to Callr. Press 1 for sales, or 2 for support.\n        result: $choice\n      - if: \"$choice.input == '1'\"\n        goto:\n          branch: sales\n      - action: dial@v2\n        params:\n          targets:\n            - number: '+33199004242'\n              timeout: 30\n        result: $dial\n  sales:\n    actions:\n      - action: dial@v2\n        params:\n          targets:\n            - number: '+33199004243'\n              timeout: 30\n        result: $dial\n",
  "format": "yaml"
}

Response

Actions scenario created

namestring required

Name of the scenario (1 to 64 characters, with at least one letter)

scriptstring required

The scenario, in YAML. It must follow the Callr Actions schema (https://api.callr.com/assets/callr-actions-schema.yaml). See https://docs.callr.com/docs/callr-actions.

formatstring required

Format of the script. Only yaml is supported (default).

sidstring required

Short ID

versionstring required
createdstring date-time required

RFC 3339, section 5.6

updatedstring date-time required

RFC 3339, section 5.6

Example response

{
  "name": "Call Forwarding",
  "script": "compat:\n  version: '2025-09-01'\nbranches:\n  inbound-call:\n    actions:\n      - action: gather@v4\n        params:\n          maxDigits: 1\n          tts:\n            text: Welcome to Callr. Press 1 for sales, or 2 for support.\n        result: $choice\n      - if: \"$choice.input == '1'\"\n        goto:\n          branch: sales\n      - action: dial@v2\n        params:\n          targets:\n            - number: '+33199004242'\n              timeout: 30\n        result: $dial\n  sales:\n    actions:\n      - action: dial@v2\n        params:\n          targets:\n            - number: '+33199004243'\n              timeout: 30\n        result: $dial\n",
  "format": "yaml",
  "sid": "callrsid",
  "numbers": [
    {
      "e164": "+33199001234",
      "class": "classic",
      "type": "geographic",
      "assigned": "2024-04-24T17:42:28Z",
      "country": "FR"
    }
  ],
  "version": "1.0",
  "created": "2024-04-24T17:42:28Z",
  "updated": "2024-04-24T17:42:28Z"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.