Storyden
Trails

Update a Trail, including pause, resume, or archive

Replace the mutable Trail definition. The server validates the trigger and action bindings before it saves the update. The creator is immutable. A status change can pause, resume, or archive the Trail. Archive keeps existing run history and does not cancel action runs that already started.

PATCH
/trails/{trail_id}

Replace the mutable Trail definition. The server validates the trigger and action bindings before it saves the update. The creator is immutable. A status change can pause, resume, or archive the Trail. Archive keeps existing run history and does not cancel action runs that already started.

Authorization

cookiestoryden-session<token>

Path Parameters

trail_id*string

A unique identifier for this resource.

Formatxid

Request Body

application/json
  1. body
name*string
Length1 <= length <= 120
description?string
status*TrailMutableStatus
Value in"active""paused""archived"
trigger*|
actions*array<>
Items1 <= items

Response Body

Trail updated.

application/json
  1. response
id*Identifier

A unique identifier for this resource.

Formatxid
createdAt*string

The time the resource was created.

Formatdate-time
updatedAt*string

The time the resource was updated.

Formatdate-time
deletedAt?string

The time the resource was soft-deleted.

Formatdate-time
misc?

Arbitrary extra data stored with the resource.

name*string
description*string
created_by*

A minimal reference to an account.

status*TrailStatus
Value in"active""paused""finished""archived"
trigger*|
actions*array<>
next_occurrence_at?string
Formatdate-time
last_occurrence_at?string
Formatdate-time
Example Request
curl -X PATCH 'https://example.com/api/trails/string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "status": "active",  "trigger": {    "type": "schedule",    "schedule": {      "start": "string",      "timezone": "string",      "rule": {        "frequency": "hourly",        "interval": 1      }    }  },  "actions": [    {      "type": "robot_run",      "robot_ref": "string",      "instruction": "string"    }  ]}'
Example Response
{  "id": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "deletedAt": "2019-08-24T14:15:22Z",  "misc": {},  "name": "string",  "description": "string",  "created_by": {    "id": "string",    "joined": "2019-08-24T14:15:22Z",    "suspended": "2019-08-24T14:15:22Z",    "handle": "string",    "name": "string",    "signature": "string",    "roles": [      {        "badge": true,        "default": true,        "id": "string",        "name": "string",        "colour": "string",        "meta": {}      }    ]  },  "status": "active",  "trigger": {    "type": "schedule",    "schedule": {      "start": "string",      "timezone": "string",      "rule": {        "frequency": "hourly",        "interval": 1,        "by_weekday": [          "monday"        ],        "by_month": [          1        ],        "by_month_day": [          -31        ],        "count": 1      }    }  },  "actions": [    {      "id": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "deletedAt": "2019-08-24T14:15:22Z",      "misc": {},      "action": {        "type": "robot_run",        "robot_ref": "string",        "instruction": "string"      }    }  ],  "next_occurrence_at": "2019-08-24T14:15:22Z",  "last_occurrence_at": "2019-08-24T14:15:22Z"}