Spinrun Docs
REST APIWorkflows

Replace a workflow document

Whole-document replace. `If-Match` and the body's `updated_at` must both equal the workflow's current `updated_at`; the slug cannot change.

PUT/api/build/workflows/{ref}

Authorization

bearerAuth
AuthorizationBearer <token>

OAuth access token whose grant carries Build authorization.

In: header

Path Parameters

ref*string

Agent or workflow id or slug.

Header Parameters

If-Match*string

The document's current updated_at as an entity tag, e.g. "2026-09-01T10:00:00.000Z", or *.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A whole workflow as one JSON document.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/build/workflows/string" \  -H "If-Match: string" \  -H "Content-Type: application/json" \  -d '{    "kind": "spinrun.workflow/v1",    "slug": "string",    "name": "string",    "description": "string",    "enabled": true,    "space": {      "team": "string"    },    "send_as": "string",    "inputs": {      "property1": {},      "property2": {}    },    "schedule": {      "cron": "stringstr",      "timezone": "string"    },    "steps": [      {        "id": "string",        "kind": "tool",        "tool": "string"      }    ],    "output": "string"  }'
{  "data": {    "document": null,    "applied": [      "string"    ],    "changes": [      "string"    ],    "version": 0,    "webhook_urls": [      {        "trigger_id": "string",        "url": "string"      }    ]  }}