Update a routine

Changes the supplied fields of a routine the caller owns and leaves the rest unchanged. The example moves a routine to a weekday schedule. Requires: update permission on routines.

POST
/v1/routines/update

Authorization

apiKeyAuth
x-api-key<token>

API key authentication. Create an API key in your user profile and include it in the x-api-key header.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://customermates.com/api/v1/routines/update" \  -H "Content-Type: application/json" \  -d '{    "id": "0b5f3c1e-7a2d-4c8e-9f10-2a3b4c5d6e7f",    "triggerKind": "schedule",    "cronExpression": "0 8 * * 1-5",    "timezone": "Europe/Berlin"  }'
{
  "id": "0b5f3c1e-7a2d-4c8e-9f10-2a3b4c5d6e7f",
  "ownerUserId": "3c2b1a09-8f7e-4d6c-9b5a-4f3e2d1c0b9a",
  "owner": {
    "id": "3c2b1a09-8f7e-4d6c-9b5a-4f3e2d1c0b9a",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "avatarUrl": null,
    "status": "active"
  },
  "name": "Brief new enterprise deals",
  "prompt": "Summarize the new deal and suggest the next step for its owner.",
  "enabled": true,
  "triggerKind": "schedule",
  "cronExpression": "0 8 * * 1-5",
  "timezone": "Europe/Berlin",
  "triggerEvents": [],
  "triggerFilters": [],
  "recordTrigger": null,
  "recordSources": null,
  "debounceSeconds": 0,
  "nextRunAt": "2026-10-13T06:00:00.000Z",
  "lastRunAt": null,
  "lastRunStatus": null,
  "disabledReason": null,
  "createdAt": "2026-10-12T08:00:00.000Z",
  "updatedAt": "2026-10-12T08:00:00.000Z"
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
Empty