{
  "openapi": "3.1.0",
  "info": {
    "title": "Process Cart API",
    "version": "v1",
    "summary": "Workflows, runs, tasks, field values, comments, files, views, webhooks, schedules, automation rules and the directory of a Process Cart workspace.",
    "description": "The Process Cart REST API. Base URL `https://app.processcart.com/api/v1`; the full guides live at https://developers.processcart.com.\n\n**Authentication.** `Authorization: Bearer pc_live_…` (or `X-API-Key`). Keys are created self-serve in Settings → API by an Admin, carry action scopes (`runs:read`, `runs:write`, `approvals:decide`, `workflows:read`, `workflows:write`, `views:read`, `views:write`, `webhooks:manage`, `schedules:manage`, `rules:manage`, `users:read`, `*`), may be read-only, and may be restricted to workflows or folders. Rotation keeps the previous secret working for 24 hours. Keys minted on a sandbox workspace carry `pc_test_`.\n\n**Rate limit.** 600 requests per 60 seconds per key; `RateLimit-*` on every authenticated response, 429 with `Retry-After` when exceeded.\n\n**Errors.** RFC 9457 `application/problem+json` with a stable `code`, a `requestId` and field-level `errors[]`. Every response carries `X-Request-Id`.\n\n**Idempotency.** Send `Idempotency-Key` on any POST / PATCH / DELETE to make retries safe (stored 24 h).\n\n**Concurrency.** Every Run body carries its `revision`. Every run write accepts `Expected-Revision: <revision>` and refuses a stale value with 409 `revision_mismatch`, whose body names `currentRevision`; a successful write answers its new `revision` in the body. The API sends no `ETag` and refuses `If-Match` with a 422: CDN layers evaluate `If-Match` against the response and turn a successful write into a 412.\n\n**Lists.** `{ data, nextCursor, hasMore }` with opaque cursors; `updatedSince` for incremental sync.\n\n**Webhooks.** Standard Webhooks signatures (`webhook-id` / `webhook-timestamp` / `webhook-signature`, HMAC-SHA256, `whsec_` secrets, 24 h rotation overlap); retries 1 / 5 / 15 / 30 / 60 minutes after a failure, then exhausted; auto-disable after 5 consecutive exhausted deliveries or a 410. The `webhooks` section below documents every event's payload.\n\n**Versioning.** `/v1` in the path. Additive changes (new fields, endpoints, event types, enum values) ship without a bump — tolerate unknown members and enum values; breaking changes go to `/v2` with at least 12 months of overlap and `Deprecation` / `Sunset` headers on the old operations.",
    "contact": {
      "name": "Process Cart developers",
      "url": "https://developers.processcart.com"
    },
    "x-processcart-rate-limit": {
      "limit": 600,
      "windowSeconds": 60
    },
    "x-processcart-webhook-retry-minutes": [
      1,
      5,
      15,
      30,
      60
    ]
  },
  "servers": [
    {
      "url": "https://app.processcart.com/api",
      "description": "Production (paths start with /v1)"
    }
  ],
  "tags": [
    {
      "name": "Me",
      "description": "The key and workspace behind a credential."
    },
    {
      "name": "Workflows",
      "description": "Published workflow templates: list, read, create from a portable template JSON, per-workflow field schema."
    },
    {
      "name": "Runs",
      "description": "Runs of a workflow — the central resource: full field values (canonical + formatted) and task state in one document."
    },
    {
      "name": "Tasks",
      "description": "Complete, reopen, approve and reject a run's tasks under the engine's gates."
    },
    {
      "name": "Fields",
      "description": "Set a run's field values; a JSON number is the canonical, a string is parsed by the field's format."
    },
    {
      "name": "Comments",
      "description": "Task comments on a run."
    },
    {
      "name": "Files",
      "description": "Two-phase file upload to a run's File fields, and downloads."
    },
    {
      "name": "Activity",
      "description": "A run's append-only activity trail."
    },
    {
      "name": "Views",
      "description": "Saved board views (filters + sort) and the runs they select."
    },
    {
      "name": "Webhooks",
      "description": "Webhook endpoints, their signing secrets and delivery log."
    },
    {
      "name": "Schedules",
      "description": "Recurrence schedules that start runs of a workflow: create, pause, resume, run now and preview the next occurrences."
    },
    {
      "name": "Automation rules",
      "description": "When-then rules on a workflow's runs (set fields, status, labels, assignees; notify; send to a webhook) and their execution history."
    },
    {
      "name": "Directory",
      "description": "Members and groups (ids, names, roles — no email addresses)."
    },
    {
      "name": "Exports",
      "description": "CSV export of a workflow's runs."
    },
    {
      "name": "Health",
      "description": "The unauthenticated status probe."
    }
  ],
  "paths": {
    "/v1/automation-rules": {
      "get": {
        "operationId": "listAutomationRules",
        "summary": "List automation rules",
        "description": "Lists the workspace's automation rules, newest first, each with its trigger, filter, conditions, actions and enabled state. Filter by `workflowId` or `enabled`. `updatedSince` turns the list into an incremental sync ordered by `updatedAt` ascending (inclusive). A key restricted to workflows or folders lists only the rules of workflows inside its allowlist; rules for every workflow (`workflowId: null`) are omitted for it.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleList"
                },
                "example": {
                  "data": [
                    {
                      "id": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                      "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                      "workflow": {
                        "id": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                        "name": "Order fulfillment"
                      },
                      "name": "Flag large orders",
                      "triggerEvent": "task.completed",
                      "filter": {
                        "taskKey": "details"
                      },
                      "conditions": {
                        "combinator": "and",
                        "items": [
                          {
                            "type": "field",
                            "fieldKey": "amount",
                            "op": "greater",
                            "value": 1000
                          }
                        ]
                      },
                      "actions": [
                        {
                          "type": "add_labels",
                          "labelIds": [
                            "rush"
                          ]
                        },
                        {
                          "type": "set_priority",
                          "priority": "high"
                        }
                      ],
                      "enabled": true,
                      "disabledReason": null,
                      "disabledAt": null,
                      "consecutiveFailures": 0,
                      "keyMismatches": [],
                      "createdBy": null,
                      "createdAt": "2026-10-11T05:27:50.402Z",
                      "updatedAt": "2026-10-11T05:27:50.402Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "createAutomationRule",
        "summary": "Create an automation rule",
        "description": "Creates a rule, turned on: when `triggerEvent` happens on a run of `workflowId` (optionally narrowed by `filter` and field `conditions`), the `actions` run in order — set a field, set the status or priority, add or remove labels, assign a task, notify people, or send the event to a webhook. Task and field keys are checked against the workflow's published version; members, groups, labels and webhooks against the workspace. A `set_field` value is checked like a field write, and one outside the field's bounds is refused (422, `errors[].code` `invalid_value`). A workflow in Trash answers 409 `workflow_trashed`. `workflowId: null` makes a rule for every workflow (header actions, `notify` and `call_webhook` only), which needs a key without an allowlist. A workspace holds at most 100 rules that are on. Audited. A key restricted to workflows or folders may use only the rules of workflows inside its allowlist; a rule for every workflow (`workflowId: null`), or one of a workflow outside the allowlist, answers 403 `not_allowed_for_key`.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleConfig"
              },
              "example": {
                "name": "Flag large orders",
                "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                "triggerEvent": "task.completed",
                "filter": {
                  "taskKey": "details"
                },
                "conditions": {
                  "combinator": "and",
                  "items": [
                    {
                      "type": "field",
                      "fieldKey": "amount",
                      "op": "greater",
                      "value": 1000
                    }
                  ]
                },
                "actions": [
                  {
                    "type": "add_labels",
                    "labelIds": [
                      "rush"
                    ]
                  },
                  {
                    "type": "set_priority",
                    "priority": "high"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                },
                "example": {
                  "id": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                  "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                  "workflow": {
                    "id": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                    "name": "Order fulfillment"
                  },
                  "name": "Flag large orders",
                  "triggerEvent": "task.completed",
                  "filter": {
                    "taskKey": "details"
                  },
                  "conditions": {
                    "combinator": "and",
                    "items": [
                      {
                        "type": "field",
                        "fieldKey": "amount",
                        "op": "greater",
                        "value": 1000
                      }
                    ]
                  },
                  "actions": [
                    {
                      "type": "add_labels",
                      "labelIds": [
                        "rush"
                      ]
                    },
                    {
                      "type": "set_priority",
                      "priority": "high"
                    }
                  ],
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "keyMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.402Z",
                  "updatedAt": "2026-10-11T05:27:50.402Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_not_published` — Workflow not published; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_not_published",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/automation-rules/{id}": {
      "delete": {
        "operationId": "deleteAutomationRule",
        "summary": "Delete an automation rule",
        "description": "Deletes the rule and its execution history. Audited.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      },
      "get": {
        "operationId": "getAutomationRule",
        "summary": "Get an automation rule",
        "description": "Returns one rule with its trigger, filter, conditions, actions, enabled state and disable reason, failure counter (the rule turns itself off after 10 failed executions in a row), and any keys the published workflow or the workspace no longer has. A key restricted to workflows or folders may use only the rules of workflows inside its allowlist; a rule for every workflow (`workflowId: null`), or one of a workflow outside the allowlist, answers 403 `not_allowed_for_key`.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                },
                "example": {
                  "id": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                  "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                  "workflow": {
                    "id": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                    "name": "Order fulfillment"
                  },
                  "name": "Flag large orders",
                  "triggerEvent": "task.completed",
                  "filter": {
                    "taskKey": "details"
                  },
                  "conditions": {
                    "combinator": "and",
                    "items": [
                      {
                        "type": "field",
                        "fieldKey": "amount",
                        "op": "greater",
                        "value": 1000
                      }
                    ]
                  },
                  "actions": [
                    {
                      "type": "add_labels",
                      "labelIds": [
                        "rush"
                      ]
                    },
                    {
                      "type": "set_priority",
                      "priority": "high"
                    }
                  ],
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "keyMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.402Z",
                  "updatedAt": "2026-10-11T05:27:50.402Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow"
      },
      "patch": {
        "operationId": "updateAutomationRule",
        "summary": "Update an automation rule",
        "description": "Changes any subset of `name`, `workflowId`, `triggerEvent`, `filter`, `conditions` and `actions`; the result is checked as a whole, like a create (a workflow in Trash answers 409 `workflow_trashed`), and the failure counter resets. `enabled` is not part of the configuration — use the enable and disable operations (422 `unknown_key` on `enabled`). Audited.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRulePatch"
              },
              "example": {
                "name": "Flag large orders (over 1,000)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                },
                "example": {
                  "id": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                  "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                  "workflow": {
                    "id": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                    "name": "Order fulfillment"
                  },
                  "name": "Flag large orders (over 1,000)",
                  "triggerEvent": "task.completed",
                  "filter": {
                    "taskKey": "details"
                  },
                  "conditions": {
                    "combinator": "and",
                    "items": [
                      {
                        "type": "field",
                        "fieldKey": "amount",
                        "op": "greater",
                        "value": 1000
                      }
                    ]
                  },
                  "actions": [
                    {
                      "type": "add_labels",
                      "labelIds": [
                        "rush"
                      ]
                    },
                    {
                      "type": "set_priority",
                      "priority": "high"
                    }
                  ],
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "keyMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.402Z",
                  "updatedAt": "2026-10-11T05:27:57.211Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_not_published` — Workflow not published; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_not_published",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/automation-rules/{id}/disable": {
      "post": {
        "operationId": "disableAutomationRule",
        "summary": "Turn an automation rule off",
        "description": "Turns the rule off (reason `manual`); events that happen while it is off are not queued for it. Turning off a rule that is off answers 200 unchanged. Audited.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                },
                "example": {
                  "id": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                  "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                  "workflow": {
                    "id": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                    "name": "Order fulfillment"
                  },
                  "name": "Flag large orders (over 1,000)",
                  "triggerEvent": "task.completed",
                  "filter": {
                    "taskKey": "details"
                  },
                  "conditions": {
                    "combinator": "and",
                    "items": [
                      {
                        "type": "field",
                        "fieldKey": "amount",
                        "op": "greater",
                        "value": 1000
                      }
                    ]
                  },
                  "actions": [
                    {
                      "type": "add_labels",
                      "labelIds": [
                        "rush"
                      ]
                    },
                    {
                      "type": "set_priority",
                      "priority": "high"
                    }
                  ],
                  "enabled": false,
                  "disabledReason": "manual",
                  "disabledAt": "2026-10-11T05:27:57.496Z",
                  "consecutiveFailures": 0,
                  "keyMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.402Z",
                  "updatedAt": "2026-10-11T05:27:57.894Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/automation-rules/{id}/enable": {
      "post": {
        "operationId": "enableAutomationRule",
        "summary": "Turn an automation rule on",
        "description": "Turns the rule on and resets its failure counter — also the way back after it turned itself off (after 10 failed executions in a row, or the loop guard). A workspace holds at most 100 rules that are on (422, `errors[].code` `limit_reached`). A rule whose workflow is in Trash is refused with 409 `workflow_trashed`. Turning on a rule that is on answers 200 unchanged. Audited.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                },
                "example": {
                  "id": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                  "workflowId": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                  "workflow": {
                    "id": "ba1de1e7-01ae-498d-8686-e7b67809372c",
                    "name": "Order fulfillment"
                  },
                  "name": "Flag large orders (over 1,000)",
                  "triggerEvent": "task.completed",
                  "filter": {
                    "taskKey": "details"
                  },
                  "conditions": {
                    "combinator": "and",
                    "items": [
                      {
                        "type": "field",
                        "fieldKey": "amount",
                        "op": "greater",
                        "value": 1000
                      }
                    ]
                  },
                  "actions": [
                    {
                      "type": "add_labels",
                      "labelIds": [
                        "rush"
                      ]
                    },
                    {
                      "type": "set_priority",
                      "priority": "high"
                    }
                  ],
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "keyMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.402Z",
                  "updatedAt": "2026-10-11T05:27:58.667Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/automation-rules/{id}/executions": {
      "get": {
        "operationId": "listAutomationRuleExecutions",
        "summary": "List a rule's executions",
        "description": "The rule's execution history, newest first: one execution per matched event, with its status (`queued`, `running`, `done`, `failed`), each action's outcome (`ok`, `skipped`, `failed`) and the error. Filter by `status`. Executions older than 30 days are gone.",
        "tags": [
          "Automation rules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "done",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleExecutionList"
                },
                "example": {
                  "data": [
                    {
                      "id": "716f9d9d-761b-4292-a371-12c836633430",
                      "ruleId": "f95bfa64-fea6-421b-9b04-a8d262cf2098",
                      "runId": "498bf18e-e9c2-421c-aba7-101c8d88b7d0",
                      "run": {
                        "id": "498bf18e-e9c2-421c-aba7-101c8d88b7d0",
                        "name": "Order 1042"
                      },
                      "eventId": "evt_5e687bca-29e2-4089-bd89-deca38ed741b",
                      "eventType": "task.completed",
                      "status": "done",
                      "result": [
                        {
                          "ok": true,
                          "action": "add_labels",
                          "detail": "Added labels.",
                          "outcome": "ok"
                        },
                        {
                          "ok": true,
                          "action": "set_priority",
                          "detail": "Set priority to “High”.",
                          "outcome": "ok"
                        }
                      ],
                      "error": null,
                      "createdAt": "2026-10-11T05:27:52.935Z",
                      "startedAt": "2026-10-11T05:27:53.283Z",
                      "finishedAt": "2026-10-11T05:27:55.033Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "rules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-paginated": true
      }
    },
    "/v1/exports/runs.csv": {
      "get": {
        "operationId": "exportRunsCsv",
        "summary": "Export a workflow's runs as CSV",
        "description": "One workflow's runs as a CSV file, newest first, with the same filters as `GET /v1/runs` and the Reports grid's column choice: `cols` picks the run columns, `fields` the field columns (values formatted as the app shows them — currency with its symbol, dates in the workspace's time zone, members by name). UTF-8 with a BOM and CRLF line ends, so it opens cleanly in Excel. The whole file is built before it is sent; a selection above 10,000 rows is refused with a 422 — narrow the filter.",
        "tags": [
          "Exports"
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "active",
                  "completed",
                  "on_hold",
                  "archived"
                ]
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "none",
                  "low",
                  "medium",
                  "high",
                  "urgent"
                ]
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "assignee",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(u|g):([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "due",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "overdue",
                "today",
                "week",
                "none"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "qMode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "prefix",
                "contains"
              ],
              "default": "prefix"
            }
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "includeTrashed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "status",
                  "priority",
                  "labels",
                  "progress",
                  "key_date",
                  "due",
                  "started",
                  "completed"
                ]
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$",
                "maxLength": 80
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Content-Disposition": {
                "$ref": "#/components/headers/Content-Disposition"
              }
            },
            "content": {
              "text/csv; charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/ExportRunsCsvResponse"
                },
                "example": "﻿Run name,Status,Started,Completed,Customer,Order code,Memo,Quantity,Amount,Fee\r\nCSV run two,Active,\"Oct 10, 2026\",,Ann,,,,\"$2,500.50\",\r\nCSV run one,Active,\"Oct 10, 2026\",,Ann,,,,\"$1,700.00\",\r\n"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`workflow_not_published` — Workflow not published.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "workflow_not_published"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow"
      }
    },
    "/v1/groups": {
      "get": {
        "operationId": "listGroups",
        "summary": "List groups",
        "description": "The workspace's groups by name, each with the ids of its current members. Groups appear as `{ kind: \"group\" }` assignees and in `assignee=g:<id>` filters.",
        "tags": [
          "Directory"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListGroupsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "bca06b45-d08f-4b9a-a769-1ad979a0dfd6",
                      "name": "Reviewers",
                      "memberIds": [
                        "7a632343-8bfa-4b60-849a-aaad7fcd7b4c"
                      ],
                      "createdAt": "2026-10-10T17:44:11.326Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "users:read",
        "x-processcart-paginated": true
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check that the API is up",
        "description": "The status-page probe: `{ \"status\": \"ok\" }` with 200 when the database answers, `{ \"status\": \"degraded\" }` with 503 otherwise. Unauthenticated, cached per instance for ten seconds, limited per client address, never logged.",
        "tags": [
          "Health"
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "status": "ok"
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "The database did not answer in time: `{ \"status\": \"degraded\" }` (JSON, not a problem).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "status": "degraded"
                }
              }
            }
          }
        },
        "security": [],
        "x-processcart-scope": null
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Identify the API key and its workspace",
        "description": "Returns the organization (workspace) and the API key behind the credential, with the key's scopes and the published rate limit. `org.labels` lists the workspace's status labels — the ids a run's `labels`, the runs filter and automation rules take. Any valid key may call it — the first request every integration should make.",
        "tags": [
          "Me"
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                },
                "example": {
                  "org": {
                    "id": "8602787e-fdb1-4a7e-982f-09ea5b3005cd",
                    "name": "Example workspace",
                    "slug": "example-workspace",
                    "timezone": "America/Los_Angeles",
                    "sandbox": false,
                    "labels": [
                      {
                        "id": "rush",
                        "name": "Rush",
                        "color": "#dc2626"
                      },
                      {
                        "id": "waiting",
                        "name": "Waiting",
                        "color": "#f59e0b"
                      }
                    ]
                  },
                  "key": {
                    "id": "07ea300f-832f-4f75-8859-0c318deec6b1",
                    "name": "Example key",
                    "prefix": "pc_live_ynpQ",
                    "readOnly": false,
                    "scopes": [
                      "*"
                    ],
                    "createdAt": "2026-10-13T00:39:13.702Z",
                    "lastUsedAt": null
                  },
                  "rateLimit": {
                    "limit": 600,
                    "windowSeconds": 60
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": null
      }
    },
    "/v1/runs": {
      "get": {
        "operationId": "listRuns",
        "summary": "List runs",
        "description": "Lists the runs the key may see as FULL Run resources (fields and tasks included), newest first. Filter by workflow, status, priority, labels, assignee (`u:<id>` / `g:<id>`), due window or run name; `updatedSince` turns the list into an incremental sync ordered by `updatedAt` ascending (inclusive — overlap by a minute and dedupe by `(id, revision)`). Trashed runs are hidden unless `includeTrashed=true`. `limit` is capped at 100.",
        "tags": [
          "Runs"
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "active",
                  "completed",
                  "on_hold",
                  "archived"
                ]
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "none",
                  "low",
                  "medium",
                  "high",
                  "urgent"
                ]
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            },
            "style": "form",
            "explode": false,
            "description": "Comma-separated (or repeat the parameter)."
          },
          {
            "name": "assignee",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(u|g):([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "due",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "overdue",
                "today",
                "week",
                "none"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "qMode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "prefix",
                "contains"
              ],
              "default": "prefix"
            }
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "includeTrashed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "startedAt",
                "updatedAt",
                "name",
                "dueAt",
                "keyDate",
                "completedAt",
                "priority"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunList"
                },
                "example": {
                  "data": [
                    {
                      "id": "8b84a82b-e9d8-4657-aa7c-50452cf48c8d",
                      "name": "Order 1001",
                      "status": "active",
                      "priority": "none",
                      "labels": [],
                      "labelDetails": [],
                      "dueAt": null,
                      "keyDate": null,
                      "revision": 1,
                      "updatedAt": "2026-10-13T01:10:36.904Z",
                      "startedAt": "2026-10-13T01:10:36.815Z",
                      "startedBy": "api",
                      "startedByUserId": null,
                      "schedule": null,
                      "scheduledFor": null,
                      "completedAt": null,
                      "deletedAt": null,
                      "workflow": {
                        "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                        "name": "Order fulfillment"
                      },
                      "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                      "url": "https://app.processcart.com/runs/8b84a82b-e9d8-4657-aa7c-50452cf48c8d",
                      "tasks": [
                        {
                          "key": "details",
                          "title": "Details",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "review",
                          "title": "Review",
                          "kind": "approval",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [
                            {
                              "kind": "user",
                              "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                            }
                          ],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "stop",
                          "title": "Sign-off",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "wrapup",
                          "title": "Wrap up",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": true,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        }
                      ],
                      "fields": [
                        {
                          "key": "customer",
                          "label": "Customer",
                          "type": "text",
                          "format": "none",
                          "taskKey": "details",
                          "value": "Grace Hopper",
                          "formatted": "Grace Hopper",
                          "visible": true
                        },
                        {
                          "key": "order_code",
                          "label": "Order code",
                          "type": "text",
                          "format": "custom",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "memo",
                          "label": "Memo",
                          "type": "textarea",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "quantity",
                          "label": "Quantity",
                          "type": "number",
                          "format": "number",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "amount",
                          "label": "Amount",
                          "type": "number",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "fee",
                          "label": "Fee",
                          "type": "number",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "rate",
                          "label": "Rate",
                          "type": "number",
                          "format": "percent",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "rate_text",
                          "label": "Rate (text)",
                          "type": "text",
                          "format": "percent",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "ship_date",
                          "label": "Ship date",
                          "type": "date",
                          "format": "date",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "start_time",
                          "label": "Start time",
                          "type": "time",
                          "format": "time",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "gift_wrap",
                          "label": "Gift wrap",
                          "type": "dropdown",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "choices": [
                            "Yes",
                            "No"
                          ]
                        },
                        {
                          "key": "tags",
                          "label": "Tags",
                          "type": "multi_choice",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "choices": [
                            "A",
                            "B",
                            "C"
                          ]
                        },
                        {
                          "key": "agree",
                          "label": "Agree",
                          "type": "checkbox",
                          "format": null,
                          "taskKey": "details",
                          "value": false,
                          "formatted": "No",
                          "visible": true
                        },
                        {
                          "key": "contact_email",
                          "label": "Contact email",
                          "type": "email",
                          "format": "email",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "website",
                          "label": "Website",
                          "type": "url",
                          "format": "url",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "phone",
                          "label": "Phone",
                          "type": "phone",
                          "format": "phone",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "owner",
                          "label": "Owner",
                          "type": "members",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "steps",
                          "label": "Steps",
                          "type": "subtasks",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "items": [
                            {
                              "key": "photos",
                              "label": "Photos"
                            },
                            {
                              "key": "invoice",
                              "label": "Invoice"
                            }
                          ]
                        },
                        {
                          "key": "contract",
                          "label": "Contract",
                          "type": "file",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "double_amount",
                          "label": "Double amount",
                          "type": "formula",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "source",
                          "label": "Source",
                          "type": "hidden",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": false
                        }
                      ]
                    },
                    {
                      "id": "845d4745-4cc1-46fe-9d6c-3cfead74544f",
                      "name": "Order 1002",
                      "status": "active",
                      "priority": "none",
                      "labels": [],
                      "labelDetails": [],
                      "dueAt": null,
                      "keyDate": null,
                      "revision": 7,
                      "updatedAt": "2026-10-13T01:10:35.496Z",
                      "startedAt": "2026-10-13T01:10:02.387Z",
                      "startedBy": "api",
                      "startedByUserId": null,
                      "schedule": null,
                      "scheduledFor": null,
                      "completedAt": null,
                      "deletedAt": null,
                      "workflow": {
                        "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                        "name": "Order fulfillment"
                      },
                      "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                      "url": "https://app.processcart.com/runs/845d4745-4cc1-46fe-9d6c-3cfead74544f",
                      "tasks": [
                        {
                          "key": "details",
                          "title": "Details",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "review",
                          "title": "Review",
                          "kind": "approval",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [
                            {
                              "kind": "user",
                              "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                            }
                          ],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "stop",
                          "title": "Sign-off",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "wrapup",
                          "title": "Wrap up",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": true,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        }
                      ],
                      "fields": [
                        {
                          "key": "customer",
                          "label": "Customer",
                          "type": "text",
                          "format": "none",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "order_code",
                          "label": "Order code",
                          "type": "text",
                          "format": "custom",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "memo",
                          "label": "Memo",
                          "type": "textarea",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "quantity",
                          "label": "Quantity",
                          "type": "number",
                          "format": "number",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "amount",
                          "label": "Amount",
                          "type": "number",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "fee",
                          "label": "Fee",
                          "type": "number",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "rate",
                          "label": "Rate",
                          "type": "number",
                          "format": "percent",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "rate_text",
                          "label": "Rate (text)",
                          "type": "text",
                          "format": "percent",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "ship_date",
                          "label": "Ship date",
                          "type": "date",
                          "format": "date",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "start_time",
                          "label": "Start time",
                          "type": "time",
                          "format": "time",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "gift_wrap",
                          "label": "Gift wrap",
                          "type": "dropdown",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "choices": [
                            "Yes",
                            "No"
                          ]
                        },
                        {
                          "key": "tags",
                          "label": "Tags",
                          "type": "multi_choice",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "choices": [
                            "A",
                            "B",
                            "C"
                          ]
                        },
                        {
                          "key": "agree",
                          "label": "Agree",
                          "type": "checkbox",
                          "format": null,
                          "taskKey": "details",
                          "value": false,
                          "formatted": "No",
                          "visible": true
                        },
                        {
                          "key": "contact_email",
                          "label": "Contact email",
                          "type": "email",
                          "format": "email",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "website",
                          "label": "Website",
                          "type": "url",
                          "format": "url",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "phone",
                          "label": "Phone",
                          "type": "phone",
                          "format": "phone",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "owner",
                          "label": "Owner",
                          "type": "members",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "steps",
                          "label": "Steps",
                          "type": "subtasks",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "items": [
                            {
                              "key": "photos",
                              "label": "Photos"
                            },
                            {
                              "key": "invoice",
                              "label": "Invoice"
                            }
                          ]
                        },
                        {
                          "key": "contract",
                          "label": "Contract",
                          "type": "file",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "double_amount",
                          "label": "Double amount",
                          "type": "formula",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "source",
                          "label": "Source",
                          "type": "hidden",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": false
                        }
                      ]
                    }
                  ],
                  "nextCursor": "eyJ2IjoiMjAyNi0xMC0xM1QwMToxMDowMi4zODcwMDBaIiwiaWQiOiI4NDVkNDc0NS00Y2MxLTQ2ZmUtOWQ2Yy0zY2ZlYWQ3NDU0NGYiLCJoIjoiYjU0MzliODk0MmUxZDhlNiJ9",
                  "hasMore": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "startRun",
        "summary": "Start a run",
        "description": "Starts a run of a workflow's published version with a name, optional field values (any writable field; kickoff fields marked required must be present), priority, labels and due date — in one transaction. A visible kickoff field (required or not) whose value breaks its bounds or rules is refused with 422 `validation_failed` (`errors[].code` `invalid_value`), the same gate as the app's Start dialog; other fields are accepted and flagged in `validationError`, as on `PATCH /runs/{id}/fields`. Returns the new Run (`revision: 1`) and an absolute `Location` header.",
        "tags": [
          "Runs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunStart"
              },
              "example": {
                "workflowId": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                "name": "ORD 2026-10-15 Acme Corp",
                "priority": "urgent",
                "labels": [
                  "rush"
                ],
                "dueAt": "2026-10-20",
                "fields": {
                  "customer": "Ada Lovelace",
                  "amount": "$1,700.00",
                  "rate": "5%",
                  "rate_text": 0.05,
                  "quantity": 1250,
                  "fee": 900,
                  "ship_date": "2026-10-15",
                  "start_time": "14:30",
                  "gift_wrap": "Yes",
                  "tags": [
                    "A",
                    "C"
                  ],
                  "agree": true,
                  "contact_email": "Ada@Example.com",
                  "website": "example.com",
                  "phone": "(415) 555-0100",
                  "owner": [
                    "e9e90546-8500-4502-a8a3-0f705c013cfd"
                  ],
                  "steps": [
                    "photos"
                  ],
                  "source": "zapier",
                  "order_code": "AB-1234",
                  "memo": "Two lines\nhere"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "urgent",
                  "labels": [
                    "rush"
                  ],
                  "labelDetails": [
                    {
                      "id": "rush",
                      "name": "Rush",
                      "color": "#dc2626"
                    }
                  ],
                  "dueAt": "2026-10-21T06:59:59.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 1,
                  "updatedAt": "2026-10-13T01:09:29.022Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Two lines\nhere",
                      "formatted": "Two lines\nhere",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1700,
                      "formatted": "$1,700.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 900,
                      "formatted": "$900.00",
                      "visible": true,
                      "validationError": "Must not exceed $500.00."
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.05,
                      "formatted": "5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.05,
                      "formatted": "5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "A",
                        "C"
                      ],
                      "formatted": "A, C",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": true,
                      "formatted": "Yes",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "e9e90546-8500-4502-a8a3-0f705c013cfd"
                      ],
                      "formatted": "Fixture Admin",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3400,
                      "formatted": "$3,400.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": "zapier",
                      "formatted": "zapier",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_not_published` — Workflow not published.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_not_published"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`field_not_writable` — Field is not writable; `idempotency_key_reused` — Idempotency key reused; `required_fields_unsatisfied` — Required fields unsatisfied; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "field_not_writable",
                            "idempotency_key_reused",
                            "required_fields_unsatisfied",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}": {
      "delete": {
        "operationId": "trashRun",
        "summary": "Move a run to Trash",
        "description": "Soft-deletes the run (recoverable from Trash for 30 days). Returns the Run with `deletedAt` set; a run already in Trash answers 200 unchanged.",
        "tags": [
          "Runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "845d4745-4cc1-46fe-9d6c-3cfead74544f",
                  "name": "Order 1002",
                  "status": "active",
                  "priority": "none",
                  "labels": [],
                  "labelDetails": [],
                  "dueAt": null,
                  "keyDate": null,
                  "revision": 4,
                  "updatedAt": "2026-10-13T01:10:28.661Z",
                  "startedAt": "2026-10-13T01:10:02.387Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": "2026-10-13T01:10:28.586Z",
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/845d4745-4cc1-46fe-9d6c-3cfead74544f",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      },
      "get": {
        "operationId": "getRun",
        "summary": "Get a run",
        "description": "Returns one run with every field value (canonical + formatted) and task state, plus its `revision` — send it back as `Expected-Revision` on a write that must not overwrite a newer change. A run in Trash loads with `deletedAt` set.",
        "tags": [
          "Runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "urgent",
                  "labels": [
                    "rush"
                  ],
                  "labelDetails": [
                    {
                      "id": "rush",
                      "name": "Rush",
                      "color": "#dc2626"
                    }
                  ],
                  "dueAt": "2026-10-21T06:59:59.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 1,
                  "updatedAt": "2026-10-13T01:09:29.022Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Two lines\nhere",
                      "formatted": "Two lines\nhere",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1700,
                      "formatted": "$1,700.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 900,
                      "formatted": "$900.00",
                      "visible": true,
                      "validationError": "Must not exceed $500.00."
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.05,
                      "formatted": "5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.05,
                      "formatted": "5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "A",
                        "C"
                      ],
                      "formatted": "A, C",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": true,
                      "formatted": "Yes",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "e9e90546-8500-4502-a8a3-0f705c013cfd"
                      ],
                      "formatted": "Fixture Admin",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3400,
                      "formatted": "$3,400.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": "zapier",
                      "formatted": "zapier",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow"
      },
      "patch": {
        "operationId": "updateRun",
        "summary": "Update a run's name, priority, labels, due date or status",
        "description": "Changes run-level attributes under the run lock. `status` is applied first; an archived run refuses every other change. Label ids are checked against the org's label set. Send `Expected-Revision` to refuse the write when the run changed since you read it.",
        "tags": [
          "Runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunPatch"
              },
              "example": {
                "name": "ORD 2026-10-15 Acme Corp (renamed)",
                "priority": "high",
                "labels": [
                  "waiting"
                ],
                "dueAt": "2026-11-01T17:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp (renamed)",
                  "status": "active",
                  "priority": "high",
                  "labels": [
                    "waiting"
                  ],
                  "labelDetails": [
                    {
                      "id": "waiting",
                      "name": "Waiting",
                      "color": "#f59e0b"
                    }
                  ],
                  "dueAt": "2026-11-01T17:00:00.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 2,
                  "updatedAt": "2026-10-13T01:09:37.189Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Two lines\nhere",
                      "formatted": "Two lines\nhere",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1700,
                      "formatted": "$1,700.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 900,
                      "formatted": "$900.00",
                      "visible": true,
                      "validationError": "Must not exceed $500.00."
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.05,
                      "formatted": "5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.05,
                      "formatted": "5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "A",
                        "C"
                      ],
                      "formatted": "A, C",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": true,
                      "formatted": "Yes",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "e9e90546-8500-4502-a8a3-0f705c013cfd"
                      ],
                      "formatted": "Fixture Admin",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3400,
                      "formatted": "$3,400.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": "zapier",
                      "formatted": "zapier",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/activity": {
      "get": {
        "operationId": "listRunActivity",
        "summary": "List a run's activity",
        "description": "The run's trail — every recorded change with its actor, raw payload and a human description — newest first (`order=asc` to read forward). Filter by `type`, `category` or `since` (strictly after an instant); page with the cursor. Events written in one transaction share a `createdAt`; the cursor orders them by id so none is skipped or repeated across a page boundary. A run in Trash still answers.",
        "tags": [
          "Activity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "fields",
                "tasks",
                "approvals",
                "files",
                "comments",
                "run"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRunActivityResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "c0638871-0f3e-40c9-8693-a02cb7419418",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "type": "field_changed",
                      "category": "fields",
                      "actor": {
                        "kind": "api",
                        "name": "collab key",
                        "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036"
                      },
                      "taskKey": "details",
                      "payload": {
                        "to": 900,
                        "from": null,
                        "label": "Quantity",
                        "fieldKey": "quantity"
                      },
                      "description": "API key collab key set Quantity: — → 900",
                      "createdAt": "2026-10-13T01:10:04.624Z"
                    },
                    {
                      "id": "af048190-cc58-4541-a8cc-23acc1e831f1",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "type": "field_changed",
                      "category": "fields",
                      "actor": {
                        "kind": "api",
                        "name": "collab key",
                        "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036"
                      },
                      "taskKey": "details",
                      "payload": {
                        "to": 1700,
                        "from": null,
                        "label": "Amount",
                        "fieldKey": "amount"
                      },
                      "description": "API key collab key set Amount: — → $1,700.00",
                      "createdAt": "2026-10-13T01:10:04.624Z"
                    },
                    {
                      "id": "37edb078-ad7b-42c2-ad4b-d585e4cb2496",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "type": "field_changed",
                      "category": "fields",
                      "actor": {
                        "kind": "api",
                        "name": "collab key",
                        "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036"
                      },
                      "taskKey": "details",
                      "payload": {
                        "to": "Gift note inside",
                        "from": null,
                        "label": "Memo",
                        "fieldKey": "memo"
                      },
                      "description": "API key collab key set Memo: — → Gift note inside",
                      "createdAt": "2026-10-13T01:10:04.624Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow",
        "x-processcart-paginated": true
      }
    },
    "/v1/runs/{id}/comments": {
      "get": {
        "operationId": "listRunComments",
        "summary": "List a run's comments",
        "description": "The run's live comments, oldest first, with the author, the sanitized body, a plain-text rendering and the mentioned member ids. A run in Trash still answers.",
        "tags": [
          "Comments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRunCommentsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "32629d31-996c-48af-8637-261a6aea7eca",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "taskKey": "details",
                      "runTaskId": "7d6b86f6-5f67-4729-870c-ed29c1be3009",
                      "author": {
                        "kind": "api",
                        "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                        "name": "collab key"
                      },
                      "body": {
                        "type": "doc",
                        "content": [
                          {
                            "type": "paragraph",
                            "content": [
                              {
                                "text": "Hello from the API",
                                "type": "text"
                              },
                              {
                                "type": "hardBreak"
                              },
                              {
                                "text": "second line",
                                "type": "text"
                              }
                            ]
                          }
                        ]
                      },
                      "text": "Hello from the API\nsecond line",
                      "mentions": [],
                      "createdAt": "2026-10-13T01:09:30.295Z",
                      "editedAt": null,
                      "url": "https://app.processcart.com/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0?task=details"
                    },
                    {
                      "id": "65c213cd-053b-47aa-93ec-c7fd21b06a49",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "taskKey": "details",
                      "runTaskId": "7d6b86f6-5f67-4729-870c-ed29c1be3009",
                      "author": {
                        "kind": "api",
                        "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                        "name": "collab key"
                      },
                      "body": {
                        "type": "doc",
                        "content": [
                          {
                            "type": "paragraph",
                            "content": [
                              {
                                "text": "Ping ",
                                "type": "text"
                              },
                              {
                                "type": "mention",
                                "attrs": {
                                  "id": "0515df8b-d0b5-43c5-b535-3b87ec2df4a8",
                                  "label": "Fixture Member"
                                }
                              },
                              {
                                "text": " and ",
                                "type": "text"
                              },
                              {
                                "text": " cc ",
                                "type": "text"
                              },
                              {
                                "type": "mention",
                                "attrs": {
                                  "id": "f3e7a668-7e78-44f2-bc92-4457a9a54337",
                                  "label": "Fixture Admin"
                                }
                              }
                            ]
                          }
                        ]
                      },
                      "text": "Ping @Fixture Member and  cc @Fixture Admin",
                      "mentions": [
                        "0515df8b-d0b5-43c5-b535-3b87ec2df4a8",
                        "f3e7a668-7e78-44f2-bc92-4457a9a54337"
                      ],
                      "createdAt": "2026-10-13T01:09:32.773Z",
                      "editedAt": null,
                      "url": "https://app.processcart.com/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0?task=details"
                    },
                    {
                      "id": "b70b33e8-8a42-4289-8fa7-564929b05c43",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "taskKey": "details",
                      "runTaskId": "7d6b86f6-5f67-4729-870c-ed29c1be3009",
                      "author": {
                        "kind": "user",
                        "userId": "f3e7a668-7e78-44f2-bc92-4457a9a54337",
                        "name": "Fixture Admin"
                      },
                      "body": {
                        "type": "doc",
                        "content": [
                          {
                            "type": "paragraph",
                            "content": [
                              {
                                "text": "From Ada",
                                "type": "text"
                              }
                            ]
                          }
                        ]
                      },
                      "text": "From Ada",
                      "mentions": [],
                      "createdAt": "2026-10-13T01:09:34.271Z",
                      "editedAt": null,
                      "url": "https://app.processcart.com/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0?task=details"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "createRunComment",
        "summary": "Comment on a task",
        "description": "Posts a comment on one of the run's tasks as the API key (`author.kind` = `api`). Send plain `text` or a rich `body` — never both. The body is sanitized strictly: unknown node and mark types are dropped, a mention's label is re-derived from the member list, and a mention of a non-member is removed. Mentioned members are notified. Comments never change the run's revision. Refused on an archived or trashed run.",
        "tags": [
          "Comments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRunCommentBody"
              },
              "example": {
                "taskKey": "details",
                "text": "Hello from the API\nsecond line"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                },
                "example": {
                  "id": "32629d31-996c-48af-8637-261a6aea7eca",
                  "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                  "taskKey": "details",
                  "runTaskId": "7d6b86f6-5f67-4729-870c-ed29c1be3009",
                  "author": {
                    "kind": "api",
                    "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                    "name": "collab key"
                  },
                  "body": {
                    "type": "doc",
                    "content": [
                      {
                        "type": "paragraph",
                        "content": [
                          {
                            "type": "text",
                            "text": "Hello from the API"
                          },
                          {
                            "type": "hardBreak"
                          },
                          {
                            "type": "text",
                            "text": "second line"
                          }
                        ]
                      }
                    ]
                  },
                  "text": "Hello from the API\nsecond line",
                  "mentions": [],
                  "createdAt": "2026-10-13T01:09:30.295Z",
                  "editedAt": null,
                  "url": "https://app.processcart.com/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0?task=details"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `run_archived` — Run is archived; `run_trashed` — Run is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "run_archived",
                            "run_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/comments/{commentId}": {
      "get": {
        "operationId": "getRunComment",
        "summary": "Get a comment",
        "description": "One live comment of the run — the resource a `POST` answered with (its `Location`). A deleted comment is a 404.",
        "tags": [
          "Comments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "commentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                },
                "example": {
                  "id": "32629d31-996c-48af-8637-261a6aea7eca",
                  "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                  "taskKey": "details",
                  "runTaskId": "7d6b86f6-5f67-4729-870c-ed29c1be3009",
                  "author": {
                    "kind": "api",
                    "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                    "name": "collab key"
                  },
                  "body": {
                    "type": "doc",
                    "content": [
                      {
                        "type": "paragraph",
                        "content": [
                          {
                            "text": "Hello from the API",
                            "type": "text"
                          },
                          {
                            "type": "hardBreak"
                          },
                          {
                            "text": "second line",
                            "type": "text"
                          }
                        ]
                      }
                    ]
                  },
                  "text": "Hello from the API\nsecond line",
                  "mentions": [],
                  "createdAt": "2026-10-13T01:09:30.295Z",
                  "editedAt": null,
                  "url": "https://app.processcart.com/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0?task=details"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow"
      }
    },
    "/v1/runs/{id}/fields": {
      "patch": {
        "operationId": "setRunFields",
        "summary": "Set field values",
        "description": "Writes one to two hundred field values in ONE transaction under the run lock (all-or-nothing — one bad key fails the whole request with every problem listed). A JSON number is the canonical value; a string is parsed by the field's format; `null` clears. Formula, file and display-text fields are not writable; fields of a completed task must be reopened first. Out-of-bounds values are accepted and flagged in `validationError`.",
        "tags": [
          "Fields"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldsWrite"
              },
              "example": {
                "amount": "$1,850.00",
                "rate": 0.075,
                "rate_text": "7.5%",
                "memo": "Updated by the API",
                "fee": 400,
                "agree": false,
                "tags": [],
                "source": 42,
                "owner": [
                  "61465009-1ab5-4eb6-b4f3-3aae0718d1fb"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "high",
                  "labels": [
                    "waiting"
                  ],
                  "labelDetails": [
                    {
                      "id": "waiting",
                      "name": "Waiting",
                      "color": "#f59e0b"
                    }
                  ],
                  "dueAt": "2026-11-01T17:00:00.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 8,
                  "updatedAt": "2026-10-13T01:09:51.829Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Updated by the API",
                      "formatted": "Updated by the API",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1850,
                      "formatted": "$1,850.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 400,
                      "formatted": "$400.00",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "61465009-1ab5-4eb6-b4f3-3aae0718d1fb"
                      ],
                      "formatted": "Fixture Member",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3700,
                      "formatted": "$3,700.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": 42,
                      "formatted": "42",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash; `task_completed` — Task already completed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed",
                            "task_completed"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`field_not_writable` — Field is not writable; `idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "field_not_writable",
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/files": {
      "get": {
        "operationId": "listRunFiles",
        "summary": "List a run's files",
        "description": "Every attachment on the run (File-field files and comment files), oldest first, without download links — `GET /files/{attachmentId}` mints one. A bounded list: `nextCursor` is null, and it takes no query parameters (an unknown one is a 422). A run in Trash still answers.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRunFilesResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "03f9307d-039e-484d-8da4-a460186ede29",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "taskKey": "details",
                      "fieldKey": "contract",
                      "commentId": null,
                      "filename": "contract.pdf",
                      "size": 1234,
                      "contentType": "application/pdf",
                      "uploadedByUserId": null,
                      "uploadedBy": {
                        "kind": "api",
                        "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                        "name": "collab key"
                      },
                      "createdAt": "2026-10-13T01:09:44.456Z"
                    },
                    {
                      "id": "58032013-39ef-41cf-a23a-9cde04f17fd8",
                      "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                      "taskKey": "details",
                      "fieldKey": null,
                      "commentId": "32629d31-996c-48af-8637-261a6aea7eca",
                      "filename": "note.txt",
                      "size": 3,
                      "contentType": "text/plain",
                      "uploadedByUserId": "f3e7a668-7e78-44f2-bc92-4457a9a54337",
                      "uploadedBy": {
                        "kind": "user",
                        "userId": "f3e7a668-7e78-44f2-bc92-4457a9a54337"
                      },
                      "createdAt": "2026-10-13T01:09:46.727Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow"
      },
      "post": {
        "operationId": "requestRunFile",
        "summary": "Request an upload ticket",
        "description": "Step 1 of 3. Names the file, its size and type and the File field it belongs to; answers 200 with a signed `upload.url` to PUT the raw bytes to (two hours, no other credential) and the `finalize` call to make afterwards. Nothing is stored yet — an abandoned ticket leaves no trace on the run. A hidden field, a non-File field or a comment target is refused. An `Idempotency-Key` replay past the ticket's two hours hands back an expired URL: request a new ticket under a new key.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestRunFileBody"
              },
              "example": {
                "filename": " contract.pdf ",
                "size": 1234,
                "contentType": "application/pdf",
                "target": {
                  "kind": "field",
                  "fieldKey": "contract"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadTicket"
                },
                "example": {
                  "attachmentId": "03f9307d-039e-484d-8da4-a460186ede29",
                  "upload": {
                    "method": "PUT",
                    "url": "https://storage.example.com/upload/REDACTED",
                    "headers": {
                      "Content-Type": "application/pdf"
                    },
                    "expiresAt": "2026-10-13T03:09:40.975Z"
                  },
                  "finalize": {
                    "method": "POST",
                    "url": "https://app.processcart.com/api/v1/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0/files/03f9307d-039e-484d-8da4-a460186ede29/finalize",
                    "body": {
                      "filename": "contract.pdf",
                      "target": {
                        "kind": "field",
                        "fieldKey": "contract"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `run_archived` — Run is archived; `run_trashed` — Run is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "run_archived",
                            "run_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`field_not_writable` — Field is not writable; `idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "field_not_writable",
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/files/{attachmentId}": {
      "delete": {
        "operationId": "deleteRunFile",
        "summary": "Remove a file",
        "description": "Removes a File-field file: the field's value drops it under the run lock (the task's required-field gate reacts like any other field change) and the stored object is deleted. Answers 204 with no body — read the run for its new `revision` before the next conditional write; `Expected-Revision` is honored. A comment's file cannot be removed through the API (403); a field of a completed task must be reopened first.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash; `task_completed` — Task already completed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed",
                            "task_completed"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      },
      "get": {
        "operationId": "getRunFile",
        "summary": "Get a file with a download link",
        "description": "The attachment plus a signed `downloadUrl` (one hour, `Content-Disposition: attachment`). Mint a fresh one per download rather than storing it. A run in Trash still answers.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                },
                "example": {
                  "id": "03f9307d-039e-484d-8da4-a460186ede29",
                  "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                  "taskKey": "details",
                  "fieldKey": "contract",
                  "commentId": null,
                  "filename": "contract.pdf",
                  "size": 1234,
                  "contentType": "application/pdf",
                  "uploadedByUserId": null,
                  "uploadedBy": {
                    "kind": "api",
                    "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                    "name": "collab key"
                  },
                  "createdAt": "2026-10-13T01:09:44.456Z",
                  "downloadUrl": "https://storage.test/storage/v1/object/sign/attachments/5fc61268-81a7-4437-8ef0-05484e4084cf/3245e6a5-3fbe-463a-ad0b-a7fd871957b0/03f9307d-039e-484d-8da4-a460186ede29/contract.pdf?token=dl&download=contract.pdf",
                  "downloadExpiresAt": "2026-10-13T02:09:47.501Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow"
      }
    },
    "/v1/runs/{id}/files/{attachmentId}/finalize": {
      "post": {
        "operationId": "finalizeRunFile",
        "summary": "Finalize an upload",
        "description": "Step 3 of 3, after the PUT. Verifies the stored object (its size and type are read from Storage, never from you), records the attachment and writes it into the File field under the run lock — a single-file field replaces its current file, a multi-file field appends. Answers the attachment beside the updated Run (its new `revision` is `run.revision`); `Expected-Revision` is honored. Before the bytes arrived it answers 409 `upload_incomplete`; a field of a completed task must be reopened first. Finalizing the same ticket twice is a no-op.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinalizeRunFileBody"
              },
              "example": {
                "filename": "contract.pdf",
                "target": {
                  "kind": "field",
                  "fieldKey": "contract"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalizeRunFileResponse"
                },
                "example": {
                  "attachment": {
                    "id": "03f9307d-039e-484d-8da4-a460186ede29",
                    "runId": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                    "taskKey": "details",
                    "fieldKey": "contract",
                    "commentId": null,
                    "filename": "contract.pdf",
                    "size": 1234,
                    "contentType": "application/pdf",
                    "uploadedByUserId": null,
                    "uploadedBy": {
                      "kind": "api",
                      "keyId": "d422b49f-a3f2-4244-b97e-8d50f25c3036",
                      "name": "collab key"
                    },
                    "createdAt": "2026-10-13T01:09:44.456Z"
                  },
                  "run": {
                    "id": "3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                    "name": "Collab run",
                    "status": "active",
                    "priority": "none",
                    "labels": [],
                    "labelDetails": [],
                    "dueAt": null,
                    "keyDate": null,
                    "revision": 4,
                    "updatedAt": "2026-10-13T01:09:44.456Z",
                    "startedAt": "2026-10-13T01:09:28.312Z",
                    "startedBy": "api",
                    "startedByUserId": null,
                    "schedule": null,
                    "scheduledFor": null,
                    "completedAt": null,
                    "deletedAt": null,
                    "workflow": {
                      "id": "3037d010-8e72-4ec4-b905-8157df322055",
                      "name": "Order fulfillment"
                    },
                    "versionId": "ed5d9aa2-f318-4f7f-a597-fb0a530f097f",
                    "url": "https://app.processcart.com/runs/3245e6a5-3fbe-463a-ad0b-a7fd871957b0",
                    "tasks": [
                      {
                        "key": "details",
                        "title": "Details",
                        "kind": "standard",
                        "section": "Intake",
                        "state": "todo",
                        "visible": true,
                        "locked": false,
                        "dueAt": null,
                        "assignees": [],
                        "completedAt": null,
                        "completedByUserId": null
                      },
                      {
                        "key": "review",
                        "title": "Review",
                        "kind": "approval",
                        "section": "Intake",
                        "state": "todo",
                        "visible": true,
                        "locked": false,
                        "dueAt": null,
                        "assignees": [
                          {
                            "kind": "user",
                            "userId": "f3e7a668-7e78-44f2-bc92-4457a9a54337"
                          }
                        ],
                        "completedAt": null,
                        "completedByUserId": null
                      },
                      {
                        "key": "stop",
                        "title": "Sign-off",
                        "kind": "standard",
                        "section": "Intake",
                        "state": "todo",
                        "visible": true,
                        "locked": false,
                        "dueAt": null,
                        "assignees": [],
                        "completedAt": null,
                        "completedByUserId": null
                      },
                      {
                        "key": "wrapup",
                        "title": "Wrap up",
                        "kind": "standard",
                        "section": "Intake",
                        "state": "todo",
                        "visible": true,
                        "locked": true,
                        "dueAt": null,
                        "assignees": [],
                        "completedAt": null,
                        "completedByUserId": null
                      }
                    ],
                    "fields": [
                      {
                        "key": "customer",
                        "label": "Customer",
                        "type": "text",
                        "format": "none",
                        "taskKey": "details",
                        "value": "Ada",
                        "formatted": "Ada",
                        "visible": true
                      },
                      {
                        "key": "order_code",
                        "label": "Order code",
                        "type": "text",
                        "format": "custom",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "memo",
                        "label": "Memo",
                        "type": "textarea",
                        "format": null,
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "quantity",
                        "label": "Quantity",
                        "type": "number",
                        "format": "number",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "amount",
                        "label": "Amount",
                        "type": "number",
                        "format": "currency",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "fee",
                        "label": "Fee",
                        "type": "number",
                        "format": "currency",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "rate",
                        "label": "Rate",
                        "type": "number",
                        "format": "percent",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "rate_text",
                        "label": "Rate (text)",
                        "type": "text",
                        "format": "percent",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "ship_date",
                        "label": "Ship date",
                        "type": "date",
                        "format": "date",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "start_time",
                        "label": "Start time",
                        "type": "time",
                        "format": "time",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "gift_wrap",
                        "label": "Gift wrap",
                        "type": "dropdown",
                        "format": null,
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true,
                        "choices": [
                          "Yes",
                          "No"
                        ]
                      },
                      {
                        "key": "tags",
                        "label": "Tags",
                        "type": "multi_choice",
                        "format": null,
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true,
                        "choices": [
                          "A",
                          "B",
                          "C"
                        ]
                      },
                      {
                        "key": "agree",
                        "label": "Agree",
                        "type": "checkbox",
                        "format": null,
                        "taskKey": "details",
                        "value": false,
                        "formatted": "No",
                        "visible": true
                      },
                      {
                        "key": "contact_email",
                        "label": "Contact email",
                        "type": "email",
                        "format": "email",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "website",
                        "label": "Website",
                        "type": "url",
                        "format": "url",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "phone",
                        "label": "Phone",
                        "type": "phone",
                        "format": "phone",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "owner",
                        "label": "Owner",
                        "type": "members",
                        "format": null,
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "steps",
                        "label": "Steps",
                        "type": "subtasks",
                        "format": null,
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true,
                        "items": [
                          {
                            "key": "photos",
                            "label": "Photos"
                          },
                          {
                            "key": "invoice",
                            "label": "Invoice"
                          }
                        ]
                      },
                      {
                        "key": "contract",
                        "label": "Contract",
                        "type": "file",
                        "format": null,
                        "taskKey": "details",
                        "value": [
                          "03f9307d-039e-484d-8da4-a460186ede29"
                        ],
                        "formatted": "contract.pdf",
                        "visible": true
                      },
                      {
                        "key": "double_amount",
                        "label": "Double amount",
                        "type": "formula",
                        "format": "currency",
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": true
                      },
                      {
                        "key": "source",
                        "label": "Source",
                        "type": "hidden",
                        "format": null,
                        "taskKey": "details",
                        "value": null,
                        "formatted": "",
                        "visible": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash; `task_completed` — Task already completed; `upload_incomplete` — Upload incomplete.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed",
                            "task_completed",
                            "upload_incomplete"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`field_not_writable` — Field is not writable; `idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "field_not_writable",
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/restore": {
      "post": {
        "operationId": "restoreRun",
        "summary": "Restore a run from Trash",
        "description": "Brings a trashed run back. A run that is not in Trash answers 200 unchanged; a run whose workflow is itself in Trash is refused (restore the workflow first). `Expected-Revision` is honored as a compare-and-set.",
        "tags": [
          "Runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "845d4745-4cc1-46fe-9d6c-3cfead74544f",
                  "name": "Order 1002",
                  "status": "active",
                  "priority": "none",
                  "labels": [],
                  "labelDetails": [],
                  "dueAt": null,
                  "keyDate": null,
                  "revision": 5,
                  "updatedAt": "2026-10-13T01:10:33.053Z",
                  "startedAt": "2026-10-13T01:10:02.387Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/845d4745-4cc1-46fe-9d6c-3cfead74544f",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "workflow_trashed"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/tasks": {
      "get": {
        "operationId": "listRunTasks",
        "summary": "List a run's tasks",
        "description": "The run's tasks in checklist order with state, visibility, lock, due date and assignees — the same `tasks[]` the Run carries, as a bounded list (`nextCursor` is null). It takes no query parameters (an unknown one is a 422).",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunTaskList"
                },
                "example": {
                  "data": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "workflow"
      }
    },
    "/v1/runs/{id}/tasks/{key}/approve": {
      "post": {
        "operationId": "approveTask",
        "summary": "Approve an approval task",
        "description": "Records an approval with an optional comment; the body may be left out, or sent as `{}`, when there is nothing to add. Needs the `approvals:decide` scope — the key then decides with Admin authority. An approval already approved is refused until it is reopened.",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskDecision"
              },
              "example": {
                "comment": "Looks good."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "high",
                  "labels": [
                    "waiting"
                  ],
                  "labelDetails": [
                    {
                      "id": "waiting",
                      "name": "Waiting",
                      "color": "#f59e0b"
                    }
                  ],
                  "dueAt": "2026-11-01T17:00:00.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 14,
                  "updatedAt": "2026-10-13T01:10:17.100Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "done",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": "2026-10-13T01:10:10.107Z",
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "done",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": "2026-10-13T01:10:17.009Z",
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Updated by the API",
                      "formatted": "Updated by the API",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1850,
                      "formatted": "$1,850.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 400,
                      "formatted": "$400.00",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "61465009-1ab5-4eb6-b4f3-3aae0718d1fb"
                      ],
                      "formatted": "Fixture Member",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3700,
                      "formatted": "$3,700.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": 42,
                      "formatted": "42",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`approver_only` — Approver only; `insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "approver_only",
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash; `task_completed` — Task already completed; `task_hidden` — Task is hidden; `task_locked` — Task is locked; `wrong_task_kind` — Wrong task kind.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed",
                            "task_completed",
                            "task_hidden",
                            "task_locked",
                            "wrong_task_kind"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `required_fields_unsatisfied` — Required fields unsatisfied; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "required_fields_unsatisfied",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "approvals:decide",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/tasks/{key}/complete": {
      "post": {
        "operationId": "completeTask",
        "summary": "Complete a task",
        "description": "Marks a standard task done, after the engine's gates: the task must be visible and unlocked and its required fields satisfied (every offender is listed in `errors[]`). Approval tasks are decided through approve / reject instead; an already-completed task answers 200 unchanged.",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "high",
                  "labels": [
                    "waiting"
                  ],
                  "labelDetails": [
                    {
                      "id": "waiting",
                      "name": "Waiting",
                      "color": "#f59e0b"
                    }
                  ],
                  "dueAt": "2026-11-01T17:00:00.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 9,
                  "updatedAt": "2026-10-13T01:09:58.990Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "done",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": "2026-10-13T01:09:58.900Z",
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Updated by the API",
                      "formatted": "Updated by the API",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1850,
                      "formatted": "$1,850.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 400,
                      "formatted": "$400.00",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "61465009-1ab5-4eb6-b4f3-3aae0718d1fb"
                      ],
                      "formatted": "Fixture Member",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3700,
                      "formatted": "$3,700.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": 42,
                      "formatted": "42",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash; `task_hidden` — Task is hidden; `task_locked` — Task is locked; `task_not_configured` — Task not configured; `wrong_task_kind` — Wrong task kind.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed",
                            "task_hidden",
                            "task_locked",
                            "task_not_configured",
                            "wrong_task_kind"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `required_fields_unsatisfied` — Required fields unsatisfied; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "required_fields_unsatisfied",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/tasks/{key}/reject": {
      "post": {
        "operationId": "rejectTask",
        "summary": "Reject an approval task",
        "description": "Records a rejection — the comment is required — and sends the configured earlier tasks back for redo. Needs the `approvals:decide` scope. A duplicate rejection answers 200 unchanged. An approval already approved is refused until it is reopened.",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskDecision"
              },
              "example": {
                "comment": "Redo the photos before I sign."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "high",
                  "labels": [
                    "waiting"
                  ],
                  "labelDetails": [
                    {
                      "id": "waiting",
                      "name": "Waiting",
                      "color": "#f59e0b"
                    }
                  ],
                  "dueAt": "2026-11-01T17:00:00.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 10,
                  "updatedAt": "2026-10-13T01:10:07.652Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "rejected_redo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Updated by the API",
                      "formatted": "Updated by the API",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1850,
                      "formatted": "$1,850.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 400,
                      "formatted": "$400.00",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "61465009-1ab5-4eb6-b4f3-3aae0718d1fb"
                      ],
                      "formatted": "Fixture Member",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3700,
                      "formatted": "$3,700.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": 42,
                      "formatted": "42",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`approver_only` — Approver only; `insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "approver_only",
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash; `task_completed` — Task already completed; `task_hidden` — Task is hidden; `task_locked` — Task is locked; `wrong_task_kind` — Wrong task kind.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed",
                            "task_completed",
                            "task_hidden",
                            "task_locked",
                            "wrong_task_kind"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "approvals:decide",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/runs/{id}/tasks/{key}/reopen": {
      "post": {
        "operationId": "reopenTask",
        "summary": "Reopen a completed task",
        "description": "Puts a done task back to to-do (a completed run becomes active again). Reopening an approval needs the `approvals:decide` scope. A task that is not done answers 200 unchanged. A hidden or locked task can still be reopened — only complete, approve and reject gate on visibility and locks.",
        "tags": [
          "Tasks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ExpectedRevision"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "name": "ORD 2026-10-15 Acme Corp",
                  "status": "active",
                  "priority": "high",
                  "labels": [
                    "waiting"
                  ],
                  "labelDetails": [
                    {
                      "id": "waiting",
                      "name": "Waiting",
                      "color": "#f59e0b"
                    }
                  ],
                  "dueAt": "2026-11-01T17:00:00.000Z",
                  "keyDate": "2026-10-15",
                  "revision": 13,
                  "updatedAt": "2026-10-13T01:10:15.207Z",
                  "startedAt": "2026-10-13T01:09:28.930Z",
                  "startedBy": "api",
                  "startedByUserId": null,
                  "schedule": null,
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "e1d9bfda-9e93-4cce-8518-b4a185a6d4cb",
                    "name": "Order fulfillment"
                  },
                  "versionId": "6b9a8079-3136-4818-8405-26c69bbac982",
                  "url": "https://app.processcart.com/runs/33ec8c8c-e219-422c-8dda-5c8633d2e368",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "done",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": "2026-10-13T01:10:10.107Z",
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "e9e90546-8500-4502-a8a3-0f705c013cfd"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Ada Lovelace",
                      "formatted": "Ada Lovelace",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": "AB-1234",
                      "formatted": "AB-1234",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": "Updated by the API",
                      "formatted": "Updated by the API",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": 1250,
                      "formatted": "1,250",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 1850,
                      "formatted": "$1,850.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 400,
                      "formatted": "$400.00",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": 0.075,
                      "formatted": "7.5%",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": "2026-10-15",
                      "formatted": "Oct 15, 2026",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": "14:30",
                      "formatted": "2:30 PM",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": "Yes",
                      "formatted": "Yes",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": "ada@example.com",
                      "formatted": "ada@example.com",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": "https://example.com/",
                      "formatted": "https://example.com/",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": "+14155550100",
                      "formatted": "(415) 555-0100",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "61465009-1ab5-4eb6-b4f3-3aae0718d1fb"
                      ],
                      "formatted": "Fixture Member",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": [
                        "photos"
                      ],
                      "formatted": "1 of 2: Photos",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 3700,
                      "formatted": "$3,700.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": 42,
                      "formatted": "42",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`approver_only` — Approver only; `insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "approver_only",
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `revision_mismatch` — Revision mismatch; `run_archived` — Run is archived; `run_trashed` — Run is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "revision_mismatch",
                            "run_archived",
                            "run_trashed"
                          ]
                        },
                        "currentRevision": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Present when `code` is `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/schedules": {
      "get": {
        "operationId": "listSchedules",
        "summary": "List schedules",
        "description": "Lists the workspace's recurrence schedules, newest first, each with its recurrence, presets, enabled state and next occurrences. Filter by `workflowId` or `enabled`. `updatedSince` turns the list into an incremental sync ordered by `updatedAt` ascending (inclusive). A key restricted to workflows or folders lists only the schedules of workflows inside its allowlist.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleList"
                },
                "example": {
                  "data": [
                    {
                      "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                      "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                      "workflow": {
                        "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                        "name": "Order fulfillment"
                      },
                      "name": "Weekly order review",
                      "description": "Every Monday at 9:00 AM",
                      "recurrence": {
                        "freq": "weekly",
                        "interval": 1,
                        "time": "09:00",
                        "startDate": "2026-11-02",
                        "weekly": {
                          "days": [
                            "mon"
                          ]
                        }
                      },
                      "timezone": "America/Los_Angeles",
                      "namePattern": "{{workflow}} — {{date}}",
                      "presetValues": {
                        "amount": 250,
                        "customer": "Acme Corp"
                      },
                      "assignmentOverrides": {
                        "review": [
                          {
                            "kind": "user",
                            "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                          }
                        ],
                        "wrapup": [
                          {
                            "kind": "group",
                            "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                          }
                        ]
                      },
                      "enabled": true,
                      "disabledReason": null,
                      "lastError": null,
                      "consecutiveFailures": 0,
                      "nextRunAt": "2026-11-02T17:00:00.000Z",
                      "nextOccurrences": [
                        "2026-11-02T17:00:00.000Z",
                        "2026-11-09T17:00:00.000Z",
                        "2026-11-16T17:00:00.000Z"
                      ],
                      "lastRunAt": null,
                      "latestRun": {
                        "id": "1185793a-e8fc-4470-a359-826794842cef",
                        "name": "Order fulfillment — Oct 10, 2026",
                        "startedAt": "2026-10-11T05:27:53.467Z"
                      },
                      "presetMismatches": [],
                      "createdBy": null,
                      "createdAt": "2026-10-11T05:27:50.731Z",
                      "updatedAt": "2026-10-11T05:27:52.873Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "createSchedule",
        "summary": "Create a schedule",
        "description": "Creates a schedule that starts runs of one published workflow on a recurrence (daily, weekly, monthly or yearly, at a time on a 5-minute step), with a run-name pattern, preset field values (every required kickoff field needs one; a preset outside its field's bounds is refused with 422, `errors[].code` `invalid_value`) and optional per-task assignees. `timezone` defaults to the workspace's. A recurrence with no future occurrence is refused. Audited. A key restricted to workflows or folders sees only the schedules of workflows inside its allowlist; any other schedule answers 403 `not_allowed_for_key`.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleConfig"
              },
              "example": {
                "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                "name": "Weekly order review",
                "recurrence": {
                  "freq": "weekly",
                  "interval": 1,
                  "time": "09:00",
                  "startDate": "2026-11-02",
                  "weekly": {
                    "days": [
                      "mon"
                    ]
                  }
                },
                "presetValues": {
                  "customer": "Acme Corp",
                  "amount": 250
                },
                "assignmentOverrides": {
                  "review": [
                    {
                      "kind": "user",
                      "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                    }
                  ],
                  "wrapup": [
                    {
                      "kind": "group",
                      "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schedule"
                },
                "example": {
                  "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                  "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                  "workflow": {
                    "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                    "name": "Order fulfillment"
                  },
                  "name": "Weekly order review",
                  "description": "Every Monday at 9:00 AM",
                  "recurrence": {
                    "freq": "weekly",
                    "interval": 1,
                    "time": "09:00",
                    "startDate": "2026-11-02",
                    "weekly": {
                      "days": [
                        "mon"
                      ]
                    }
                  },
                  "timezone": "America/Los_Angeles",
                  "namePattern": "{{workflow}} — {{date}}",
                  "presetValues": {
                    "amount": 250,
                    "customer": "Acme Corp"
                  },
                  "assignmentOverrides": {
                    "review": [
                      {
                        "kind": "user",
                        "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                      }
                    ],
                    "wrapup": [
                      {
                        "kind": "group",
                        "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                      }
                    ]
                  },
                  "enabled": true,
                  "disabledReason": null,
                  "lastError": null,
                  "consecutiveFailures": 0,
                  "nextRunAt": "2026-11-02T17:00:00.000Z",
                  "nextOccurrences": [
                    "2026-11-02T17:00:00.000Z",
                    "2026-11-09T17:00:00.000Z",
                    "2026-11-16T17:00:00.000Z"
                  ],
                  "lastRunAt": null,
                  "latestRun": null,
                  "presetMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.731Z",
                  "updatedAt": "2026-10-11T05:27:50.731Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key; `workflow_not_runnable` — Workflow not runnable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key",
                            "workflow_not_runnable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_not_published` — Workflow not published; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_not_published",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/schedules/{id}": {
      "delete": {
        "operationId": "deleteSchedule",
        "summary": "Delete a schedule",
        "description": "Deletes the schedule. Runs it already created stay; their `schedule` member reads null afterwards. Audited.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      },
      "get": {
        "operationId": "getSchedule",
        "summary": "Get a schedule",
        "description": "Returns one schedule with its recurrence in words, presets, assignment overrides, enabled state and pause reason, failure counter, next occurrences, newest run and any presets the published workflow no longer accepts. A key restricted to workflows or folders sees only the schedules of workflows inside its allowlist; any other schedule answers 403 `not_allowed_for_key`.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schedule"
                },
                "example": {
                  "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                  "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                  "workflow": {
                    "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                    "name": "Order fulfillment"
                  },
                  "name": "Weekly order review",
                  "description": "Every Monday at 9:00 AM",
                  "recurrence": {
                    "freq": "weekly",
                    "interval": 1,
                    "time": "09:00",
                    "startDate": "2026-11-02",
                    "weekly": {
                      "days": [
                        "mon"
                      ]
                    }
                  },
                  "timezone": "America/Los_Angeles",
                  "namePattern": "{{workflow}} — {{date}}",
                  "presetValues": {
                    "amount": 250,
                    "customer": "Acme Corp"
                  },
                  "assignmentOverrides": {
                    "review": [
                      {
                        "kind": "user",
                        "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                      }
                    ],
                    "wrapup": [
                      {
                        "kind": "group",
                        "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                      }
                    ]
                  },
                  "enabled": true,
                  "disabledReason": null,
                  "lastError": null,
                  "consecutiveFailures": 0,
                  "nextRunAt": "2026-11-02T17:00:00.000Z",
                  "nextOccurrences": [
                    "2026-11-02T17:00:00.000Z",
                    "2026-11-09T17:00:00.000Z",
                    "2026-11-16T17:00:00.000Z"
                  ],
                  "lastRunAt": null,
                  "latestRun": {
                    "id": "1185793a-e8fc-4470-a359-826794842cef",
                    "name": "Order fulfillment — Oct 10, 2026",
                    "startedAt": "2026-10-11T05:27:53.467Z"
                  },
                  "presetMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.731Z",
                  "updatedAt": "2026-10-11T05:27:52.873Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow"
      },
      "patch": {
        "operationId": "updateSchedule",
        "summary": "Update a schedule",
        "description": "Changes any subset of `name`, `recurrence`, `timezone`, `namePattern`, `presetValues` and `assignmentOverrides` (presets and overrides are checked against the workflow's current published version). A new recurrence or zone recomputes the next run from now. `workflowId` cannot change, and `enabled` is not part of the configuration — use the pause and resume operations (422 `unknown_key` on `enabled`). A preset outside its field's bounds is refused (422 `invalid_value`). Audited.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePatch"
              },
              "example": {
                "name": "Weekly order review (Mondays)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schedule"
                },
                "example": {
                  "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                  "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                  "workflow": {
                    "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                    "name": "Order fulfillment"
                  },
                  "name": "Weekly order review (Mondays)",
                  "description": "Every Monday at 9:00 AM",
                  "recurrence": {
                    "freq": "weekly",
                    "interval": 1,
                    "time": "09:00",
                    "startDate": "2026-11-02",
                    "weekly": {
                      "days": [
                        "mon"
                      ]
                    }
                  },
                  "timezone": "America/Los_Angeles",
                  "namePattern": "{{workflow}} — {{date}}",
                  "presetValues": {
                    "amount": 250,
                    "customer": "Acme Corp"
                  },
                  "assignmentOverrides": {
                    "review": [
                      {
                        "kind": "user",
                        "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                      }
                    ],
                    "wrapup": [
                      {
                        "kind": "group",
                        "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                      }
                    ]
                  },
                  "enabled": true,
                  "disabledReason": null,
                  "lastError": null,
                  "consecutiveFailures": 0,
                  "nextRunAt": "2026-11-02T17:00:00.000Z",
                  "nextOccurrences": [
                    "2026-11-02T17:00:00.000Z",
                    "2026-11-09T17:00:00.000Z",
                    "2026-11-16T17:00:00.000Z"
                  ],
                  "lastRunAt": null,
                  "latestRun": {
                    "id": "1185793a-e8fc-4470-a359-826794842cef",
                    "name": "Order fulfillment — Oct 10, 2026",
                    "startedAt": "2026-10-11T05:27:53.467Z"
                  },
                  "presetMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.731Z",
                  "updatedAt": "2026-10-11T05:27:55.743Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key; `workflow_not_runnable` — Workflow not runnable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key",
                            "workflow_not_runnable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_not_published` — Workflow not published; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_not_published",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/schedules/{id}/pause": {
      "post": {
        "operationId": "pauseSchedule",
        "summary": "Pause a schedule",
        "description": "Stops the schedule from creating runs (reason `manual`). Pausing a paused schedule answers 200 unchanged and keeps its reason. Audited.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schedule"
                },
                "example": {
                  "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                  "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                  "workflow": {
                    "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                    "name": "Order fulfillment"
                  },
                  "name": "Weekly order review",
                  "description": "Every Monday at 9:00 AM",
                  "recurrence": {
                    "freq": "weekly",
                    "interval": 1,
                    "time": "09:00",
                    "startDate": "2026-11-02",
                    "weekly": {
                      "days": [
                        "mon"
                      ]
                    }
                  },
                  "timezone": "America/Los_Angeles",
                  "namePattern": "{{workflow}} — {{date}}",
                  "presetValues": {
                    "amount": 250,
                    "customer": "Acme Corp"
                  },
                  "assignmentOverrides": {
                    "review": [
                      {
                        "kind": "user",
                        "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                      }
                    ],
                    "wrapup": [
                      {
                        "kind": "group",
                        "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                      }
                    ]
                  },
                  "enabled": false,
                  "disabledReason": "manual",
                  "lastError": null,
                  "consecutiveFailures": 0,
                  "nextRunAt": null,
                  "nextOccurrences": [],
                  "lastRunAt": null,
                  "latestRun": null,
                  "presetMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.731Z",
                  "updatedAt": "2026-10-11T05:27:51.759Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/schedules/{id}/preview": {
      "get": {
        "operationId": "previewSchedule",
        "summary": "Preview a schedule's next occurrences",
        "description": "Returns the next `count` (1–10, default 3) times the schedule creates a run, as UTC instants. For a paused schedule, the occurrences a resume would produce (counted from now); empty once its end date has passed.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleOccurrences"
                },
                "example": {
                  "occurrences": [
                    "2026-11-02T17:00:00.000Z",
                    "2026-11-09T17:00:00.000Z",
                    "2026-11-16T17:00:00.000Z"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow"
      }
    },
    "/v1/schedules/{id}/resume": {
      "post": {
        "operationId": "resumeSchedule",
        "summary": "Resume a schedule",
        "description": "Turns a paused schedule back on. Resuming never catches up: occurrences missed while paused are skipped and the next run is the first occurrence after now. A schedule whose end date has passed is refused with 409 `schedule_ended` (change its recurrence first). A schedule whose workflow is unpublished answers 409 `workflow_not_published`, one in Trash 409 `workflow_trashed`, and an archived one 403 `workflow_not_runnable`. Resuming a running schedule answers 200 unchanged. Audited.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schedule"
                },
                "example": {
                  "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                  "workflowId": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                  "workflow": {
                    "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                    "name": "Order fulfillment"
                  },
                  "name": "Weekly order review",
                  "description": "Every Monday at 9:00 AM",
                  "recurrence": {
                    "freq": "weekly",
                    "interval": 1,
                    "time": "09:00",
                    "startDate": "2026-11-02",
                    "weekly": {
                      "days": [
                        "mon"
                      ]
                    }
                  },
                  "timezone": "America/Los_Angeles",
                  "namePattern": "{{workflow}} — {{date}}",
                  "presetValues": {
                    "amount": 250,
                    "customer": "Acme Corp"
                  },
                  "assignmentOverrides": {
                    "review": [
                      {
                        "kind": "user",
                        "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                      }
                    ],
                    "wrapup": [
                      {
                        "kind": "group",
                        "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                      }
                    ]
                  },
                  "enabled": true,
                  "disabledReason": null,
                  "lastError": null,
                  "consecutiveFailures": 0,
                  "nextRunAt": "2026-11-02T17:00:00.000Z",
                  "nextOccurrences": [
                    "2026-11-02T17:00:00.000Z",
                    "2026-11-09T17:00:00.000Z",
                    "2026-11-16T17:00:00.000Z"
                  ],
                  "lastRunAt": null,
                  "latestRun": null,
                  "presetMismatches": [],
                  "createdBy": null,
                  "createdAt": "2026-10-11T05:27:50.731Z",
                  "updatedAt": "2026-10-11T05:27:52.873Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key; `workflow_not_runnable` — Workflow not runnable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key",
                            "workflow_not_runnable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `schedule_ended` — Schedule ended; `workflow_not_published` — Workflow not published; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "schedule_ended",
                            "workflow_not_published",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/schedules/{id}/run": {
      "post": {
        "operationId": "runScheduleNow",
        "summary": "Start a run from a schedule now",
        "description": "Starts one run right away with the schedule's name pattern, presets and assignment overrides — paused or not, outside the recurrence. Returns the new Run (`startedBy: \"schedule\"`, `schedule` set, `scheduledFor: null`, `revision: 1`) and an absolute `Location`. Presets the published workflow no longer accepts are skipped; a required kickoff field without a preset is refused with 422 `required_fields_unsatisfied`. Audited.",
        "tags": [
          "Schedules"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                },
                "example": {
                  "id": "1185793a-e8fc-4470-a359-826794842cef",
                  "name": "Order fulfillment — Oct 10, 2026",
                  "status": "active",
                  "priority": "none",
                  "labels": [],
                  "labelDetails": [],
                  "dueAt": null,
                  "keyDate": null,
                  "revision": 1,
                  "updatedAt": "2026-10-11T05:27:53.910Z",
                  "startedAt": "2026-10-11T05:27:53.467Z",
                  "startedBy": "schedule",
                  "startedByUserId": null,
                  "schedule": {
                    "id": "12b83373-b279-48e5-86b1-c88e71c9ed29",
                    "name": "Weekly order review"
                  },
                  "scheduledFor": null,
                  "completedAt": null,
                  "deletedAt": null,
                  "workflow": {
                    "id": "39b74b11-d796-42e5-972f-d2a20b5ce7b1",
                    "name": "Order fulfillment"
                  },
                  "versionId": "9973fead-8dbf-4719-9a61-9dc7b126a7f4",
                  "url": "https://app.processcart.com/runs/1185793a-e8fc-4470-a359-826794842cef",
                  "tasks": [
                    {
                      "key": "details",
                      "title": "Details",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "review",
                      "title": "Review",
                      "kind": "approval",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "user",
                          "userId": "d4a284fd-cdc8-43c1-8933-084a811fc33e"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "stop",
                      "title": "Sign-off",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": false,
                      "dueAt": null,
                      "assignees": [],
                      "completedAt": null,
                      "completedByUserId": null
                    },
                    {
                      "key": "wrapup",
                      "title": "Wrap up",
                      "kind": "standard",
                      "section": "Intake",
                      "state": "todo",
                      "visible": true,
                      "locked": true,
                      "dueAt": null,
                      "assignees": [
                        {
                          "kind": "group",
                          "groupId": "98257cc7-dce3-4ca7-a310-ecf91b75e201"
                        }
                      ],
                      "completedAt": null,
                      "completedByUserId": null
                    }
                  ],
                  "fields": [
                    {
                      "key": "customer",
                      "label": "Customer",
                      "type": "text",
                      "format": "none",
                      "taskKey": "details",
                      "value": "Acme Corp",
                      "formatted": "Acme Corp",
                      "visible": true
                    },
                    {
                      "key": "order_code",
                      "label": "Order code",
                      "type": "text",
                      "format": "custom",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "memo",
                      "label": "Memo",
                      "type": "textarea",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "quantity",
                      "label": "Quantity",
                      "type": "number",
                      "format": "number",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "amount",
                      "label": "Amount",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 250,
                      "formatted": "$250.00",
                      "visible": true
                    },
                    {
                      "key": "fee",
                      "label": "Fee",
                      "type": "number",
                      "format": "currency",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "rate",
                      "label": "Rate",
                      "type": "number",
                      "format": "percent",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "rate_text",
                      "label": "Rate (text)",
                      "type": "text",
                      "format": "percent",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "ship_date",
                      "label": "Ship date",
                      "type": "date",
                      "format": "date",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "start_time",
                      "label": "Start time",
                      "type": "time",
                      "format": "time",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "gift_wrap",
                      "label": "Gift wrap",
                      "type": "dropdown",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "Yes",
                        "No"
                      ]
                    },
                    {
                      "key": "tags",
                      "label": "Tags",
                      "type": "multi_choice",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "choices": [
                        "A",
                        "B",
                        "C"
                      ]
                    },
                    {
                      "key": "agree",
                      "label": "Agree",
                      "type": "checkbox",
                      "format": null,
                      "taskKey": "details",
                      "value": false,
                      "formatted": "No",
                      "visible": true
                    },
                    {
                      "key": "contact_email",
                      "label": "Contact email",
                      "type": "email",
                      "format": "email",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "website",
                      "label": "Website",
                      "type": "url",
                      "format": "url",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "phone",
                      "label": "Phone",
                      "type": "phone",
                      "format": "phone",
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "owner",
                      "label": "Owner",
                      "type": "members",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "steps",
                      "label": "Steps",
                      "type": "subtasks",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true,
                      "items": [
                        {
                          "key": "photos",
                          "label": "Photos"
                        },
                        {
                          "key": "invoice",
                          "label": "Invoice"
                        }
                      ]
                    },
                    {
                      "key": "contract",
                      "label": "Contract",
                      "type": "file",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": true
                    },
                    {
                      "key": "double_amount",
                      "label": "Double amount",
                      "type": "formula",
                      "format": "currency",
                      "taskKey": "details",
                      "value": 500,
                      "formatted": "$500.00",
                      "visible": true
                    },
                    {
                      "key": "source",
                      "label": "Source",
                      "type": "hidden",
                      "format": null,
                      "taskKey": "details",
                      "value": null,
                      "formatted": "",
                      "visible": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key; `workflow_not_runnable` — Workflow not runnable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key",
                            "workflow_not_runnable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `workflow_not_published` — Workflow not published; `workflow_trashed` — Workflow is in Trash.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "workflow_not_published",
                            "workflow_trashed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `required_fields_unsatisfied` — Required fields unsatisfied; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "required_fields_unsatisfied",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "schedules:manage",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/users": {
      "get": {
        "operationId": "listUsers",
        "summary": "List members",
        "description": "The workspace's members in the order they joined: user id, display name, role (`member`, `builder`, `admin`) and avatar. Email addresses are not exposed. Use the ids to read assignees and to filter runs with `assignee=u:<id>`.",
        "tags": [
          "Directory"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListUsersResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "a5340bfc-1ba6-429e-97b3-ac741f62ffdf",
                      "name": "Fixture Admin",
                      "role": "admin",
                      "avatarUrl": null,
                      "joinedAt": "2026-10-10T17:44:11.041Z"
                    },
                    {
                      "id": "7a632343-8bfa-4b60-849a-aaad7fcd7b4c",
                      "name": "Fixture Member",
                      "role": "member",
                      "avatarUrl": null,
                      "joinedAt": "2026-10-10T17:44:11.272Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "users:read",
        "x-processcart-paginated": true
      }
    },
    "/v1/views": {
      "get": {
        "operationId": "listViews",
        "summary": "List shared views",
        "description": "Every saved view shared with the workspace (`org`) or with groups (`groups`), by name, with the board query each one selects. Private views never appear. `updatedSince` turns the list into an incremental sync ordered by `updatedAt` ascending (inclusive).",
        "tags": [
          "Views"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListViewsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "d9d20dae-2010-4211-8b78-d724b96d3125",
                      "name": "Alpha board",
                      "query": {
                        "workflowId": "165fe8d7-471f-4748-b8ab-a6ee3478cd7d",
                        "status": [],
                        "priority": [],
                        "labels": [],
                        "assignee": null,
                        "due": null,
                        "q": "",
                        "qMode": "prefix",
                        "sort": {
                          "key": "started",
                          "dir": "desc"
                        },
                        "columns": [
                          "status",
                          "priority",
                          "progress",
                          "key_date",
                          "due",
                          "assignees",
                          "started"
                        ]
                      },
                      "visibility": "org",
                      "groupIds": [],
                      "owner": {
                        "userId": "fde8fad1-9f03-4acb-bafe-91b9a9583a60",
                        "name": "Fixture Admin"
                      },
                      "createdAt": "2026-10-13T00:39:38.376Z",
                      "updatedAt": "2026-10-13T00:39:38.376Z"
                    },
                    {
                      "id": "11478b4b-5c42-4bb8-829e-65d4c8493a3a",
                      "name": "Reviewers' queue",
                      "query": {
                        "workflowId": null,
                        "status": [
                          "active",
                          "on_hold"
                        ],
                        "priority": [],
                        "labels": [],
                        "assignee": {
                          "kind": "group",
                          "id": "46139a8e-9621-4f2c-98f3-8975bb8d2589"
                        },
                        "due": null,
                        "q": "",
                        "qMode": "prefix",
                        "sort": {
                          "key": "started",
                          "dir": "desc"
                        },
                        "columns": [
                          "status",
                          "priority",
                          "progress",
                          "key_date",
                          "due",
                          "assignees",
                          "started"
                        ]
                      },
                      "visibility": "groups",
                      "groupIds": [
                        "46139a8e-9621-4f2c-98f3-8975bb8d2589"
                      ],
                      "owner": {
                        "userId": "4f9b94a3-9d38-479d-a0f3-9c8f01dcff92",
                        "name": "Fixture Member"
                      },
                      "createdAt": "2026-10-13T00:39:38.462Z",
                      "updatedAt": "2026-10-13T00:39:38.462Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "views:read",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "createView",
        "summary": "Create a shared view",
        "description": "Saves a board query as a view shared with everyone (default) or with specific groups. Send only the query members you set — the rest take the board's defaults, and the response carries the complete query. The view is owned by the member who created the API key, who must still be a Builder or Admin of the workspace (else 403 — mint a key as a current Admin). Each owner keeps at most 30 views.",
        "tags": [
          "Views"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateViewBody"
              },
              "example": {
                "name": "Active by name",
                "query": {
                  "workflowId": "165fe8d7-471f-4748-b8ab-a6ee3478cd7d",
                  "status": [
                    "active"
                  ],
                  "sort": {
                    "key": "name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                },
                "example": {
                  "id": "6885f52f-03a9-464e-b9bb-95b359a3a57b",
                  "name": "Active by name",
                  "query": {
                    "workflowId": "165fe8d7-471f-4748-b8ab-a6ee3478cd7d",
                    "status": [
                      "active"
                    ],
                    "priority": [],
                    "labels": [],
                    "assignee": null,
                    "due": null,
                    "q": "",
                    "qMode": "prefix",
                    "sort": {
                      "key": "name",
                      "dir": "asc"
                    },
                    "columns": [
                      "status",
                      "priority",
                      "progress",
                      "key_date",
                      "due",
                      "assignees",
                      "started"
                    ]
                  },
                  "visibility": "org",
                  "groupIds": [],
                  "owner": {
                    "userId": "fde8fad1-9f03-4acb-bafe-91b9a9583a60",
                    "name": "Fixture Admin"
                  },
                  "createdAt": "2026-10-13T00:39:39.520Z",
                  "updatedAt": "2026-10-13T00:39:39.520Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "views:write",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/views/{id}": {
      "delete": {
        "operationId": "deleteView",
        "summary": "Delete a shared view",
        "description": "Removes any shared view of the workspace, whoever owns it (the same power an Admin has in the app); the deletion is recorded in the audit log under the key's name. A private view is a 404.",
        "tags": [
          "Views"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "views:write",
        "x-processcart-idempotency-key": true
      },
      "get": {
        "operationId": "getView",
        "summary": "Get a shared view",
        "description": "One shared view with its query. A private view — even one owned by the member who created the key — is a 404.",
        "tags": [
          "Views"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                },
                "example": {
                  "id": "d9d20dae-2010-4211-8b78-d724b96d3125",
                  "name": "Alpha board",
                  "query": {
                    "workflowId": "165fe8d7-471f-4748-b8ab-a6ee3478cd7d",
                    "status": [],
                    "priority": [],
                    "labels": [],
                    "assignee": null,
                    "due": null,
                    "q": "",
                    "qMode": "prefix",
                    "sort": {
                      "key": "started",
                      "dir": "desc"
                    },
                    "columns": [
                      "status",
                      "priority",
                      "progress",
                      "key_date",
                      "due",
                      "assignees",
                      "started"
                    ]
                  },
                  "visibility": "org",
                  "groupIds": [],
                  "owner": {
                    "userId": "fde8fad1-9f03-4acb-bafe-91b9a9583a60",
                    "name": "Fixture Admin"
                  },
                  "createdAt": "2026-10-13T00:39:38.376Z",
                  "updatedAt": "2026-10-13T00:39:38.376Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "views:read"
      },
      "patch": {
        "operationId": "updateView",
        "summary": "Update a shared view",
        "description": "Renames a view, changes its query or changes who it is shared with. A `query` changes only the members it sends; the rest keep the view's stored values. Only a view owned by the member who created the key can be changed through the API, and that member must still be a Builder or Admin of the workspace (403 `not_allowed_for_key` otherwise). Switching to `org` drops the group list; `groups` needs at least one group of the workspace.",
        "tags": [
          "Views"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateViewBody"
              },
              "example": {
                "name": "Alpha board (renamed)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                },
                "example": {
                  "id": "d9d20dae-2010-4211-8b78-d724b96d3125",
                  "name": "Alpha board (renamed)",
                  "query": {
                    "workflowId": "165fe8d7-471f-4748-b8ab-a6ee3478cd7d",
                    "status": [],
                    "priority": [],
                    "labels": [],
                    "assignee": null,
                    "due": null,
                    "q": "",
                    "qMode": "prefix",
                    "sort": {
                      "key": "started",
                      "dir": "desc"
                    },
                    "columns": [
                      "status",
                      "priority",
                      "progress",
                      "key_date",
                      "due",
                      "assignees",
                      "started"
                    ]
                  },
                  "visibility": "groups",
                  "groupIds": [
                    "46139a8e-9621-4f2c-98f3-8975bb8d2589"
                  ],
                  "owner": {
                    "userId": "fde8fad1-9f03-4acb-bafe-91b9a9583a60",
                    "name": "Fixture Admin"
                  },
                  "createdAt": "2026-10-13T00:39:38.376Z",
                  "updatedAt": "2026-10-13T00:39:41.545Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "views:write",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/views/{id}/runs": {
      "get": {
        "operationId": "listViewRuns",
        "summary": "List the runs a view selects",
        "description": "Applies the view's stored query — filters and sort, exactly as the board does — and returns FULL Run resources, paged like `GET /v1/runs` and limited to the key's allowlist. A view that filters by the viewer (`assignee: me`) cannot be resolved for a key: call `GET /v1/runs?assignee=u:<user id>` instead (422). A view sorted by progress is a 422 too (that sort is computed in the app). `updatedSince` orders by `updatedAt` ascending instead of the view's sort.",
        "tags": [
          "Views"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListViewRunsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "c4f32706-55c2-4524-8193-8ca38969a675",
                      "name": "View run one",
                      "status": "active",
                      "priority": "none",
                      "labels": [],
                      "labelDetails": [],
                      "dueAt": null,
                      "keyDate": null,
                      "revision": 1,
                      "updatedAt": "2026-10-13T00:39:49.561Z",
                      "startedAt": "2026-10-13T00:39:49.462Z",
                      "startedBy": "api",
                      "startedByUserId": null,
                      "schedule": null,
                      "scheduledFor": null,
                      "completedAt": null,
                      "deletedAt": null,
                      "workflow": {
                        "id": "165fe8d7-471f-4748-b8ab-a6ee3478cd7d",
                        "name": "Order fulfillment"
                      },
                      "versionId": "36e87c9b-845a-4294-942e-809c38fa6137",
                      "url": "https://app.processcart.com/runs/c4f32706-55c2-4524-8193-8ca38969a675",
                      "tasks": [
                        {
                          "key": "details",
                          "title": "Details",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "review",
                          "title": "Review",
                          "kind": "approval",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [
                            {
                              "kind": "user",
                              "userId": "fde8fad1-9f03-4acb-bafe-91b9a9583a60"
                            }
                          ],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "stop",
                          "title": "Sign-off",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": false,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        },
                        {
                          "key": "wrapup",
                          "title": "Wrap up",
                          "kind": "standard",
                          "section": "Intake",
                          "state": "todo",
                          "visible": true,
                          "locked": true,
                          "dueAt": null,
                          "assignees": [],
                          "completedAt": null,
                          "completedByUserId": null
                        }
                      ],
                      "fields": [
                        {
                          "key": "customer",
                          "label": "Customer",
                          "type": "text",
                          "format": "none",
                          "taskKey": "details",
                          "value": "Ann",
                          "formatted": "Ann",
                          "visible": true
                        },
                        {
                          "key": "order_code",
                          "label": "Order code",
                          "type": "text",
                          "format": "custom",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "memo",
                          "label": "Memo",
                          "type": "textarea",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "quantity",
                          "label": "Quantity",
                          "type": "number",
                          "format": "number",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "amount",
                          "label": "Amount",
                          "type": "number",
                          "format": "currency",
                          "taskKey": "details",
                          "value": 1700,
                          "formatted": "$1,700.00",
                          "visible": true
                        },
                        {
                          "key": "fee",
                          "label": "Fee",
                          "type": "number",
                          "format": "currency",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "rate",
                          "label": "Rate",
                          "type": "number",
                          "format": "percent",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "rate_text",
                          "label": "Rate (text)",
                          "type": "text",
                          "format": "percent",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "ship_date",
                          "label": "Ship date",
                          "type": "date",
                          "format": "date",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "start_time",
                          "label": "Start time",
                          "type": "time",
                          "format": "time",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "gift_wrap",
                          "label": "Gift wrap",
                          "type": "dropdown",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "choices": [
                            "Yes",
                            "No"
                          ]
                        },
                        {
                          "key": "tags",
                          "label": "Tags",
                          "type": "multi_choice",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "choices": [
                            "A",
                            "B",
                            "C"
                          ]
                        },
                        {
                          "key": "agree",
                          "label": "Agree",
                          "type": "checkbox",
                          "format": null,
                          "taskKey": "details",
                          "value": false,
                          "formatted": "No",
                          "visible": true
                        },
                        {
                          "key": "contact_email",
                          "label": "Contact email",
                          "type": "email",
                          "format": "email",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "website",
                          "label": "Website",
                          "type": "url",
                          "format": "url",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "phone",
                          "label": "Phone",
                          "type": "phone",
                          "format": "phone",
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "owner",
                          "label": "Owner",
                          "type": "members",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "steps",
                          "label": "Steps",
                          "type": "subtasks",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true,
                          "items": [
                            {
                              "key": "photos",
                              "label": "Photos"
                            },
                            {
                              "key": "invoice",
                              "label": "Invoice"
                            }
                          ]
                        },
                        {
                          "key": "contract",
                          "label": "Contract",
                          "type": "file",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": true
                        },
                        {
                          "key": "double_amount",
                          "label": "Double amount",
                          "type": "formula",
                          "format": "currency",
                          "taskKey": "details",
                          "value": 3400,
                          "formatted": "$3,400.00",
                          "visible": true
                        },
                        {
                          "key": "source",
                          "label": "Source",
                          "type": "hidden",
                          "format": null,
                          "taskKey": "details",
                          "value": null,
                          "formatted": "",
                          "visible": false
                        }
                      ]
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "runs:read",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhooks",
        "description": "Lists the workspace's webhook endpoints, newest first (no secrets). `updatedSince` turns the list into an incremental sync ordered by `updatedAt` ascending (inclusive). Keys restricted to folders cannot use the webhook operations (403 `not_allowed_for_key`); keys restricted to workflows manage only webhooks whose `workflowIds` is a non-empty subset of their allowlist, and see only deliveries about those workflows (plus test events).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                },
                "example": {
                  "data": [
                    {
                      "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                      "url": "https://hooks.example.com/processcart",
                      "description": "Everything",
                      "events": [
                        "*"
                      ],
                      "workflowIds": null,
                      "filters": {},
                      "enabled": true,
                      "disabledReason": null,
                      "disabledAt": null,
                      "consecutiveFailures": 0,
                      "lastDeliveryAt": null,
                      "createdAt": "2026-10-11T05:28:25.162Z",
                      "createdBy": null,
                      "updatedAt": "2026-10-11T05:28:25.162Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Create a webhook",
        "description": "Subscribes an https endpoint to events (`*` = everything but the opt-in types), optionally narrowed to some workflows and, for `field.updated`, to some field keys. The response carries the Standard Webhooks signing secret ONCE — store it; rotate to get a new one. The URL is checked against the SSRF policy (public https only). Keys restricted to folders cannot use the webhook operations (403 `not_allowed_for_key`); keys restricted to workflows manage only webhooks whose `workflowIds` is a non-empty subset of their allowlist, and see only deliveries about those workflows (plus test events).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookConfig"
              },
              "example": {
                "url": "https://hooks.example.com/processcart",
                "description": "Everything",
                "events": [
                  "*"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                },
                "example": {
                  "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                  "url": "https://hooks.example.com/processcart",
                  "description": "Everything",
                  "events": [
                    "*"
                  ],
                  "workflowIds": null,
                  "filters": {},
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "lastDeliveryAt": null,
                  "createdAt": "2026-10-11T05:28:25.162Z",
                  "createdBy": null,
                  "updatedAt": "2026-10-11T05:28:25.162Z",
                  "secret": "whsec_EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLE"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook",
        "description": "Removes the endpoint with its secret and delivery log. Pending deliveries are dropped; nothing is sent to the endpoint. Audited.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      },
      "get": {
        "operationId": "getWebhook",
        "summary": "Get a webhook",
        "description": "Returns one webhook endpoint with its subscription, filters, enabled state, failure counter and last delivery time — never the secret.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                },
                "example": {
                  "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                  "url": "https://hooks.example.com/processcart",
                  "description": "Everything",
                  "events": [
                    "*"
                  ],
                  "workflowIds": null,
                  "filters": {},
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "lastDeliveryAt": null,
                  "createdAt": "2026-10-11T05:28:25.162Z",
                  "createdBy": null,
                  "updatedAt": "2026-10-11T05:28:25.162Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage"
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update a webhook",
        "description": "Changes any subset of the configuration: `url` (re-checked against the SSRF policy), `description`, `events`, `workflowIds` (`null` clears the filter; omit the key to keep it) and `filters`. `enabled` is not part of the configuration — use the enable and disable operations. Audited.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatch"
              },
              "example": {
                "description": "Renamed",
                "events": [
                  "run.created",
                  "run.completed"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                },
                "example": {
                  "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                  "url": "https://hooks.example.com/processcart",
                  "description": "Renamed",
                  "events": [
                    "run.created",
                    "run.completed"
                  ],
                  "workflowIds": null,
                  "filters": {},
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "lastDeliveryAt": "2026-10-11T05:28:29.806Z",
                  "createdAt": "2026-10-11T05:28:25.162Z",
                  "createdBy": null,
                  "updatedAt": "2026-10-11T05:28:30.342Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List a webhook's deliveries",
        "description": "The endpoint's delivery log, newest first, with each delivery's status, attempt count, last response code and next attempt time. Filter by `status`. Deliveries older than the retention window are gone. A key restricted to workflows sees only deliveries about those workflows (and test events).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "failed",
                "exhausted"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                },
                "example": {
                  "data": [
                    {
                      "id": "eb2383ee-da26-48db-aaa3-42e61dc67272",
                      "webhookId": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                      "eventId": "evt_9d68ebed-af3b-42da-aace-77503bb95cdc",
                      "eventType": "webhook.test",
                      "status": "delivered",
                      "attemptCount": 1,
                      "lastStatusCode": 200,
                      "lastError": null,
                      "lastAttemptAt": "2026-10-11T05:28:26.227Z",
                      "nextAttemptAt": null,
                      "deliveredAt": "2026-10-11T05:28:26.485Z",
                      "createdAt": "2026-10-11T05:28:26.084Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      }
    },
    "/v1/webhooks/{id}/deliveries/{deliveryId}": {
      "get": {
        "operationId": "getWebhookDelivery",
        "summary": "Get a delivery",
        "description": "One delivery with the event envelope that was (or will be) POSTed — useful to inspect a failed delivery or to replay an event by hand.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryWithPayload"
                },
                "example": {
                  "id": "eb2383ee-da26-48db-aaa3-42e61dc67272",
                  "webhookId": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                  "eventId": "evt_9d68ebed-af3b-42da-aace-77503bb95cdc",
                  "eventType": "webhook.test",
                  "status": "delivered",
                  "attemptCount": 1,
                  "lastStatusCode": 200,
                  "lastError": null,
                  "lastAttemptAt": "2026-10-11T05:28:26.227Z",
                  "nextAttemptAt": null,
                  "deliveredAt": "2026-10-11T05:28:26.485Z",
                  "createdAt": "2026-10-11T05:28:26.084Z",
                  "payload": {
                    "id": "evt_9d68ebed-af3b-42da-aace-77503bb95cdc",
                    "org": {
                      "id": "83b4ff3e-2634-423e-89ab-f2c5c07ced1f",
                      "slug": "example-workspace"
                    },
                    "data": {
                      "webhook": {
                        "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa"
                      }
                    },
                    "type": "webhook.test",
                    "actor": {
                      "kind": "api",
                      "name": "Zapier",
                      "keyId": "d5ec9555-1a0c-455a-86e6-c7b18bcabc78"
                    },
                    "timestamp": "2026-10-11T05:28:26.084Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage"
      }
    },
    "/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver": {
      "post": {
        "operationId": "redeliverWebhookDelivery",
        "summary": "Send a delivery again",
        "description": "Queues a finished delivery (delivered, failed or exhausted) again with the same `webhook-id` and sends it right away; the attempt count keeps counting. A delivery still in flight, or a disabled webhook, is refused. Audited.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted; the work completes asynchronously.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookQueuedDelivery"
                },
                "example": {
                  "delivery": {
                    "id": "eb2383ee-da26-48db-aaa3-42e61dc67272",
                    "webhookId": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                    "attempt": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`delivery_not_terminal` — Delivery not finished; `idempotency_in_progress` — Request in progress; `webhook_disabled` — Webhook disabled.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "delivery_not_terminal",
                            "idempotency_in_progress",
                            "webhook_disabled"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/webhooks/{id}/disable": {
      "post": {
        "operationId": "disableWebhook",
        "summary": "Disable a webhook",
        "description": "Stops deliveries (reason `manual`). Events that happen while it is disabled are not queued for it. Disabling a disabled webhook answers 200 unchanged.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                },
                "example": {
                  "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                  "url": "https://hooks.example.com/processcart",
                  "description": "Everything",
                  "events": [
                    "*"
                  ],
                  "workflowIds": null,
                  "filters": {},
                  "enabled": false,
                  "disabledReason": "manual",
                  "disabledAt": "2026-10-11T05:28:28.437Z",
                  "consecutiveFailures": 0,
                  "lastDeliveryAt": "2026-10-11T05:28:27.885Z",
                  "createdAt": "2026-10-11T05:28:25.162Z",
                  "createdBy": null,
                  "updatedAt": "2026-10-11T05:28:28.437Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/webhooks/{id}/enable": {
      "post": {
        "operationId": "enableWebhook",
        "summary": "Enable a webhook",
        "description": "Turns deliveries back on and resets the consecutive-failure counter — also the way to bring back an endpoint that was disabled automatically (after repeated failures or a 410). Enabling an enabled webhook answers 200 unchanged.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                },
                "example": {
                  "id": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                  "url": "https://hooks.example.com/processcart",
                  "description": "Everything",
                  "events": [
                    "*"
                  ],
                  "workflowIds": null,
                  "filters": {},
                  "enabled": true,
                  "disabledReason": null,
                  "disabledAt": null,
                  "consecutiveFailures": 0,
                  "lastDeliveryAt": "2026-10-11T05:28:27.885Z",
                  "createdAt": "2026-10-11T05:28:25.162Z",
                  "createdBy": null,
                  "updatedAt": "2026-10-11T05:28:28.995Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate a webhook's signing secret",
        "description": "Mints a new signing secret and returns it once. Until `previousExpiresAt` every delivery is signed with both secrets (two entries in `webhook-signature`), so the endpoint can switch without missing a beat. Audited.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecret"
                },
                "example": {
                  "secret": "whsec_EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLE",
                  "previousExpiresAt": "2026-10-12T05:28:29.267Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "summary": "Send a test event",
        "description": "Queues a `webhook.test` delivery to this endpoint and sends it right away (the response does not wait for the endpoint). Read the delivery to see the outcome. A disabled webhook is refused.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted; the work completes asynchronously.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookQueuedDelivery"
                },
                "example": {
                  "delivery": {
                    "id": "eb2383ee-da26-48db-aaa3-42e61dc67272",
                    "webhookId": "2b64ebdd-e0ba-4d01-aca7-914b36d905aa",
                    "attempt": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress; `webhook_disabled` — Webhook disabled.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress",
                            "webhook_disabled"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "webhooks:manage",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "List workflows",
        "description": "Lists the workflows the key may see (its allowlist is applied; trashed workflows are absent), by name. Each item is the library header: folder, status, the published version, a task count and whether a public kickoff form is live. `updatedSince` turns the list into an incremental sync ordered by `updatedAt` ascending (inclusive).",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "791e68d6-2bd9-4c47-a7a7-17eeefddd5e0",
                      "name": "Draft only",
                      "description": null,
                      "status": "active",
                      "icon": null,
                      "color": null,
                      "folder": null,
                      "keyDateFieldKey": "ship_date",
                      "kickoffFormEnabled": false,
                      "publishedVersion": null,
                      "taskCount": 4,
                      "createdAt": "2026-10-10T17:43:36.934Z",
                      "updatedAt": "2026-10-10T17:43:39.132Z"
                    },
                    {
                      "id": "ee70a035-0602-43a6-a8bd-959116312fce",
                      "name": "Filed",
                      "description": null,
                      "status": "active",
                      "icon": null,
                      "color": null,
                      "folder": {
                        "id": "bd17f69c-dc2d-4465-81e5-3893b4b95e60",
                        "name": "Sales"
                      },
                      "keyDateFieldKey": "ship_date",
                      "kickoffFormEnabled": false,
                      "publishedVersion": {
                        "id": "fe5cf349-4c95-43b9-abfe-37d375c5c308",
                        "number": 1,
                        "publishedAt": "2026-10-10T17:43:40.650Z"
                      },
                      "taskCount": 4,
                      "createdAt": "2026-10-10T17:43:40.308Z",
                      "updatedAt": "2026-10-10T17:43:40.672Z"
                    }
                  ],
                  "nextCursor": null,
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "workflows:read",
        "x-processcart-allowlist": "list",
        "x-processcart-paginated": true
      },
      "post": {
        "operationId": "createWorkflow",
        "summary": "Create a workflow from a template",
        "description": "Creates a workflow from a portable template (the same JSON `GET /v1/workflows/{id}/template` returns) and publishes it, so it is runnable at once. Group assignments are matched by name (case-insensitive); person assignees never travel. Everything is validated BEFORE anything is written: a template problem or a publish-gate error is a 422 with every message listed and no workflow is created. `publish: false` leaves a draft. A key restricted to certain workflows cannot create one; a key restricted to folders must file the new workflow into one of them (`folderId`).",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowBody"
              },
              "example": {
                "template": {
                  "formatVersion": 1,
                  "engineVersion": 1,
                  "exportedAt": "2026-10-10T17:43:34.523Z",
                  "source": "example-workspace",
                  "workflow": {
                    "name": "Order fulfillment",
                    "keyDateFieldKey": "ship_date",
                    "sections": [
                      {
                        "key": "intake",
                        "title": "Intake",
                        "defaultVisibility": "visible",
                        "tasks": [
                          {
                            "key": "details",
                            "title": "Details",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": false,
                            "kind": "standard",
                            "fields": [
                              {
                                "key": "customer",
                                "type": "text",
                                "label": "Customer",
                                "help": null,
                                "required": true,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "none"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": true,
                                "kickoffPosition": 0
                              },
                              {
                                "key": "order_code",
                                "type": "text",
                                "label": "Order code",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "custom",
                                  "regex": "^[A-Z]{2}-\\d{4}$",
                                  "errorMessage": "Use AB-1234."
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "memo",
                                "type": "textarea",
                                "label": "Memo",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "quantity",
                                "type": "number",
                                "label": "Quantity",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "number",
                                  "decimals": 0,
                                  "thousands": true
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "amount",
                                "type": "number",
                                "label": "Amount",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "currency"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": true,
                                "kickoffPosition": 1
                              },
                              {
                                "key": "fee",
                                "type": "number",
                                "label": "Fee",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "max": 500,
                                  "type": "currency"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "rate",
                                "type": "number",
                                "label": "Rate",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "percent"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "rate_text",
                                "type": "text",
                                "label": "Rate (text)",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "percent"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "ship_date",
                                "type": "date",
                                "label": "Ship date",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "date"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "start_time",
                                "type": "time",
                                "label": "Start time",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "time",
                                  "hour12": true
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "gift_wrap",
                                "type": "dropdown",
                                "label": "Gift wrap",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "choices": [
                                    "Yes",
                                    "No"
                                  ]
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "tags",
                                "type": "multi_choice",
                                "label": "Tags",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "choices": [
                                    "A",
                                    "B",
                                    "C"
                                  ]
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "agree",
                                "type": "checkbox",
                                "label": "Agree",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "contact_email",
                                "type": "email",
                                "label": "Contact email",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "email"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "website",
                                "type": "url",
                                "label": "Website",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "url"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "phone",
                                "type": "phone",
                                "label": "Phone",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "phone"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "owner",
                                "type": "members",
                                "label": "Owner",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "steps",
                                "type": "subtasks",
                                "label": "Steps",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "items": [
                                    {
                                      "key": "photos",
                                      "label": "Photos"
                                    },
                                    {
                                      "key": "invoice",
                                      "label": "Invoice"
                                    }
                                  ],
                                  "allRequired": false
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "contract",
                                "type": "file",
                                "label": "Contract",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "multiple": true
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "double_amount",
                                "type": "formula",
                                "label": "Double amount",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "currency"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": {
                                  "expr": "{{amount}} * 2",
                                  "mode": "spreadsheet"
                                },
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "source",
                                "type": "hidden",
                                "label": "Source",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "hidden",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "note",
                                "type": "display_text",
                                "label": "Note",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": {
                                  "type": "doc",
                                  "content": [
                                    {
                                      "type": "paragraph",
                                      "content": [
                                        {
                                          "text": "Review the details.",
                                          "type": "text"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                "inKickoff": false,
                                "kickoffPosition": null
                              }
                            ]
                          },
                          {
                            "key": "review",
                            "title": "Review",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": false,
                            "kind": "approval",
                            "approvalConfig": {
                              "summaryFieldKeys": [
                                "amount"
                              ],
                              "rejectReopensTaskKeys": [
                                "details"
                              ]
                            },
                            "fields": []
                          },
                          {
                            "key": "stop",
                            "title": "Sign-off",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": true,
                            "kind": "standard",
                            "fields": []
                          },
                          {
                            "key": "wrapup",
                            "title": "Wrap up",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": false,
                            "kind": "standard",
                            "fields": []
                          }
                        ]
                      }
                    ],
                    "rules": []
                  }
                },
                "name": "Zeta intake",
                "description": "From the API."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. `Location` names the new resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWorkflowResponse"
                },
                "example": {
                  "id": "8b8b4bb9-e062-4a5b-ba75-a3564da9e606",
                  "name": "Zeta intake",
                  "description": "From the API.",
                  "status": "active",
                  "icon": null,
                  "color": null,
                  "folder": null,
                  "keyDateFieldKey": "ship_date",
                  "kickoffFormEnabled": false,
                  "publishedVersion": {
                    "id": "2f84d122-4c0f-4be5-910d-43a117e05c4a",
                    "number": 1,
                    "publishedAt": "2026-10-10T17:43:35.785Z"
                  },
                  "taskCount": 4,
                  "createdAt": "2026-10-10T17:43:35.602Z",
                  "updatedAt": "2026-10-10T17:43:35.866Z",
                  "sections": [
                    {
                      "key": "intake",
                      "title": "Intake",
                      "defaultVisibility": "visible",
                      "tasks": [
                        {
                          "key": "details",
                          "title": "Details",
                          "kind": "standard",
                          "isStop": false,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": [
                            {
                              "key": "customer",
                              "type": "text",
                              "label": "Customer",
                              "help": null,
                              "required": true,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "none"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": true,
                              "kickoffPosition": 0,
                              "readOnly": false
                            },
                            {
                              "key": "order_code",
                              "type": "text",
                              "label": "Order code",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "custom",
                                "regex": "^[A-Z]{2}-\\d{4}$",
                                "errorMessage": "Use AB-1234."
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "memo",
                              "type": "textarea",
                              "label": "Memo",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "quantity",
                              "type": "number",
                              "label": "Quantity",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "number",
                                "decimals": 0,
                                "thousands": true
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "amount",
                              "type": "number",
                              "label": "Amount",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "currency"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": true,
                              "kickoffPosition": 1,
                              "readOnly": false
                            },
                            {
                              "key": "fee",
                              "type": "number",
                              "label": "Fee",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "max": 500,
                                "type": "currency"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "rate",
                              "type": "number",
                              "label": "Rate",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "percent"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "rate_text",
                              "type": "text",
                              "label": "Rate (text)",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "percent"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "ship_date",
                              "type": "date",
                              "label": "Ship date",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "date"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "start_time",
                              "type": "time",
                              "label": "Start time",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "time",
                                "hour12": true
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "gift_wrap",
                              "type": "dropdown",
                              "label": "Gift wrap",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "choices": [
                                  "Yes",
                                  "No"
                                ]
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "tags",
                              "type": "multi_choice",
                              "label": "Tags",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "choices": [
                                  "A",
                                  "B",
                                  "C"
                                ]
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "agree",
                              "type": "checkbox",
                              "label": "Agree",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "contact_email",
                              "type": "email",
                              "label": "Contact email",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "email"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "website",
                              "type": "url",
                              "label": "Website",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "url"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "phone",
                              "type": "phone",
                              "label": "Phone",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "phone"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "owner",
                              "type": "members",
                              "label": "Owner",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "steps",
                              "type": "subtasks",
                              "label": "Steps",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "items": [
                                  {
                                    "key": "photos",
                                    "label": "Photos"
                                  },
                                  {
                                    "key": "invoice",
                                    "label": "Invoice"
                                  }
                                ],
                                "allRequired": false
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "contract",
                              "type": "file",
                              "label": "Contract",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "multiple": true
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": true
                            },
                            {
                              "key": "double_amount",
                              "type": "formula",
                              "label": "Double amount",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "currency"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": {
                                "expr": "{{amount}} * 2",
                                "mode": "spreadsheet"
                              },
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": true
                            },
                            {
                              "key": "source",
                              "type": "hidden",
                              "label": "Source",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "hidden",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "note",
                              "type": "display_text",
                              "label": "Note",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": true
                            }
                          ]
                        },
                        {
                          "key": "review",
                          "title": "Review",
                          "kind": "approval",
                          "isStop": false,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": []
                        },
                        {
                          "key": "stop",
                          "title": "Sign-off",
                          "kind": "standard",
                          "isStop": true,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": []
                        },
                        {
                          "key": "wrapup",
                          "title": "Wrap up",
                          "kind": "standard",
                          "isStop": false,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": []
                        }
                      ]
                    }
                  ],
                  "rules": [],
                  "import": {
                    "errors": [],
                    "warnings": [],
                    "counts": {
                      "sections": 1,
                      "tasks": 4,
                      "fields": 22,
                      "rules": 0
                    },
                    "clearedAssignments": 0,
                    "flaggedEmails": []
                  },
                  "publishWarnings": [
                    "\"Source\" (source) has no formula yet."
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "workflows:write",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/workflows/{id}": {
      "get": {
        "operationId": "getWorkflow",
        "summary": "Get a workflow",
        "description": "The workflow's header plus its PUBLISHED version's sections, tasks, fields and rules — enough to know every task key and field key a run will carry. An unpublished workflow answers with `publishedVersion: null` and no sections; a workflow in Trash is a 404.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDetail"
                },
                "example": {
                  "id": "86504e07-177b-45a5-aad7-843ca07111b9",
                  "name": "Order fulfillment",
                  "description": "Every field type.",
                  "status": "active",
                  "icon": null,
                  "color": null,
                  "folder": {
                    "id": "bd17f69c-dc2d-4465-81e5-3893b4b95e60",
                    "name": "Sales"
                  },
                  "keyDateFieldKey": "ship_date",
                  "kickoffFormEnabled": false,
                  "publishedVersion": {
                    "id": "c32e30ba-e3ff-4df8-88f6-cd5a15bd0e8b",
                    "number": 1,
                    "publishedAt": "2026-10-10T17:43:32.943Z"
                  },
                  "taskCount": 4,
                  "createdAt": "2026-10-10T17:43:33.192Z",
                  "updatedAt": "2026-10-10T17:43:33.303Z",
                  "sections": [
                    {
                      "key": "intake",
                      "title": "Intake",
                      "defaultVisibility": "visible",
                      "tasks": [
                        {
                          "key": "details",
                          "title": "Details",
                          "kind": "standard",
                          "isStop": false,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": [
                            {
                              "key": "customer",
                              "type": "text",
                              "label": "Customer",
                              "help": null,
                              "required": true,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "none"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": true,
                              "kickoffPosition": 0,
                              "readOnly": false
                            },
                            {
                              "key": "order_code",
                              "type": "text",
                              "label": "Order code",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "custom",
                                "regex": "^[A-Z]{2}-\\d{4}$",
                                "errorMessage": "Use AB-1234."
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "memo",
                              "type": "textarea",
                              "label": "Memo",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "quantity",
                              "type": "number",
                              "label": "Quantity",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "number",
                                "decimals": 0,
                                "thousands": true
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "amount",
                              "type": "number",
                              "label": "Amount",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "currency"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": true,
                              "kickoffPosition": 1,
                              "readOnly": false
                            },
                            {
                              "key": "fee",
                              "type": "number",
                              "label": "Fee",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "max": 500,
                                "type": "currency"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "rate",
                              "type": "number",
                              "label": "Rate",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "percent"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "rate_text",
                              "type": "text",
                              "label": "Rate (text)",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "percent"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "ship_date",
                              "type": "date",
                              "label": "Ship date",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "date"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "start_time",
                              "type": "time",
                              "label": "Start time",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "time",
                                "hour12": true
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "gift_wrap",
                              "type": "dropdown",
                              "label": "Gift wrap",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "choices": [
                                  "Yes",
                                  "No"
                                ]
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "tags",
                              "type": "multi_choice",
                              "label": "Tags",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "choices": [
                                  "A",
                                  "B",
                                  "C"
                                ]
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "agree",
                              "type": "checkbox",
                              "label": "Agree",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "contact_email",
                              "type": "email",
                              "label": "Contact email",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "email"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "website",
                              "type": "url",
                              "label": "Website",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "url"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "phone",
                              "type": "phone",
                              "label": "Phone",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "phone"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "owner",
                              "type": "members",
                              "label": "Owner",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "steps",
                              "type": "subtasks",
                              "label": "Steps",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "items": [
                                  {
                                    "key": "photos",
                                    "label": "Photos"
                                  },
                                  {
                                    "key": "invoice",
                                    "label": "Invoice"
                                  }
                                ],
                                "allRequired": false
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "contract",
                              "type": "file",
                              "label": "Contract",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": {
                                "multiple": true
                              },
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": true
                            },
                            {
                              "key": "double_amount",
                              "type": "formula",
                              "label": "Double amount",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": {
                                "type": "currency"
                              },
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": {
                                "expr": "{{amount}} * 2",
                                "mode": "spreadsheet"
                              },
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": true
                            },
                            {
                              "key": "source",
                              "type": "hidden",
                              "label": "Source",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "hidden",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": false
                            },
                            {
                              "key": "note",
                              "type": "display_text",
                              "label": "Note",
                              "help": null,
                              "required": false,
                              "defaultVisibility": "visible",
                              "options": null,
                              "formatConfig": null,
                              "validation": null,
                              "defaultValue": null,
                              "onFocusPopulate": null,
                              "formula": null,
                              "inKickoff": false,
                              "kickoffPosition": null,
                              "readOnly": true
                            }
                          ]
                        },
                        {
                          "key": "review",
                          "title": "Review",
                          "kind": "approval",
                          "isStop": false,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": {
                            "assignees": [
                              {
                                "kind": "user",
                                "userId": "b956f9b0-baa5-48f8-8004-9a80daa37d8a"
                              }
                            ]
                          },
                          "guestConfig": null,
                          "fields": []
                        },
                        {
                          "key": "stop",
                          "title": "Sign-off",
                          "kind": "standard",
                          "isStop": true,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": []
                        },
                        {
                          "key": "wrapup",
                          "title": "Wrap up",
                          "kind": "standard",
                          "isStop": false,
                          "defaultVisibility": "visible",
                          "dueRule": null,
                          "assignment": null,
                          "guestConfig": null,
                          "fields": []
                        }
                      ]
                    }
                  ],
                  "rules": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "workflows:read",
        "x-processcart-allowlist": "workflow"
      },
      "patch": {
        "operationId": "updateWorkflow",
        "summary": "Update a workflow's name, description, folder, Key Date field or status",
        "description": "Changes workflow-level settings (never the published tree — that is the builder's job). `keyDateFieldKey` must name a date-typed field of the published version (of the draft while the workflow has never been published) and re-derives every live run's Key Date. `status: \"archived\"` hides the workflow from the Run menu. A key restricted to folders may only move the workflow within those folders.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowBody"
              },
              "example": {
                "name": "Zeta intake (renamed)",
                "status": "archived",
                "folderId": "bd17f69c-dc2d-4465-81e5-3893b4b95e60"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSummary"
                },
                "example": {
                  "id": "8b8b4bb9-e062-4a5b-ba75-a3564da9e606",
                  "name": "Zeta intake (renamed)",
                  "description": null,
                  "status": "archived",
                  "icon": null,
                  "color": null,
                  "folder": {
                    "id": "bd17f69c-dc2d-4465-81e5-3893b4b95e60",
                    "name": "Sales"
                  },
                  "keyDateFieldKey": null,
                  "kickoffFormEnabled": false,
                  "publishedVersion": {
                    "id": "2f84d122-4c0f-4be5-910d-43a117e05c4a",
                    "number": 1,
                    "publishedAt": "2026-10-10T17:43:35.785Z"
                  },
                  "taskCount": 4,
                  "createdAt": "2026-10-10T17:43:35.602Z",
                  "updatedAt": "2026-10-10T17:43:46.881Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key; `read_only_key` — Read-only key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key",
                            "read_only_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`idempotency_in_progress` — Request in progress.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_in_progress"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` — Payload too large.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type` — Unsupported media type.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unsupported_media_type"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused` — Idempotency key reused; `validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "idempotency_key_reused",
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "workflows:write",
        "x-processcart-allowlist": "workflow",
        "x-processcart-idempotency-key": true
      }
    },
    "/v1/workflows/{id}/schema": {
      "get": {
        "operationId": "getWorkflowSchema",
        "summary": "Get the JSON Schema for a workflow's run bodies",
        "description": "Two JSON Schema (2020-12) documents generated from the published version: `start` describes the `POST /v1/runs` body (every writable field, with `required` naming the kickoff fields no rule can hide) and `fields` the `PATCH /v1/runs/{id}/fields` body. Each property carries the field's type and format (`x-processcart-type`, `x-processcart-format`), its choices as `enum`, bounds, and the task and section it belongs to. Hidden fields are writable but never shown. Unpublished workflows have no schema (409).",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWorkflowSchemaResponse"
                },
                "example": {
                  "workflowId": "86504e07-177b-45a5-aad7-843ca07111b9",
                  "versionId": "c32e30ba-e3ff-4df8-88f6-cd5a15bd0e8b",
                  "versionNumber": 1,
                  "start": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "title": "Start a run",
                    "type": "object",
                    "properties": {
                      "workflowId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      },
                      "fields": {
                        "type": "object",
                        "properties": {
                          "customer": {
                            "title": "Customer",
                            "type": "string",
                            "x-processcart-type": "text",
                            "x-processcart-format": "none",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "null (or an empty string) clears the field."
                          },
                          "order_code": {
                            "title": "Order code",
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^[A-Z]{2}-\\d{4}$",
                            "x-processcart-type": "text",
                            "x-processcart-format": "custom",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "Use AB-1234. null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "memo": {
                            "title": "Memo",
                            "type": [
                              "string",
                              "null"
                            ],
                            "x-processcart-type": "textarea",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "quantity": {
                            "title": "Quantity",
                            "type": [
                              "number",
                              "string",
                              "null"
                            ],
                            "x-processcart-type": "number",
                            "x-processcart-format": "number",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "amount": {
                            "title": "Amount",
                            "type": [
                              "number",
                              "string",
                              "null"
                            ],
                            "x-processcart-type": "number",
                            "x-processcart-format": "currency",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "Whole currency units (1700.5 = $1,700.50). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field."
                          },
                          "fee": {
                            "title": "Fee",
                            "type": [
                              "number",
                              "string",
                              "null"
                            ],
                            "maximum": 500,
                            "x-processcart-type": "number",
                            "x-processcart-format": "currency",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "Whole currency units (1700.5 = $1,700.50). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "rate": {
                            "title": "Rate",
                            "type": [
                              "number",
                              "string",
                              "null"
                            ],
                            "x-processcart-type": "number",
                            "x-processcart-format": "percent",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "A fraction: 0.125 means 12.5 % (bounds are fractions too). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "rate_text": {
                            "title": "Rate (text)",
                            "type": [
                              "number",
                              "string",
                              "null"
                            ],
                            "x-processcart-type": "text",
                            "x-processcart-format": "percent",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "A fraction: 0.125 means 12.5 % (bounds are fractions too). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "ship_date": {
                            "title": "Ship date",
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "x-processcart-type": "date",
                            "x-processcart-format": "date",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "Any common date spelling is accepted and normalized to YYYY-MM-DD. null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "start_time": {
                            "title": "Start time",
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^\\d{2}:\\d{2}$",
                            "x-processcart-type": "time",
                            "x-processcart-format": "time",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "\"2:30 PM\" is accepted and normalized to 24-hour HH:mm. null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "gift_wrap": {
                            "title": "Gift wrap",
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "Yes",
                              "No",
                              null
                            ],
                            "x-processcart-type": "dropdown",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "tags": {
                            "title": "Tags",
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string",
                              "enum": [
                                "A",
                                "B",
                                "C"
                              ]
                            },
                            "uniqueItems": true,
                            "x-processcart-type": "multi_choice",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "agree": {
                            "title": "Agree",
                            "type": "boolean",
                            "x-processcart-type": "checkbox",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "false clears; a never-set checkbox reads false. Not a kickoff field; may still be set at start."
                          },
                          "contact_email": {
                            "title": "Contact email",
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "email",
                            "x-processcart-type": "email",
                            "x-processcart-format": "email",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "Lowercased on write. null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "website": {
                            "title": "Website",
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri",
                            "x-processcart-type": "url",
                            "x-processcart-format": "url",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "http(s) only; normalized by the URL parser (a missing scheme is added). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "phone": {
                            "title": "Phone",
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^\\+\\d{8,15}$",
                            "x-processcart-type": "phone",
                            "x-processcart-format": "phone",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "E.164 (US numbers are normalized from any common spelling). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "owner": {
                            "title": "Owner",
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "uniqueItems": true,
                            "x-processcart-type": "members",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "User ids of current members (GET /v1/users). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "steps": {
                            "title": "Steps",
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string",
                              "enum": [
                                "photos",
                                "invoice"
                              ]
                            },
                            "uniqueItems": true,
                            "x-processcart-type": "subtasks",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "Items: photos = Photos; invoice = Invoice. null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          },
                          "source": {
                            "title": "Source",
                            "type": [
                              "string",
                              "number",
                              "boolean",
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "readOnly": false,
                            "x-processcart-type": "hidden",
                            "x-task": "details",
                            "x-section": "intake",
                            "description": "A hidden run variable: not shown in the app, not secret. Writable through the API (no formula computes it). null (or an empty string) clears the field. Not a kickoff field; may still be set at start."
                          }
                        },
                        "additionalProperties": false,
                        "propertyNames": {
                          "pattern": "^[a-z][a-z0-9_]*$",
                          "maxLength": 80
                        },
                        "required": [
                          "customer"
                        ]
                      },
                      "priority": {
                        "type": "string",
                        "enum": [
                          "none",
                          "low",
                          "medium",
                          "high",
                          "urgent"
                        ]
                      },
                      "labels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 50,
                        "description": "Status-label ids from the org's label set."
                      },
                      "dueAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "An ISO 8601 instant, or a YYYY-MM-DD date (end of that day in the org's time zone)."
                      }
                    },
                    "required": [
                      "workflowId",
                      "name",
                      "fields"
                    ],
                    "additionalProperties": false
                  },
                  "fields": {
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "title": "Set field values",
                    "type": "object",
                    "properties": {
                      "customer": {
                        "title": "Customer",
                        "type": [
                          "string",
                          "null"
                        ],
                        "x-processcart-type": "text",
                        "x-processcart-format": "none",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "null (or an empty string) clears the field."
                      },
                      "order_code": {
                        "title": "Order code",
                        "type": [
                          "string",
                          "null"
                        ],
                        "pattern": "^[A-Z]{2}-\\d{4}$",
                        "x-processcart-type": "text",
                        "x-processcart-format": "custom",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "Use AB-1234. null (or an empty string) clears the field."
                      },
                      "memo": {
                        "title": "Memo",
                        "type": [
                          "string",
                          "null"
                        ],
                        "x-processcart-type": "textarea",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "null (or an empty string) clears the field."
                      },
                      "quantity": {
                        "title": "Quantity",
                        "type": [
                          "number",
                          "string",
                          "null"
                        ],
                        "x-processcart-type": "number",
                        "x-processcart-format": "number",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field."
                      },
                      "amount": {
                        "title": "Amount",
                        "type": [
                          "number",
                          "string",
                          "null"
                        ],
                        "x-processcart-type": "number",
                        "x-processcart-format": "currency",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "Whole currency units (1700.5 = $1,700.50). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field."
                      },
                      "fee": {
                        "title": "Fee",
                        "type": [
                          "number",
                          "string",
                          "null"
                        ],
                        "maximum": 500,
                        "x-processcart-type": "number",
                        "x-processcart-format": "currency",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "Whole currency units (1700.5 = $1,700.50). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field."
                      },
                      "rate": {
                        "title": "Rate",
                        "type": [
                          "number",
                          "string",
                          "null"
                        ],
                        "x-processcart-type": "number",
                        "x-processcart-format": "percent",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "A fraction: 0.125 means 12.5 % (bounds are fractions too). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field."
                      },
                      "rate_text": {
                        "title": "Rate (text)",
                        "type": [
                          "number",
                          "string",
                          "null"
                        ],
                        "x-processcart-type": "text",
                        "x-processcart-format": "percent",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "A fraction: 0.125 means 12.5 % (bounds are fractions too). A JSON number is the canonical value; a string is parsed by the field's format (a comma is a thousands separator). null (or an empty string) clears the field."
                      },
                      "ship_date": {
                        "title": "Ship date",
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "x-processcart-type": "date",
                        "x-processcart-format": "date",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "Any common date spelling is accepted and normalized to YYYY-MM-DD. null (or an empty string) clears the field."
                      },
                      "start_time": {
                        "title": "Start time",
                        "type": [
                          "string",
                          "null"
                        ],
                        "pattern": "^\\d{2}:\\d{2}$",
                        "x-processcart-type": "time",
                        "x-processcart-format": "time",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "\"2:30 PM\" is accepted and normalized to 24-hour HH:mm. null (or an empty string) clears the field."
                      },
                      "gift_wrap": {
                        "title": "Gift wrap",
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "Yes",
                          "No",
                          null
                        ],
                        "x-processcart-type": "dropdown",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "null (or an empty string) clears the field."
                      },
                      "tags": {
                        "title": "Tags",
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string",
                          "enum": [
                            "A",
                            "B",
                            "C"
                          ]
                        },
                        "uniqueItems": true,
                        "x-processcart-type": "multi_choice",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "null (or an empty string) clears the field."
                      },
                      "agree": {
                        "title": "Agree",
                        "type": "boolean",
                        "x-processcart-type": "checkbox",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "false clears; a never-set checkbox reads false."
                      },
                      "contact_email": {
                        "title": "Contact email",
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "email",
                        "x-processcart-type": "email",
                        "x-processcart-format": "email",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "Lowercased on write. null (or an empty string) clears the field."
                      },
                      "website": {
                        "title": "Website",
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "uri",
                        "x-processcart-type": "url",
                        "x-processcart-format": "url",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "http(s) only; normalized by the URL parser (a missing scheme is added). null (or an empty string) clears the field."
                      },
                      "phone": {
                        "title": "Phone",
                        "type": [
                          "string",
                          "null"
                        ],
                        "pattern": "^\\+\\d{8,15}$",
                        "x-processcart-type": "phone",
                        "x-processcart-format": "phone",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "E.164 (US numbers are normalized from any common spelling). null (or an empty string) clears the field."
                      },
                      "owner": {
                        "title": "Owner",
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "uniqueItems": true,
                        "x-processcart-type": "members",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "User ids of current members (GET /v1/users). null (or an empty string) clears the field."
                      },
                      "steps": {
                        "title": "Steps",
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string",
                          "enum": [
                            "photos",
                            "invoice"
                          ]
                        },
                        "uniqueItems": true,
                        "x-processcart-type": "subtasks",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "Items: photos = Photos; invoice = Invoice. null (or an empty string) clears the field."
                      },
                      "source": {
                        "title": "Source",
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string"
                        },
                        "readOnly": false,
                        "x-processcart-type": "hidden",
                        "x-task": "details",
                        "x-section": "intake",
                        "description": "A hidden run variable: not shown in the app, not secret. Writable through the API (no formula computes it). null (or an empty string) clears the field."
                      }
                    },
                    "additionalProperties": false,
                    "propertyNames": {
                      "pattern": "^[a-z][a-z0-9_]*$",
                      "maxLength": 80
                    },
                    "minProperties": 1,
                    "maxProperties": 200
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`workflow_not_published` — Workflow not published.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "workflow_not_published"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "workflows:read",
        "x-processcart-allowlist": "workflow"
      }
    },
    "/v1/workflows/{id}/template": {
      "get": {
        "operationId": "getWorkflowTemplate",
        "summary": "Export a workflow as a portable template",
        "description": "The published version as a portable template JSON: sections, tasks, fields, rules, due rules and assignments by group / role name — no ids, no people, no workspace settings. Feed it to `POST /v1/workflows` here or in another workspace, or keep it in version control. `exportedAt` is stamped now; `source` is the workspace slug.",
        "tags": [
          "Workflows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplate"
                },
                "example": {
                  "formatVersion": 1,
                  "engineVersion": 1,
                  "exportedAt": "2026-10-10T17:43:34.949Z",
                  "source": "example-workspace",
                  "workflow": {
                    "name": "Order fulfillment",
                    "keyDateFieldKey": "ship_date",
                    "sections": [
                      {
                        "key": "intake",
                        "title": "Intake",
                        "defaultVisibility": "visible",
                        "tasks": [
                          {
                            "key": "details",
                            "title": "Details",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": false,
                            "kind": "standard",
                            "fields": [
                              {
                                "key": "customer",
                                "type": "text",
                                "label": "Customer",
                                "help": null,
                                "required": true,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "none"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": true,
                                "kickoffPosition": 0
                              },
                              {
                                "key": "order_code",
                                "type": "text",
                                "label": "Order code",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "custom",
                                  "regex": "^[A-Z]{2}-\\d{4}$",
                                  "errorMessage": "Use AB-1234."
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "memo",
                                "type": "textarea",
                                "label": "Memo",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "quantity",
                                "type": "number",
                                "label": "Quantity",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "number",
                                  "decimals": 0,
                                  "thousands": true
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "amount",
                                "type": "number",
                                "label": "Amount",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "currency"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": true,
                                "kickoffPosition": 1
                              },
                              {
                                "key": "fee",
                                "type": "number",
                                "label": "Fee",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "max": 500,
                                  "type": "currency"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "rate",
                                "type": "number",
                                "label": "Rate",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "percent"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "rate_text",
                                "type": "text",
                                "label": "Rate (text)",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "percent"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "ship_date",
                                "type": "date",
                                "label": "Ship date",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "date"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "start_time",
                                "type": "time",
                                "label": "Start time",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "time",
                                  "hour12": true
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "gift_wrap",
                                "type": "dropdown",
                                "label": "Gift wrap",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "choices": [
                                    "Yes",
                                    "No"
                                  ]
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "tags",
                                "type": "multi_choice",
                                "label": "Tags",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "choices": [
                                    "A",
                                    "B",
                                    "C"
                                  ]
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "agree",
                                "type": "checkbox",
                                "label": "Agree",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "contact_email",
                                "type": "email",
                                "label": "Contact email",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "email"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "website",
                                "type": "url",
                                "label": "Website",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "url"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "phone",
                                "type": "phone",
                                "label": "Phone",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "phone"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "owner",
                                "type": "members",
                                "label": "Owner",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "steps",
                                "type": "subtasks",
                                "label": "Steps",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "items": [
                                    {
                                      "key": "photos",
                                      "label": "Photos"
                                    },
                                    {
                                      "key": "invoice",
                                      "label": "Invoice"
                                    }
                                  ],
                                  "allRequired": false
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "contract",
                                "type": "file",
                                "label": "Contract",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": {
                                  "multiple": true
                                },
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "double_amount",
                                "type": "formula",
                                "label": "Double amount",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": {
                                  "type": "currency"
                                },
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": {
                                  "expr": "{{amount}} * 2",
                                  "mode": "spreadsheet"
                                },
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "source",
                                "type": "hidden",
                                "label": "Source",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "hidden",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": null,
                                "inKickoff": false,
                                "kickoffPosition": null
                              },
                              {
                                "key": "note",
                                "type": "display_text",
                                "label": "Note",
                                "help": null,
                                "required": false,
                                "defaultVisibility": "visible",
                                "options": null,
                                "formatConfig": null,
                                "validation": null,
                                "defaultValue": null,
                                "onFocusPopulate": null,
                                "formula": null,
                                "content": {
                                  "type": "doc",
                                  "content": [
                                    {
                                      "type": "paragraph",
                                      "content": [
                                        {
                                          "text": "Review the details.",
                                          "type": "text"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                "inKickoff": false,
                                "kickoffPosition": null
                              }
                            ]
                          },
                          {
                            "key": "review",
                            "title": "Review",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": false,
                            "kind": "approval",
                            "approvalConfig": {
                              "summaryFieldKeys": [
                                "amount"
                              ],
                              "rejectReopensTaskKeys": [
                                "details"
                              ]
                            },
                            "fields": []
                          },
                          {
                            "key": "stop",
                            "title": "Sign-off",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": true,
                            "kind": "standard",
                            "fields": []
                          },
                          {
                            "key": "wrapup",
                            "title": "Wrap up",
                            "instructions": null,
                            "defaultVisibility": "visible",
                            "isStop": false,
                            "kind": "standard",
                            "fields": []
                          }
                        ]
                      }
                    ],
                    "rules": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` — Insufficient scope; `not_allowed_for_key` — Not allowed for this key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "insufficient_scope",
                            "not_allowed_for_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`not_found` — Not found.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "409": {
            "description": "`workflow_not_published` — Workflow not published.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "workflow_not_published"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed` — Validation failed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "validation_failed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` — Too many requests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`internal_error` — Internal error.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "internal_error"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "`unavailable` — Service unavailable.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Problem"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "x-processcart-scope": "workflows:read",
        "x-processcart-allowlist": "workflow"
      }
    }
  },
  "webhooks": {
    "run.created": {
      "post": {
        "operationId": "onRunCreated",
        "summary": "run.created",
        "description": "A run was started (by a member, the API, a schedule or a public kickoff form). `data`: `run`; `kickoffLinkId` when a public form started it.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "run.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRunCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "run.updated": {
      "post": {
        "operationId": "onRunUpdated",
        "summary": "run.updated",
        "description": "A run's name, priority, labels or due date changed. `data`: `run` + `changes` keyed by attribute (`name`, `priority`, `labels`, `dueAt`), each `{ from, to }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "run.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRunUpdated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "run.status_changed": {
      "post": {
        "operationId": "onRunStatusChanged",
        "summary": "run.status_changed",
        "description": "A run's status changed (active / completed / on_hold / archived), by hand or automatically. `data`: `run` + `changes.status { from, to }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "run.status_changed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRunStatusChanged"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "run.completed": {
      "post": {
        "operationId": "onRunCompleted",
        "summary": "run.completed",
        "description": "Every task is done, or the run was marked completed by hand. `data`: `run`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "run.completed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRunCompleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "run.trashed": {
      "post": {
        "operationId": "onRunTrashed",
        "summary": "run.trashed",
        "description": "A run moved to Trash — on its own, or with its workflow. `data`: `run` (the lite header `{ id, name, revision, workflow, deletedAt }` when a workflow trash cascaded) + `withWorkflow`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "run.trashed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRunTrashed"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "run.restored": {
      "post": {
        "operationId": "onRunRestored",
        "summary": "run.restored",
        "description": "A run came back from Trash — on its own, or with its workflow. `data`: `run` (lite when a workflow restore cascaded) + `withWorkflow`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "run.restored"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRunRestored"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "task.ready": {
      "post": {
        "operationId": "onTaskReady",
        "summary": "task.ready",
        "description": "A task became actionable: visible, unlocked and not done. `data`: `run` + `task`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "task.ready"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventTaskReady"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "task.assigned": {
      "post": {
        "operationId": "onTaskAssigned",
        "summary": "task.assigned",
        "description": "A task's assignees were resolved or changed, or the task became actionable for them. `data`: `run` + `task` + `assignees`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "task.assigned"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventTaskAssigned"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "task.completed": {
      "post": {
        "operationId": "onTaskCompleted",
        "summary": "task.completed",
        "description": "A task was completed. `data`: `run` + `task`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "task.completed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventTaskCompleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "task.uncompleted": {
      "post": {
        "operationId": "onTaskUncompleted",
        "summary": "task.uncompleted",
        "description": "A done task was reopened, by hand or by a rejected approval. `data`: `run` + `task`; `byApproval` names the approval task whose rejection reopened it.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "task.uncompleted"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventTaskUncompleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "field.updated": {
      "post": {
        "operationId": "onFieldUpdated",
        "summary": "field.updated",
        "description": "A field value changed (opt-in: excluded from `*`; `filters.fieldKeys` narrows it). `data`: `run` + `field` (the resource's field entry: key, label, type, format, value, formatted, …) + `field.previous`. Opt-in: not included in a `*` subscription.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "field.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventFieldUpdated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "approval.requested": {
      "post": {
        "operationId": "onApprovalRequested",
        "summary": "approval.requested",
        "description": "An approval task became actionable for its approvers (again when a decided approval is voided by a reviewed-value change). `data`: `run` + `task`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "approval.requested"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventApprovalRequested"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "approval.decided": {
      "post": {
        "operationId": "onApprovalDecided",
        "summary": "approval.decided",
        "description": "An approval was approved or rejected. `data`: `run` + `task` + `approval { id, decision, comment, decidedBy, decidedByEmail, decidedAt }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "approval.decided"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventApprovalDecided"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "comment.created": {
      "post": {
        "operationId": "onCommentCreated",
        "summary": "comment.created",
        "description": "A comment was posted on a task. `data`: `run` + `task` + `comment { id, authorId, text, mentions }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "comment.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventCommentCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "attachment.created": {
      "post": {
        "operationId": "onAttachmentCreated",
        "summary": "attachment.created",
        "description": "A file finished uploading to a field or a comment. `data`: `run` + `task` + `attachment { id, filename, size, mime, fieldKey, taskKey, commentId }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "attachment.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventAttachmentCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "guest.task_viewed": {
      "post": {
        "operationId": "onGuestTaskViewed",
        "summary": "guest.task_viewed",
        "description": "A guest first opened their task link (opt-in: excluded from `*`). `data`: `run` + `task` + `guest { email, linkId }`. Opt-in: not included in a `*` subscription.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "guest.task_viewed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventGuestTaskViewed"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "guest.task_completed": {
      "post": {
        "operationId": "onGuestTaskCompleted",
        "summary": "guest.task_completed",
        "description": "A guest submitted their task (fires beside `task.completed`, whose actor is the guest). `data`: `run` + `task` + `guest { email, linkId }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "guest.task_completed"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventGuestTaskCompleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "workflow.published": {
      "post": {
        "operationId": "onWorkflowPublished",
        "summary": "workflow.published",
        "description": "A workflow version was published. `data`: `workflow { id, name }` + `version { id, number }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "workflow.published"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventWorkflowPublished"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "schedule.run_created": {
      "post": {
        "operationId": "onScheduleRunCreated",
        "summary": "schedule.run_created",
        "description": "A recurrence schedule started a run. `data`: `run` + `schedule { id, name }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "schedule.run_created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventScheduleRunCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "schedule.created": {
      "post": {
        "operationId": "onScheduleCreated",
        "summary": "schedule.created",
        "description": "A recurrence schedule was created. `data`: `schedule` — the Schedule resource, as `GET /v1/schedules/{id}` returns it.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "schedule.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventScheduleCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "schedule.updated": {
      "post": {
        "operationId": "onScheduleUpdated",
        "summary": "schedule.updated",
        "description": "A schedule changed: its settings were edited, it was paused or resumed, or the system paused it. `data`: `schedule` + `change`: `settings`, `paused`, `resumed` or `auto_disabled` (`auto_disabled`: the system paused it, and `schedule.disabledReason` says why).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "schedule.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventScheduleUpdated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "schedule.deleted": {
      "post": {
        "operationId": "onScheduleDeleted",
        "summary": "schedule.deleted",
        "description": "A schedule was deleted. `data`: `schedule` — its last state.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "schedule.deleted"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventScheduleDeleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "rule.created": {
      "post": {
        "operationId": "onRuleCreated",
        "summary": "rule.created",
        "description": "An automation rule was created. `data`: `rule` — the AutomationRule resource, as `GET /v1/automation-rules/{id}` returns it.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "rule.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRuleCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "rule.updated": {
      "post": {
        "operationId": "onRuleUpdated",
        "summary": "rule.updated",
        "description": "An automation rule changed: its settings were edited, it was turned on or off, or the system turned it off after repeated failures. `data`: `rule` + `change`: `settings`, `enabled`, `disabled` or `auto_disabled` (`auto_disabled`: the system turned it off, and `rule.disabledReason` says why).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "rule.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRuleUpdated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "rule.deleted": {
      "post": {
        "operationId": "onRuleDeleted",
        "summary": "rule.deleted",
        "description": "An automation rule was deleted. `data`: `rule` — its last state.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "rule.deleted"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventRuleDeleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "webhook.created": {
      "post": {
        "operationId": "onWebhookCreated",
        "summary": "webhook.created",
        "description": "A webhook endpoint was created. `data`: `webhook` — the Webhook resource, as `GET /v1/webhooks/{id}` returns it (never the signing secret).",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "webhook.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventWebhookCreated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "webhook.updated": {
      "post": {
        "operationId": "onWebhookUpdated",
        "summary": "webhook.updated",
        "description": "A webhook endpoint changed: its settings were edited, it was enabled or disabled, its secret was rotated, or the system disabled it. `data`: `webhook` + `change`: `settings`, `enabled`, `disabled`, `secret_rotated` or `auto_disabled` (`auto_disabled`: the system disabled it, and `webhook.disabledReason` says why). Never the secret.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "webhook.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventWebhookUpdated"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "webhook.deleted": {
      "post": {
        "operationId": "onWebhookDeleted",
        "summary": "webhook.deleted",
        "description": "A webhook endpoint was deleted. `data`: `webhook` — its last state.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "webhook.deleted"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventWebhookDeleted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "operationId": "onWebhookTest",
        "summary": "webhook.test",
        "description": "A test event sent from Settings or `POST /v1/webhooks/{id}/test`. `data`: `webhook { id }`.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The event id (`evt_<uuid>`) — stable across retries and redeliveries; dedupe on it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed. Reject anything more than 300 seconds from now.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "Standard Webhooks: `v1,<base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<raw body>` keyed with the secret's bytes (base64-decode after stripping `whsec_`). Space-separated when two secrets are live after a rotation; accept any one that matches. Compare in constant time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-processcart-event",
            "in": "header",
            "required": true,
            "description": "The event type (also `type` in the body).",
            "schema": {
              "type": "string",
              "enum": [
                "run.created",
                "run.updated",
                "run.status_changed",
                "run.completed",
                "run.trashed",
                "run.restored",
                "task.ready",
                "task.assigned",
                "task.completed",
                "task.uncompleted",
                "field.updated",
                "approval.requested",
                "approval.decided",
                "comment.created",
                "attachment.created",
                "guest.task_viewed",
                "guest.task_completed",
                "workflow.published",
                "schedule.run_created",
                "schedule.created",
                "schedule.updated",
                "schedule.deleted",
                "rule.created",
                "rule.updated",
                "rule.deleted",
                "webhook.created",
                "webhook.updated",
                "webhook.deleted",
                "webhook.test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EventEnvelope"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "webhook.test"
                      },
                      "data": {
                        "$ref": "#/components/schemas/EventWebhookTest"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Acknowledged. Answer any 2xx within 10 seconds; anything else (or a timeout) is retried 1 / 5 / 15 / 30 / 60 minutes later (6 attempts in all), then the delivery is marked exhausted. A 410, or 5 consecutive exhausted deliveries, disables the endpoint."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "`Authorization: Bearer pc_live_…` — the canonical form."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The same key, for tools that can only set a custom header. Sending both with different values is a 401."
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "On every response. Echoes the request's `X-Request-Id` when it matches `^[\\x21-\\x7e]{1,128}$`, else a server-minted `req_<uuid>`. Quote it to support.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Limit": {
        "description": "The key's limit per window (600). On every authenticated response.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Policy": {
        "description": "`600;w=60` (IETF RateLimit header fields).",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying (429, and 409 idempotency_in_progress).",
        "schema": {
          "type": "integer"
        }
      },
      "Idempotent-Replayed": {
        "description": "`true` when the response was replayed from a stored result for the same `Idempotency-Key`.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      },
      "Allow": {
        "description": "The methods this path supports (on a 405).",
        "schema": {
          "type": "string"
        }
      },
      "WWW-Authenticate": {
        "description": "`Bearer realm=\"processcart\"` (on a 401).",
        "schema": {
          "type": "string"
        }
      },
      "Location": {
        "description": "The URL of the resource that now exists (on a 201).",
        "schema": {
          "type": "string",
          "format": "uri-reference"
        }
      },
      "Content-Disposition": {
        "description": "`attachment; filename=\"…\"` on a file download / CSV export.",
        "schema": {
          "type": "string"
        }
      },
      "Deprecation": {
        "description": "RFC 9745: present on a deprecated operation, with the date it was deprecated.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "Sunset": {
        "description": "RFC 8594: when a deprecated operation stops answering (at least 90 days after `Deprecation`).",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Makes the request safe to retry: a second request with the same key and a byte-identical body (and the same `Expected-Revision`) replays the stored response (`Idempotent-Replayed: true`); a different body with the same key is refused (422 `idempotency_key_reused`) and no second resource is created. Keys are stored per workspace for 24 hours and replayed only to the API key that made the request (or the key one rotation away from it); another API key sending the same value is refused (422 `idempotency_key_reused`), so prefix keys per integration. 409, 429 and 5xx answers are never stored.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "pattern": "^[\\x21-\\x7e]+$"
        }
      },
      "ExpectedRevision": {
        "name": "Expected-Revision",
        "in": "header",
        "required": false,
        "description": "Optimistic concurrency: the run's `revision` you last saw (from any Run body) — a bare integer (`7`) or the same in double quotes (`\"7\"`); `*` or no header = no precondition. Checked INSIDE the run lock — a stale value is refused with 409 `revision_mismatch` whose body names `currentRevision`. A list or any other value is a 422. A successful write answers its new `revision` in the body. The API sends no `ETag` and refuses `If-Match` (422): CDN layers evaluate `If-Match` against the response and turn a successful write into a 412.",
        "schema": {
          "type": "string",
          "pattern": "^(\\*|\"\\d{1,15}\"|\\d{1,15})$"
        }
      },
      "cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "The `nextCursor` of the previous page. Opaque, and bound to the query that produced it — a cursor from a different filter or sort is a 422.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Page size, default 50, at most 200 (100 on /runs). Above the maximum is a 422, never clamped.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        }
      },
      "updatedSince": {
        "name": "updatedSince",
        "in": "query",
        "required": false,
        "description": "Incremental sync: only items whose `updatedAt` is at or after this instant (inclusive), ordered by `updatedAt` ascending; an explicit conflicting `sort` / `order` is a 422. Overlap by a minute and dedupe: a Run by `(id, revision)`, any other item (workflow, view, webhook, schedule, automation rule) by `(id, updatedAt)` — a higher `revision` or a later `updatedAt` replaces the copy you hold, an equal one is unchanged.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "schemas": {
      "Uuid": {
        "type": "string",
        "format": "uuid"
      },
      "Instant": {
        "type": "string",
        "format": "date-time"
      },
      "CalendarDate": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "Key": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]*$",
        "maxLength": 80
      },
      "FieldKey": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]*$",
        "maxLength": 80
      },
      "Cursor": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      },
      "ProblemFieldError": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "code",
          "message"
        ]
      },
      "ApiErrorCode": {
        "type": "string",
        "enum": [
          "unauthorized",
          "invalid_api_key",
          "key_revoked",
          "insufficient_scope",
          "read_only_key",
          "not_allowed_for_key",
          "rate_limited",
          "idempotency_key_reused",
          "idempotency_in_progress",
          "validation_failed",
          "unsupported_media_type",
          "payload_too_large",
          "method_not_allowed",
          "not_found",
          "revision_mismatch",
          "run_archived",
          "run_trashed",
          "task_locked",
          "task_hidden",
          "task_completed",
          "field_not_writable",
          "required_fields_unsatisfied",
          "workflow_not_published",
          "workflow_not_runnable",
          "approver_only",
          "workflow_trashed",
          "wrong_task_kind",
          "task_not_configured",
          "upload_incomplete",
          "webhook_disabled",
          "delivery_not_terminal",
          "schedule_ended",
          "internal_error",
          "unavailable"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "unauthorized",
              "invalid_api_key",
              "key_revoked",
              "insufficient_scope",
              "read_only_key",
              "not_allowed_for_key",
              "rate_limited",
              "idempotency_key_reused",
              "idempotency_in_progress",
              "validation_failed",
              "unsupported_media_type",
              "payload_too_large",
              "method_not_allowed",
              "not_found",
              "revision_mismatch",
              "run_archived",
              "run_trashed",
              "task_locked",
              "task_hidden",
              "task_completed",
              "field_not_writable",
              "required_fields_unsatisfied",
              "workflow_not_published",
              "workflow_not_runnable",
              "approver_only",
              "workflow_trashed",
              "wrong_task_kind",
              "task_not_configured",
              "upload_incomplete",
              "webhook_disabled",
              "delivery_not_terminal",
              "schedule_ended",
              "internal_error",
              "unavailable"
            ],
            "x-processcart-open-enum": true,
            "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
          },
          "requestId": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "field",
                "code",
                "message"
              ]
            }
          },
          "currentRevision": {
            "type": "integer",
            "minimum": 0,
            "description": "Only on a 409 `revision_mismatch`: the run's current revision. Read the run again, merge, and retry with `Expected-Revision: <currentRevision>`."
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "requestId"
        ]
      },
      "ApiScope": {
        "type": "string",
        "enum": [
          "runs:read",
          "runs:write",
          "approvals:decide",
          "workflows:read",
          "workflows:write",
          "views:read",
          "views:write",
          "webhooks:manage",
          "schedules:manage",
          "rules:manage",
          "users:read",
          "*"
        ]
      },
      "RunStatus": {
        "type": "string",
        "enum": [
          "active",
          "completed",
          "on_hold",
          "archived"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "RunPriority": {
        "type": "string",
        "enum": [
          "none",
          "low",
          "medium",
          "high",
          "urgent"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "RunTaskState": {
        "type": "string",
        "enum": [
          "todo",
          "done",
          "rejected_redo"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "RunStartedSource": {
        "type": "string",
        "enum": [
          "manual",
          "schedule",
          "api",
          "kickoff"
        ]
      },
      "TaskKind": {
        "type": "string",
        "enum": [
          "standard",
          "approval",
          "email"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "FieldType": {
        "type": "string",
        "enum": [
          "text",
          "textarea",
          "number",
          "date",
          "time",
          "dropdown",
          "multi_choice",
          "checkbox",
          "file",
          "email",
          "url",
          "phone",
          "members",
          "hidden",
          "formula",
          "subtasks",
          "display_text"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "FormatType": {
        "type": "string",
        "enum": [
          "none",
          "number",
          "currency",
          "percent",
          "date",
          "time",
          "phone",
          "email",
          "url",
          "custom"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "CanonicalValue": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ]
      },
      "ResolvedAssignee": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "user"
              },
              "userId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "kind",
              "userId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "group"
              },
              "groupId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "kind",
              "groupId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "role"
              },
              "role": {
                "type": "string",
                "enum": [
                  "member",
                  "builder",
                  "admin"
                ]
              }
            },
            "required": [
              "kind",
              "role"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "guest"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            },
            "required": [
              "kind",
              "email"
            ]
          }
        ]
      },
      "ActivityActor": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "user"
              },
              "userId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "kind",
              "userId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "guest"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            },
            "required": [
              "kind",
              "email"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "system"
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "api"
              },
              "keyId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "keyId",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "schedule"
              },
              "scheduleId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "scheduleId",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "rule"
              },
              "ruleId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "ruleId",
              "name"
            ]
          }
        ]
      },
      "Actor": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "user"
              },
              "userId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "kind",
              "userId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "guest"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            },
            "required": [
              "kind",
              "email"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "system"
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "api"
              },
              "keyId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "keyId",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "schedule"
              },
              "scheduleId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "scheduleId",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "rule"
              },
              "ruleId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "ruleId",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "unknown"
              }
            },
            "required": [
              "kind"
            ]
          }
        ]
      },
      "EventActor": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ActivityActor"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            }
          }
        ]
      },
      "LabelDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "color"
        ]
      },
      "RunTask": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TaskKind"
          },
          "section": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/RunTaskState"
          },
          "visible": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          },
          "dueAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolvedAssignee"
            }
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "completedByUserId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "key",
          "title",
          "kind",
          "section",
          "state",
          "visible",
          "locked",
          "dueAt",
          "assignees",
          "completedAt",
          "completedByUserId"
        ]
      },
      "RunField": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/FieldType"
          },
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FormatType"
              },
              {
                "type": "null"
              }
            ]
          },
          "taskKey": {
            "$ref": "#/components/schemas/Key"
          },
          "value": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CanonicalValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted": {
            "type": "string"
          },
          "visible": {
            "type": "boolean"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "label"
              ]
            }
          },
          "validationError": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "type",
          "format",
          "taskKey",
          "value",
          "formatted",
          "visible"
        ]
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "priority": {
            "$ref": "#/components/schemas/RunPriority"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "labelDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelDetail"
            }
          },
          "dueAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "keyDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CalendarDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "startedAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "startedBy": {
            "$ref": "#/components/schemas/RunStartedSource"
          },
          "startedByUserId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduledFor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "deletedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "workflow": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "versionId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunTask"
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunField"
            }
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "priority",
          "labels",
          "labelDetails",
          "dueAt",
          "keyDate",
          "revision",
          "updatedAt",
          "startedAt",
          "startedBy",
          "startedByUserId",
          "schedule",
          "scheduledFor",
          "completedAt",
          "deletedAt",
          "workflow",
          "versionId",
          "url",
          "tasks",
          "fields"
        ]
      },
      "RunLite": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "workflow": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "deletedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "revision",
          "workflow",
          "deletedAt"
        ]
      },
      "FieldWriteValue": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "type": "null"
          }
        ]
      },
      "FieldsWrite": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/FieldWriteValue"
        },
        "propertyNames": {
          "pattern": "^[a-z][a-z0-9_]*$",
          "maxLength": 80
        }
      },
      "RunStart": {
        "type": "object",
        "properties": {
          "workflowId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "fields": {
            "$ref": "#/components/schemas/FieldsWrite"
          },
          "priority": {
            "$ref": "#/components/schemas/RunPriority"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "maxItems": 50
          },
          "dueAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "workflowId",
          "name"
        ],
        "additionalProperties": false
      },
      "RunPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "priority": {
            "$ref": "#/components/schemas/RunPriority"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "maxItems": 50
          },
          "dueAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          }
        },
        "additionalProperties": false
      },
      "TaskDecision": {
        "type": "object",
        "properties": {
          "comment": {
            "type": "string",
            "maxLength": 5000
          }
        },
        "additionalProperties": false
      },
      "RunList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Run"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "RunTaskList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunTask"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "Me": {
        "type": "object",
        "properties": {
          "org": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              },
              "sandbox": {
                "type": "boolean"
              },
              "labels": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LabelDetail"
                },
                "description": "The workspace's status labels, in its own order: the ids a run's `labels`, the runs filter `labels=`, a view's `query.labels` and automation rules take. Empty when the workspace defines none."
              }
            },
            "required": [
              "id",
              "name",
              "slug",
              "timezone",
              "sandbox",
              "labels"
            ]
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "readOnly": {
                "type": "boolean"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiScope"
                }
              },
              "createdAt": {
                "$ref": "#/components/schemas/Instant"
              },
              "lastUsedAt": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Instant"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "name",
              "prefix",
              "readOnly",
              "scopes",
              "createdAt",
              "lastUsedAt"
            ]
          },
          "rateLimit": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer"
              },
              "windowSeconds": {
                "type": "integer"
              }
            },
            "required": [
              "limit",
              "windowSeconds"
            ]
          }
        },
        "required": [
          "org",
          "key",
          "rateLimit"
        ]
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "degraded"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "EventType": {
        "type": "string",
        "enum": [
          "run.created",
          "run.updated",
          "run.status_changed",
          "run.completed",
          "run.trashed",
          "run.restored",
          "task.ready",
          "task.assigned",
          "task.completed",
          "task.uncompleted",
          "field.updated",
          "approval.requested",
          "approval.decided",
          "comment.created",
          "attachment.created",
          "guest.task_viewed",
          "guest.task_completed",
          "workflow.published",
          "schedule.run_created",
          "schedule.created",
          "schedule.updated",
          "schedule.deleted",
          "rule.created",
          "rule.updated",
          "rule.deleted",
          "webhook.created",
          "webhook.updated",
          "webhook.deleted",
          "webhook.test"
        ],
        "x-processcart-open-enum": true,
        "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
      },
      "EventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evt_[0-9a-f-]{36}$"
          },
          "type": {
            "$ref": "#/components/schemas/EventType"
          },
          "timestamp": {
            "type": "string"
          },
          "org": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "slug"
            ]
          },
          "actor": {
            "$ref": "#/components/schemas/EventActor"
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "type",
          "timestamp",
          "org",
          "actor",
          "data"
        ]
      },
      "EventField": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RunField"
          },
          {
            "type": "object",
            "properties": {
              "previous": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CanonicalValue"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "previous"
            ]
          }
        ]
      },
      "EventApproval": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "decision": {
            "type": "string",
            "enum": [
              "approved",
              "rejected"
            ]
          },
          "comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "decidedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "decidedByEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "decidedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "decision",
          "comment",
          "decidedBy",
          "decidedByEmail",
          "decidedAt"
        ]
      },
      "EventComment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "authorId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        },
        "required": [
          "id",
          "authorId",
          "text",
          "mentions"
        ]
      },
      "EventAttachment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "filename": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "mime": {
            "type": "string"
          },
          "fieldKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "taskKey": {
            "type": "string"
          },
          "commentId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "filename",
          "size",
          "mime",
          "fieldKey",
          "taskKey",
          "commentId"
        ]
      },
      "EventGuest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "linkId": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        "required": [
          "email",
          "linkId"
        ]
      },
      "Visibility": {
        "type": "string",
        "enum": [
          "visible",
          "hidden"
        ]
      },
      "RichNode": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "attrs": {
            "type": "object",
            "additionalProperties": {}
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RichNode"
            }
          },
          "marks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "attrs": {
                  "type": "object",
                  "additionalProperties": {}
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ]
      },
      "RichDoc": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "doc"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RichNode"
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "FormatConfig": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "none"
              },
              "min": {
                "type": "integer",
                "minimum": 0
              },
              "max": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "number"
              },
              "decimals": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  {
                    "type": "string",
                    "const": "auto"
                  }
                ]
              },
              "thousands": {
                "type": "boolean"
              },
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "currency"
              },
              "symbol": {
                "type": "string",
                "maxLength": 8
              },
              "showSymbol": {
                "type": "boolean"
              },
              "thousands": {
                "type": "boolean"
              },
              "decimals": {
                "type": "string",
                "enum": [
                  "always2",
                  "auto",
                  "hideWhenZero"
                ]
              },
              "negativeStyle": {
                "type": "string",
                "enum": [
                  "minus",
                  "parens"
                ]
              },
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "percent"
              },
              "entryMode": {
                "type": "string",
                "enum": [
                  "whole",
                  "decimal"
                ]
              },
              "showSign": {
                "type": "boolean"
              },
              "decimals": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  {
                    "type": "string",
                    "const": "auto"
                  }
                ]
              },
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "date"
              },
              "pattern": {
                "type": "string",
                "enum": [
                  "YYYY-MM-DD",
                  "MM/DD/YYYY",
                  "DD/MM/YYYY",
                  "DD-MMM-YYYY",
                  "MMM D, YYYY",
                  "MMMM D, YYYY"
                ]
              },
              "min": {
                "type": "string"
              },
              "max": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "time"
              },
              "hour12": {
                "type": "boolean"
              },
              "min": {
                "type": "string"
              },
              "max": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "phone"
              },
              "country": {
                "type": "string",
                "const": "US"
              },
              "pattern": {
                "type": "string",
                "maxLength": 40
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "email"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "url"
              },
              "requireProtocol": {
                "type": "boolean"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "custom"
              },
              "mask": {
                "type": "string",
                "maxLength": 120
              },
              "regex": {
                "type": "string",
                "maxLength": 500
              },
              "errorMessage": {
                "type": "string",
                "maxLength": 200
              }
            },
            "required": [
              "type"
            ]
          }
        ]
      },
      "FieldOptions": {
        "type": "object",
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "maxItems": 200
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              },
              "required": [
                "key",
                "label"
              ]
            },
            "maxItems": 200
          },
          "allRequired": {
            "type": "boolean"
          },
          "multiple": {
            "type": "boolean"
          }
        }
      },
      "FieldValidation": {
        "type": "object",
        "properties": {
          "expr": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "message": {
            "type": "string",
            "maxLength": 200,
            "default": ""
          }
        },
        "required": [
          "expr"
        ]
      },
      "OnFocusPopulate": {
        "type": "object",
        "properties": {
          "expr": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        },
        "required": [
          "expr"
        ]
      },
      "Formula": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "spreadsheet",
              "js"
            ]
          },
          "expr": {
            "type": "string",
            "maxLength": 10000
          }
        },
        "required": [
          "mode",
          "expr"
        ]
      },
      "DueRule": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "none"
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "after_run_start"
              },
              "amount": {
                "type": "integer"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "hours",
                  "days"
                ]
              }
            },
            "required": [
              "kind",
              "amount",
              "unit"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "after_task"
              },
              "taskKey": {
                "$ref": "#/components/schemas/Key"
              },
              "amount": {
                "type": "integer"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "hours",
                  "days"
                ]
              }
            },
            "required": [
              "kind",
              "taskKey",
              "amount",
              "unit"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "relative_to_field"
              },
              "fieldKey": {
                "$ref": "#/components/schemas/Key"
              },
              "amount": {
                "type": "integer",
                "minimum": 0
              },
              "unit": {
                "type": "string",
                "enum": [
                  "hours",
                  "days"
                ]
              },
              "direction": {
                "type": "string",
                "enum": [
                  "before",
                  "after"
                ]
              }
            },
            "required": [
              "kind",
              "fieldKey",
              "amount",
              "unit",
              "direction"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "manual"
              }
            },
            "required": [
              "kind"
            ]
          }
        ]
      },
      "Assignment": {
        "type": "object",
        "properties": {
          "assignees": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "user"
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "kind",
                    "userId"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "group"
                    },
                    "groupId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "kind",
                    "groupId"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "role"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "member",
                        "builder",
                        "admin"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "role"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "run_starter"
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "members_field"
                    },
                    "fieldKey": {
                      "$ref": "#/components/schemas/Key"
                    }
                  },
                  "required": [
                    "kind",
                    "fieldKey"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "guest_email"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "maxLength": 320
                    }
                  },
                  "required": [
                    "kind",
                    "email"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "guest_field"
                    },
                    "fieldKey": {
                      "$ref": "#/components/schemas/Key"
                    }
                  },
                  "required": [
                    "kind",
                    "fieldKey"
                  ]
                }
              ]
            },
            "maxItems": 50
          }
        },
        "required": [
          "assignees"
        ]
      },
      "GuestConfig": {
        "type": "object",
        "properties": {
          "contextFieldKeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Key"
            },
            "maxItems": 100,
            "default": []
          }
        }
      },
      "RuleDef": {
        "type": "object",
        "properties": {
          "effect": {
            "type": "string",
            "enum": [
              "show",
              "hide"
            ]
          },
          "when": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "field"
                  },
                  "fieldKey": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "equals",
                      "not_equals",
                      "contains",
                      "not_contains",
                      "greater",
                      "greater_equal",
                      "less",
                      "less_equal",
                      "is_filled",
                      "is_empty"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "fieldKey",
                  "op"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "task"
                  },
                  "taskKey": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "completed",
                      "approved",
                      "rejected"
                    ]
                  }
                },
                "required": [
                  "type",
                  "taskKey",
                  "state"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "group"
                  },
                  "combinator": {
                    "type": "string",
                    "enum": [
                      "and",
                      "or"
                    ]
                  },
                  "conditions": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "field"
                            },
                            "fieldKey": {
                              "$ref": "#/components/schemas/Key"
                            },
                            "op": {
                              "type": "string",
                              "enum": [
                                "equals",
                                "not_equals",
                                "contains",
                                "not_contains",
                                "greater",
                                "greater_equal",
                                "less",
                                "less_equal",
                                "is_filled",
                                "is_empty"
                              ]
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "fieldKey",
                            "op"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "task"
                            },
                            "taskKey": {
                              "$ref": "#/components/schemas/Key"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "completed",
                                "approved",
                                "rejected"
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "taskKey",
                            "state"
                          ]
                        }
                      ]
                    },
                    "maxItems": 100
                  }
                },
                "required": [
                  "type",
                  "combinator",
                  "conditions"
                ]
              }
            ]
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "section",
                    "task",
                    "field"
                  ]
                },
                "key": {
                  "$ref": "#/components/schemas/Key"
                }
              },
              "required": [
                "kind",
                "key"
              ]
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "effect",
          "when",
          "targets"
        ]
      },
      "RunsQuery": {
        "type": "object",
        "properties": {
          "workflowId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "completed",
                "on_hold",
                "archived"
              ],
              "x-processcart-open-enum": true,
              "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
            },
            "maxItems": 4
          },
          "priority": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "none",
                "low",
                "medium",
                "high",
                "urgent"
              ],
              "x-processcart-open-enum": true,
              "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
            },
            "maxItems": 5
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "maxItems": 50
          },
          "assignee": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "me"
                  }
                },
                "required": [
                  "kind"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "user"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "kind",
                  "id"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "group"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "kind",
                  "id"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "due": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "overdue",
                  "today",
                  "week",
                  "none"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "q": {
            "type": "string",
            "maxLength": 200
          },
          "qMode": {
            "type": "string",
            "enum": [
              "prefix",
              "contains"
            ],
            "default": "prefix"
          },
          "sort": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "enum": [
                  "name",
                  "key_date",
                  "due",
                  "started",
                  "completed",
                  "progress",
                  "priority"
                ]
              },
              "dir": {
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "key",
              "dir"
            ]
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "workflow",
                "status",
                "priority",
                "progress",
                "key_date",
                "due",
                "assignees",
                "started",
                "completed"
              ]
            },
            "maxItems": 9
          }
        },
        "required": [
          "workflowId",
          "status",
          "priority",
          "labels",
          "assignee",
          "due",
          "q",
          "sort",
          "columns"
        ]
      },
      "WorkflowTemplate": {
        "type": "object",
        "properties": {
          "formatVersion": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "engineVersion": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "exportedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "workflow": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "icon": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 80
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "color": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "keyDateFieldKey": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Key"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "$ref": "#/components/schemas/Key"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 300
                    },
                    "defaultVisibility": {
                      "$ref": "#/components/schemas/Visibility",
                      "default": "visible"
                    },
                    "tasks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "$ref": "#/components/schemas/Key"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 300
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/RichDoc"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "defaultVisibility": {
                            "$ref": "#/components/schemas/Visibility",
                            "default": "visible"
                          },
                          "isStop": {
                            "type": "boolean",
                            "default": false
                          },
                          "kind": {
                            "$ref": "#/components/schemas/TaskKind",
                            "default": "standard"
                          },
                          "approvalConfig": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "summaryFieldKeys": {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/Key"
                                    },
                                    "maxItems": 100,
                                    "default": []
                                  },
                                  "rejectReopensTaskKeys": {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/Key"
                                    },
                                    "maxItems": 100,
                                    "default": []
                                  }
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "emailConfig": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "to": {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "static"
                                            },
                                            "email": {
                                              "type": "string",
                                              "format": "email",
                                              "maxLength": 320
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "email"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "field"
                                            },
                                            "fieldKey": {
                                              "$ref": "#/components/schemas/Key"
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "fieldKey"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "group"
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 200
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "name"
                                          ]
                                        }
                                      ]
                                    },
                                    "maxItems": 100,
                                    "default": []
                                  },
                                  "cc": {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "static"
                                            },
                                            "email": {
                                              "type": "string",
                                              "format": "email",
                                              "maxLength": 320
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "email"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "field"
                                            },
                                            "fieldKey": {
                                              "$ref": "#/components/schemas/Key"
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "fieldKey"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "group"
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 200
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "name"
                                          ]
                                        }
                                      ]
                                    },
                                    "maxItems": 100,
                                    "default": []
                                  },
                                  "subject": {
                                    "type": "string",
                                    "maxLength": 500,
                                    "default": ""
                                  },
                                  "body": {
                                    "anyOf": [
                                      {
                                        "$ref": "#/components/schemas/RichDoc"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "delivery": {
                                    "type": "string",
                                    "enum": [
                                      "app",
                                      "mailto",
                                      "runner_choice"
                                    ],
                                    "default": "app"
                                  },
                                  "autoSend": {
                                    "type": "boolean",
                                    "default": false
                                  },
                                  "attachmentFieldKeys": {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/Key"
                                    },
                                    "maxItems": 50,
                                    "default": []
                                  }
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "assignment": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "assignees": {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "group"
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 200
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "name"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "role"
                                            },
                                            "role": {
                                              "type": "string",
                                              "enum": [
                                                "member",
                                                "builder",
                                                "admin"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "role"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "run_starter"
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "members_field"
                                            },
                                            "fieldKey": {
                                              "$ref": "#/components/schemas/Key"
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "fieldKey"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "guest_email"
                                            },
                                            "email": {
                                              "type": "string",
                                              "format": "email",
                                              "maxLength": 320
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "email"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "guest_field"
                                            },
                                            "fieldKey": {
                                              "$ref": "#/components/schemas/Key"
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "fieldKey"
                                          ]
                                        }
                                      ]
                                    },
                                    "maxItems": 50
                                  }
                                },
                                "required": [
                                  "assignees"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dueRule": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/DueRule"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "guestConfig": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/GuestConfig"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "$ref": "#/components/schemas/FieldKey"
                                },
                                "type": {
                                  "$ref": "#/components/schemas/FieldType"
                                },
                                "label": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "help": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "required": {
                                  "type": "boolean",
                                  "default": false
                                },
                                "defaultVisibility": {
                                  "$ref": "#/components/schemas/Visibility",
                                  "default": "visible"
                                },
                                "options": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/components/schemas/FieldOptions"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "formatConfig": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/components/schemas/FormatConfig"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "validation": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/components/schemas/FieldValidation"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "defaultValue": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "static"
                                        },
                                        "value": {
                                          "$ref": "#/components/schemas/CanonicalValue"
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "formula"
                                        },
                                        "expr": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 10000
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "expr"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "onFocusPopulate": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/components/schemas/OnFocusPopulate"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "formula": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/components/schemas/Formula"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "content": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/components/schemas/RichDoc"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "inKickoff": {
                                  "type": "boolean",
                                  "default": false
                                },
                                "kickoffPosition": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "key",
                                "type",
                                "label"
                              ]
                            },
                            "maxItems": 300,
                            "default": []
                          }
                        },
                        "required": [
                          "key",
                          "title"
                        ]
                      },
                      "maxItems": 500,
                      "default": []
                    }
                  },
                  "required": [
                    "key",
                    "title"
                  ]
                },
                "maxItems": 200,
                "default": []
              },
              "rules": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleDef"
                },
                "maxItems": 500,
                "default": []
              }
            },
            "required": [
              "name"
            ]
          }
        },
        "required": [
          "formatVersion",
          "engineVersion",
          "workflow"
        ]
      },
      "WorkflowField": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "type": {
            "$ref": "#/components/schemas/FieldType"
          },
          "label": {
            "type": "string"
          },
          "help": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "options": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FieldOptions"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatConfig": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FormatConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "validation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FieldValidation"
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultValue": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "static"
                  },
                  "value": {
                    "$ref": "#/components/schemas/CanonicalValue"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "onFocusPopulate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OnFocusPopulate"
              },
              {
                "type": "null"
              }
            ]
          },
          "formula": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Formula"
              },
              {
                "type": "null"
              }
            ]
          },
          "inKickoff": {
            "type": "boolean"
          },
          "kickoffPosition": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "readOnly": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "type",
          "label",
          "help",
          "required",
          "defaultVisibility",
          "options",
          "formatConfig",
          "validation",
          "defaultValue",
          "onFocusPopulate",
          "formula",
          "inKickoff",
          "kickoffPosition",
          "readOnly"
        ]
      },
      "WorkflowTask": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TaskKind"
          },
          "isStop": {
            "type": "boolean"
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "dueRule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DueRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Assignment"
              },
              {
                "type": "null"
              }
            ]
          },
          "guestConfig": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GuestConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowField"
            }
          }
        },
        "required": [
          "key",
          "title",
          "kind",
          "isStop",
          "defaultVisibility",
          "dueRule",
          "assignment",
          "guestConfig",
          "fields"
        ]
      },
      "WorkflowSection": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "title": {
            "type": "string"
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTask"
            }
          }
        },
        "required": [
          "key",
          "title",
          "defaultVisibility",
          "tasks"
        ]
      },
      "WorkflowSummary": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "folder": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "keyDateFieldKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "kickoffFormEnabled": {
            "type": "boolean"
          },
          "publishedVersion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "number": {
                    "type": "integer"
                  },
                  "publishedAt": {
                    "$ref": "#/components/schemas/Instant"
                  }
                },
                "required": [
                  "id",
                  "number",
                  "publishedAt"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "taskCount": {
            "type": "integer"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "status",
          "icon",
          "color",
          "folder",
          "keyDateFieldKey",
          "kickoffFormEnabled",
          "publishedVersion",
          "taskCount",
          "createdAt",
          "updatedAt"
        ]
      },
      "WorkflowDetail": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "folder": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "keyDateFieldKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "kickoffFormEnabled": {
            "type": "boolean"
          },
          "publishedVersion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "number": {
                    "type": "integer"
                  },
                  "publishedAt": {
                    "$ref": "#/components/schemas/Instant"
                  }
                },
                "required": [
                  "id",
                  "number",
                  "publishedAt"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "taskCount": {
            "type": "integer"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowSection"
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleDef"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "status",
          "icon",
          "color",
          "folder",
          "keyDateFieldKey",
          "kickoffFormEnabled",
          "publishedVersion",
          "taskCount",
          "createdAt",
          "updatedAt",
          "sections",
          "rules"
        ]
      },
      "ImportReport": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "counts": {
            "type": "object",
            "properties": {
              "sections": {
                "type": "integer"
              },
              "tasks": {
                "type": "integer"
              },
              "fields": {
                "type": "integer"
              },
              "rules": {
                "type": "integer"
              }
            },
            "required": [
              "sections",
              "tasks",
              "fields",
              "rules"
            ]
          },
          "clearedAssignments": {
            "type": "integer"
          },
          "flaggedEmails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "errors",
          "warnings",
          "counts",
          "clearedAssignments",
          "flaggedEmails"
        ]
      },
      "View": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "query": {
            "$ref": "#/components/schemas/RunsQuery"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "org",
              "groups"
            ]
          },
          "groupIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          "owner": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "userId": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "userId",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "name",
          "query",
          "visibility",
          "groupIds",
          "owner",
          "createdAt",
          "updatedAt"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "member",
              "builder",
              "admin"
            ]
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "joinedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "name",
          "role",
          "avatarUrl",
          "joinedAt"
        ]
      },
      "Group": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "memberIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "name",
          "memberIds",
          "createdAt"
        ]
      },
      "Comment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "runId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "taskKey": {
            "$ref": "#/components/schemas/Key"
          },
          "runTaskId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "author": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Actor"
              },
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "body": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "doc"
              },
              "content": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The node type (`paragraph`, `text`, `mention`, `bulletList`, …)."
                    },
                    "attrs": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "text": {
                      "type": "string",
                      "description": "Text nodes only."
                    },
                    "marks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "attrs": {
                            "type": "object",
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "description": "Child nodes of the same shape (nested arbitrarily deep)."
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              }
            },
            "required": [
              "type"
            ],
            "description": "A rich-text document (ProseMirror JSON). Allowed node types: paragraph, text, heading, bulletList, orderedList, listItem, blockquote, codeBlock, hardBreak, horizontalRule, image, table, tableRow, tableCell, tableHeader, mention, mergeTag (attrs.fieldKey must be a valid field key, else dropped), embed (an https video src on YouTube, Loom or Vimeo, else removed); marks: bold, italic, code, link, textStyle, highlight. Anything else is dropped on save. A mention node is `{ type: \"mention\", attrs: { id: \"<member user id>\" } }` — its label is always re-derived from the member list."
          },
          "text": {
            "type": "string"
          },
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "editedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "runId",
          "taskKey",
          "runTaskId",
          "author",
          "body",
          "text",
          "mentions",
          "createdAt",
          "editedAt",
          "url"
        ]
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "runId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "taskKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "fieldKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "commentId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "filename": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "contentType": {
            "type": "string"
          },
          "uploadedByUserId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "uploadedBy": {
            "$ref": "#/components/schemas/Actor"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "downloadUrl": {
            "type": "string",
            "format": "uri",
            "description": "A signed download link (`Content-Disposition: attachment`), valid one hour."
          },
          "downloadExpiresAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "runId",
          "taskKey",
          "fieldKey",
          "commentId",
          "filename",
          "size",
          "contentType",
          "uploadedByUserId",
          "uploadedBy",
          "createdAt"
        ]
      },
      "ActivityItem": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "runId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "type": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "fields",
              "tasks",
              "approvals",
              "files",
              "comments",
              "run"
            ]
          },
          "actor": {
            "$ref": "#/components/schemas/EventActor"
          },
          "taskKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "payload": {
            "type": "object",
            "additionalProperties": {}
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "runId",
          "type",
          "category",
          "actor",
          "taskKey",
          "payload",
          "description",
          "createdAt"
        ]
      },
      "UploadTicket": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string",
            "format": "uuid",
            "description": "The id the attachment will have once finalized."
          },
          "upload": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "const": "PUT"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "The signed upload URL. PUT the raw bytes to it with the Content-Type below and no other credential (no API key, no apikey header); valid two hours. Finalized bytes are immutable: a second PUT to the same URL is refused with HTTP 400 and a `Duplicate` / `KeyAlreadyExists` error body — key on the body's `code` (`KeyAlreadyExists`), not the HTTP status: the bytes are already there, so finalize. The URL is a credential: never log it."
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Send exactly these headers with the PUT."
              },
              "expiresAt": {
                "$ref": "#/components/schemas/Instant"
              }
            },
            "required": [
              "method",
              "url",
              "headers",
              "expiresAt"
            ]
          },
          "finalize": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "const": "POST"
              },
              "url": {
                "type": "string",
                "description": "The absolute finalize URL, on the origin the request came in on (the same origin as every `Location`). POST the body below to it with your API key."
              },
              "body": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "target": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "field"
                      },
                      "fieldKey": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]*$",
                        "maxLength": 80,
                        "description": "A File field of the run's workflow version."
                      }
                    },
                    "required": [
                      "kind",
                      "fieldKey"
                    ]
                  }
                },
                "required": [
                  "filename",
                  "target"
                ]
              }
            },
            "required": [
              "method",
              "url",
              "body"
            ]
          }
        },
        "required": [
          "attachmentId",
          "upload",
          "finalize"
        ]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "workflowIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "type": "object",
            "properties": {
              "fieldKeys": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "disabledReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "failures",
                  "gone",
                  "manual"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "disabledAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "lastDeliveryAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "workflowIds",
          "filters",
          "enabled",
          "disabledReason",
          "disabledAt",
          "consecutiveFailures",
          "lastDeliveryAt",
          "createdAt",
          "createdBy",
          "updatedAt"
        ]
      },
      "WebhookConfig": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "default": ""
          },
          "events": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/EventType"
                },
                {
                  "type": "string",
                  "const": "*"
                }
              ]
            },
            "minItems": 1,
            "maxItems": 30
          },
          "workflowIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Uuid"
                },
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "filters": {
            "type": "object",
            "properties": {
              "fieldKeys": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "maxItems": 100
              }
            },
            "additionalProperties": false,
            "default": {}
          }
        },
        "required": [
          "url",
          "events"
        ],
        "additionalProperties": false
      },
      "WebhookPatch": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048
          },
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "events": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/EventType"
                },
                {
                  "type": "string",
                  "const": "*"
                }
              ]
            },
            "minItems": 1,
            "maxItems": 30
          },
          "workflowIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Uuid"
                },
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "type": "object",
            "properties": {
              "fieldKeys": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "maxItems": 100
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "WebhookWithSecret": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "workflowIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "type": "object",
            "properties": {
              "fieldKeys": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "disabledReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "failures",
                  "gone",
                  "manual"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "disabledAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "lastDeliveryAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "secret": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "workflowIds",
          "filters",
          "enabled",
          "disabledReason",
          "disabledAt",
          "consecutiveFailures",
          "lastDeliveryAt",
          "createdAt",
          "createdBy",
          "updatedAt",
          "secret"
        ]
      },
      "WebhookSecret": {
        "type": "object",
        "properties": {
          "secret": {
            "type": "string"
          },
          "previousExpiresAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "secret",
          "previousExpiresAt"
        ]
      },
      "WebhookQueuedDelivery": {
        "type": "object",
        "properties": {
          "delivery": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "webhookId": {
                "$ref": "#/components/schemas/Uuid"
              },
              "attempt": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "webhookId",
              "attempt"
            ]
          }
        },
        "required": [
          "delivery"
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "webhookId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed",
              "exhausted"
            ]
          },
          "attemptCount": {
            "type": "integer"
          },
          "lastStatusCode": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastAttemptAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextAttemptAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveredAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "webhookId",
          "eventId",
          "eventType",
          "status",
          "attemptCount",
          "lastStatusCode",
          "lastError",
          "lastAttemptAt",
          "nextAttemptAt",
          "deliveredAt",
          "createdAt"
        ]
      },
      "WebhookDeliveryWithPayload": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "webhookId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed",
              "exhausted"
            ]
          },
          "attemptCount": {
            "type": "integer"
          },
          "lastStatusCode": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastAttemptAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextAttemptAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveredAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "payload": {
            "$ref": "#/components/schemas/EventEnvelope"
          }
        },
        "required": [
          "id",
          "webhookId",
          "eventId",
          "eventType",
          "status",
          "attemptCount",
          "lastStatusCode",
          "lastError",
          "lastAttemptAt",
          "nextAttemptAt",
          "deliveredAt",
          "createdAt",
          "payload"
        ]
      },
      "WebhookList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "WebhookDeliveryList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "Recurrence": {
        "type": "object",
        "properties": {
          "freq": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "yearly"
            ]
          },
          "interval": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "time": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):([0-5]\\d)$"
          },
          "startDate": {
            "$ref": "#/components/schemas/CalendarDate"
          },
          "endDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CalendarDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "weekly": {
            "type": "object",
            "properties": {
              "days": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "mon",
                    "tue",
                    "wed",
                    "thu",
                    "fri",
                    "sat",
                    "sun"
                  ]
                },
                "minItems": 1,
                "maxItems": 7
              }
            },
            "required": [
              "days"
            ],
            "additionalProperties": false
          },
          "monthly": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "day"
                  },
                  "day": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 31
                  }
                },
                "required": [
                  "kind",
                  "day"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "ordinal"
                  },
                  "ordinal": {
                    "type": "string",
                    "enum": [
                      "first",
                      "second",
                      "third",
                      "fourth",
                      "last"
                    ]
                  },
                  "target": {
                    "type": "string",
                    "enum": [
                      "mon",
                      "tue",
                      "wed",
                      "thu",
                      "fri",
                      "sat",
                      "sun",
                      "day",
                      "weekday",
                      "weekend_day"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "ordinal",
                  "target"
                ],
                "additionalProperties": false
              }
            ]
          },
          "yearly": {
            "type": "object",
            "properties": {
              "month": {
                "type": "integer",
                "minimum": 1,
                "maximum": 12
              },
              "day": {
                "type": "integer",
                "minimum": 1,
                "maximum": 31
              }
            },
            "required": [
              "month",
              "day"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "freq",
          "interval",
          "time",
          "startDate"
        ],
        "additionalProperties": false
      },
      "AutomationAssignee": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "user"
              },
              "userId": {
                "$ref": "#/components/schemas/Uuid"
              }
            },
            "required": [
              "kind",
              "userId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "group"
              },
              "groupId": {
                "$ref": "#/components/schemas/Uuid"
              }
            },
            "required": [
              "kind",
              "groupId"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Schedule": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "workflowId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "workflow": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "recurrence": {
            "type": "object",
            "properties": {
              "freq": {
                "type": "string",
                "enum": [
                  "daily",
                  "weekly",
                  "monthly",
                  "yearly"
                ]
              },
              "interval": {
                "type": "integer"
              },
              "time": {
                "type": "string"
              },
              "startDate": {
                "$ref": "#/components/schemas/CalendarDate"
              },
              "endDate": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CalendarDate"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "weekly": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri",
                        "sat",
                        "sun"
                      ]
                    }
                  }
                },
                "required": [
                  "days"
                ]
              },
              "monthly": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day"
                      },
                      "day": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ordinal"
                      },
                      "ordinal": {
                        "type": "string",
                        "enum": [
                          "first",
                          "second",
                          "third",
                          "fourth",
                          "last"
                        ]
                      },
                      "target": {
                        "type": "string",
                        "enum": [
                          "mon",
                          "tue",
                          "wed",
                          "thu",
                          "fri",
                          "sat",
                          "sun",
                          "day",
                          "weekday",
                          "weekend_day"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "ordinal",
                      "target"
                    ]
                  }
                ]
              },
              "yearly": {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "integer"
                  },
                  "day": {
                    "type": "integer"
                  }
                },
                "required": [
                  "month",
                  "day"
                ]
              }
            },
            "required": [
              "freq",
              "interval",
              "time",
              "startDate"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "namePattern": {
            "type": "string"
          },
          "presetValues": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CanonicalValue"
            }
          },
          "assignmentOverrides": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "user"
                      },
                      "userId": {
                        "$ref": "#/components/schemas/Uuid"
                      }
                    },
                    "required": [
                      "kind",
                      "userId"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "group"
                      },
                      "groupId": {
                        "$ref": "#/components/schemas/Uuid"
                      }
                    },
                    "required": [
                      "kind",
                      "groupId"
                    ]
                  }
                ]
              }
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "disabledReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "manual",
                  "ended",
                  "unpublished",
                  "failed",
                  "workflow_trashed",
                  "workflow_archived"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "nextRunAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextOccurrences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Instant"
            }
          },
          "lastRunAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "latestRun": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  },
                  "startedAt": {
                    "$ref": "#/components/schemas/Instant"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "startedAt"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "presetMismatches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fieldKey": {
                  "type": "string"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "no_longer_writable",
                    "missing_required"
                  ]
                }
              },
              "required": [
                "fieldKey",
                "reason"
              ]
            }
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "workflowId",
          "workflow",
          "name",
          "description",
          "recurrence",
          "timezone",
          "namePattern",
          "presetValues",
          "assignmentOverrides",
          "enabled",
          "disabledReason",
          "lastError",
          "consecutiveFailures",
          "nextRunAt",
          "nextOccurrences",
          "lastRunAt",
          "latestRun",
          "presetMismatches",
          "createdBy",
          "createdAt",
          "updatedAt"
        ]
      },
      "ScheduleConfig": {
        "type": "object",
        "properties": {
          "workflowId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "recurrence": {
            "$ref": "#/components/schemas/Recurrence"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "namePattern": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "default": "{{workflow}} — {{date}}"
          },
          "presetValues": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CanonicalValue"
            },
            "propertyNames": {
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            },
            "default": {}
          },
          "assignmentOverrides": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AutomationAssignee"
              },
              "minItems": 1,
              "maxItems": 20
            },
            "propertyNames": {
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            },
            "default": {}
          }
        },
        "required": [
          "workflowId",
          "name",
          "recurrence"
        ],
        "additionalProperties": false
      },
      "SchedulePatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "recurrence": {
            "$ref": "#/components/schemas/Recurrence"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "namePattern": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "presetValues": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CanonicalValue"
            },
            "propertyNames": {
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          },
          "assignmentOverrides": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AutomationAssignee"
              },
              "minItems": 1,
              "maxItems": 20
            },
            "propertyNames": {
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 80
            }
          }
        },
        "additionalProperties": false
      },
      "ScheduleOccurrences": {
        "type": "object",
        "properties": {
          "occurrences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Instant"
            }
          }
        },
        "required": [
          "occurrences"
        ]
      },
      "ScheduleList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Schedule"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "RuleFilter": {
        "type": "object",
        "properties": {
          "taskKey": {
            "$ref": "#/components/schemas/Key"
          },
          "fieldKey": {
            "$ref": "#/components/schemas/FieldKey"
          }
        },
        "additionalProperties": false
      },
      "RuleConditions": {
        "type": "object",
        "properties": {
          "combinator": {
            "type": "string",
            "enum": [
              "and",
              "or"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "field"
                },
                "fieldKey": {
                  "$ref": "#/components/schemas/FieldKey"
                },
                "op": {
                  "type": "string",
                  "enum": [
                    "equals",
                    "not_equals",
                    "contains",
                    "not_contains",
                    "greater",
                    "greater_equal",
                    "less",
                    "less_equal",
                    "is_filled",
                    "is_empty"
                  ]
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "type",
                "fieldKey",
                "op"
              ],
              "additionalProperties": false
            },
            "maxItems": 10
          }
        },
        "required": [
          "combinator",
          "items"
        ],
        "additionalProperties": false
      },
      "RuleAction": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "set_field"
              },
              "fieldKey": {
                "$ref": "#/components/schemas/FieldKey"
              },
              "value": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CanonicalValue"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "type",
              "fieldKey",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "set_status"
              },
              "status": {
                "$ref": "#/components/schemas/RunStatus"
              }
            },
            "required": [
              "type",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "set_priority"
              },
              "priority": {
                "$ref": "#/components/schemas/RunPriority"
              }
            },
            "required": [
              "type",
              "priority"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "add_labels"
              },
              "labelIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "minItems": 1,
                "maxItems": 50
              }
            },
            "required": [
              "type",
              "labelIds"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "remove_labels"
              },
              "labelIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "minItems": 1,
                "maxItems": 50
              }
            },
            "required": [
              "type",
              "labelIds"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "assign_task"
              },
              "taskKey": {
                "$ref": "#/components/schemas/Key"
              },
              "assignees": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AutomationAssignee"
                },
                "maxItems": 20
              }
            },
            "required": [
              "type",
              "taskKey",
              "assignees"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "notify"
              },
              "recipients": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^(?:builders|admins|assignees|starter|[ug]:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
                },
                "maxItems": 20
              },
              "message": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            },
            "required": [
              "type",
              "recipients",
              "message"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "call_webhook"
              },
              "webhookId": {
                "$ref": "#/components/schemas/Uuid"
              }
            },
            "required": [
              "type",
              "webhookId"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AutomationRule": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "workflowId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "workflow": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "triggerEvent": {
            "type": "string",
            "enum": [
              "run.created",
              "run.updated",
              "run.status_changed",
              "run.completed",
              "task.ready",
              "task.assigned",
              "task.completed",
              "task.uncompleted",
              "field.updated",
              "approval.requested",
              "approval.decided",
              "comment.created",
              "attachment.created",
              "guest.task_completed",
              "schedule.run_created"
            ]
          },
          "filter": {
            "type": "object",
            "properties": {
              "taskKey": {
                "type": "string"
              },
              "fieldKey": {
                "type": "string"
              }
            }
          },
          "conditions": {
            "type": "object",
            "properties": {
              "combinator": {
                "type": "string",
                "enum": [
                  "and",
                  "or"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "field"
                    },
                    "fieldKey": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "equals",
                        "not_equals",
                        "contains",
                        "not_contains",
                        "greater",
                        "greater_equal",
                        "less",
                        "less_equal",
                        "is_filled",
                        "is_empty"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "fieldKey",
                    "op"
                  ]
                }
              }
            },
            "required": [
              "combinator",
              "items"
            ]
          },
          "actions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "set_field"
                    },
                    "fieldKey": {
                      "type": "string"
                    },
                    "value": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/CanonicalValue"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "fieldKey",
                    "value"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "set_status"
                    },
                    "status": {
                      "$ref": "#/components/schemas/RunStatus"
                    }
                  },
                  "required": [
                    "type",
                    "status"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "set_priority"
                    },
                    "priority": {
                      "$ref": "#/components/schemas/RunPriority"
                    }
                  },
                  "required": [
                    "type",
                    "priority"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "add_labels"
                    },
                    "labelIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "type",
                    "labelIds"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remove_labels"
                    },
                    "labelIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "type",
                    "labelIds"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "assign_task"
                    },
                    "taskKey": {
                      "type": "string"
                    },
                    "assignees": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "user"
                              },
                              "userId": {
                                "$ref": "#/components/schemas/Uuid"
                              }
                            },
                            "required": [
                              "kind",
                              "userId"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "group"
                              },
                              "groupId": {
                                "$ref": "#/components/schemas/Uuid"
                              }
                            },
                            "required": [
                              "kind",
                              "groupId"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "type",
                    "taskKey",
                    "assignees"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "notify"
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "recipients",
                    "message"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "call_webhook"
                    },
                    "webhookId": {
                      "$ref": "#/components/schemas/Uuid"
                    }
                  },
                  "required": [
                    "type",
                    "webhookId"
                  ]
                }
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "disabledReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "manual",
                  "failures",
                  "loop_guard"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "disabledAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "keyMismatches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "field",
                    "task",
                    "webhook"
                  ]
                },
                "key": {
                  "type": "string"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "missing",
                    "not_writable",
                    "not_published",
                    "deleted",
                    "disabled"
                  ]
                }
              },
              "required": [
                "kind",
                "key",
                "reason"
              ]
            }
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "required": [
          "id",
          "workflowId",
          "workflow",
          "name",
          "triggerEvent",
          "filter",
          "conditions",
          "actions",
          "enabled",
          "disabledReason",
          "disabledAt",
          "consecutiveFailures",
          "keyMismatches",
          "createdBy",
          "createdAt",
          "updatedAt"
        ]
      },
      "AutomationRuleConfig": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "workflowId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "triggerEvent": {
            "type": "string",
            "enum": [
              "run.created",
              "run.updated",
              "run.status_changed",
              "run.completed",
              "task.ready",
              "task.assigned",
              "task.completed",
              "task.uncompleted",
              "field.updated",
              "approval.requested",
              "approval.decided",
              "comment.created",
              "attachment.created",
              "guest.task_completed",
              "schedule.run_created"
            ]
          },
          "filter": {
            "$ref": "#/components/schemas/RuleFilter",
            "default": {}
          },
          "conditions": {
            "$ref": "#/components/schemas/RuleConditions",
            "default": {
              "combinator": "and",
              "items": []
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleAction"
            },
            "minItems": 1,
            "maxItems": 10
          }
        },
        "required": [
          "name",
          "workflowId",
          "triggerEvent",
          "actions"
        ],
        "additionalProperties": false
      },
      "AutomationRulePatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "workflowId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "triggerEvent": {
            "type": "string",
            "enum": [
              "run.created",
              "run.updated",
              "run.status_changed",
              "run.completed",
              "task.ready",
              "task.assigned",
              "task.completed",
              "task.uncompleted",
              "field.updated",
              "approval.requested",
              "approval.decided",
              "comment.created",
              "attachment.created",
              "guest.task_completed",
              "schedule.run_created"
            ]
          },
          "filter": {
            "$ref": "#/components/schemas/RuleFilter"
          },
          "conditions": {
            "$ref": "#/components/schemas/RuleConditions"
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleAction"
            },
            "minItems": 1,
            "maxItems": 10
          }
        },
        "additionalProperties": false
      },
      "AutomationRuleList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationRule"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "RuleExecution": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "ruleId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "runId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "run": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "result": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action": {
                  "type": "string"
                },
                "ok": {
                  "type": "boolean"
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "skipped",
                    "failed"
                  ]
                },
                "detail": {
                  "type": "string"
                }
              },
              "required": [
                "action",
                "ok",
                "outcome"
              ]
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "ruleId",
          "runId",
          "run",
          "eventId",
          "eventType",
          "status",
          "result",
          "error",
          "createdAt",
          "startedAt",
          "finishedAt"
        ]
      },
      "RuleExecutionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleExecution"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "EventRunCreated": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "kickoffLinkId": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        "required": [
          "run"
        ]
      },
      "EventRunUpdated": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "changes": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "from": {},
                "to": {}
              }
            }
          }
        },
        "required": [
          "run",
          "changes"
        ]
      },
      "EventRunStatusChanged": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "changes": {
            "type": "object",
            "properties": {
              "status": {
                "type": "object",
                "properties": {
                  "from": {
                    "$ref": "#/components/schemas/RunStatus"
                  },
                  "to": {
                    "$ref": "#/components/schemas/RunStatus"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "run",
          "changes"
        ]
      },
      "EventRunCompleted": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          }
        },
        "required": [
          "run"
        ]
      },
      "EventRunTrashed": {
        "type": "object",
        "properties": {
          "run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Run"
              },
              {
                "$ref": "#/components/schemas/RunLite"
              }
            ]
          },
          "withWorkflow": {
            "type": "boolean"
          }
        },
        "required": [
          "run"
        ]
      },
      "EventRunRestored": {
        "type": "object",
        "properties": {
          "run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Run"
              },
              {
                "$ref": "#/components/schemas/RunLite"
              }
            ]
          },
          "withWorkflow": {
            "type": "boolean"
          }
        },
        "required": [
          "run"
        ]
      },
      "EventTaskReady": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          }
        },
        "required": [
          "run",
          "task"
        ]
      },
      "EventTaskAssigned": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "assignees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolvedAssignee"
            }
          }
        },
        "required": [
          "run",
          "task",
          "assignees"
        ]
      },
      "EventTaskCompleted": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          }
        },
        "required": [
          "run",
          "task"
        ]
      },
      "EventTaskUncompleted": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "byApproval": {
            "$ref": "#/components/schemas/Key"
          }
        },
        "required": [
          "run",
          "task"
        ]
      },
      "EventFieldUpdated": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "field": {
            "$ref": "#/components/schemas/EventField"
          }
        },
        "required": [
          "run",
          "field"
        ]
      },
      "EventApprovalRequested": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          }
        },
        "required": [
          "run",
          "task"
        ]
      },
      "EventApprovalDecided": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "approval": {
            "$ref": "#/components/schemas/EventApproval"
          }
        },
        "required": [
          "run",
          "task",
          "approval"
        ]
      },
      "EventCommentCreated": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "comment": {
            "$ref": "#/components/schemas/EventComment"
          }
        },
        "required": [
          "run",
          "task",
          "comment"
        ]
      },
      "EventAttachmentCreated": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "attachment": {
            "$ref": "#/components/schemas/EventAttachment"
          }
        },
        "required": [
          "run",
          "task",
          "attachment"
        ]
      },
      "EventGuestTaskViewed": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "guest": {
            "$ref": "#/components/schemas/EventGuest"
          }
        },
        "required": [
          "run",
          "task",
          "guest"
        ]
      },
      "EventGuestTaskCompleted": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "task": {
            "$ref": "#/components/schemas/RunTask"
          },
          "guest": {
            "$ref": "#/components/schemas/EventGuest"
          }
        },
        "required": [
          "run",
          "task",
          "guest"
        ]
      },
      "EventWorkflowPublished": {
        "type": "object",
        "properties": {
          "workflow": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "version": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "number": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "number"
            ]
          }
        },
        "required": [
          "workflow",
          "version"
        ]
      },
      "EventScheduleRunCreated": {
        "type": "object",
        "properties": {
          "run": {
            "$ref": "#/components/schemas/Run"
          },
          "schedule": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          }
        },
        "required": [
          "run",
          "schedule"
        ]
      },
      "EventScheduleCreated": {
        "type": "object",
        "properties": {
          "schedule": {
            "$ref": "#/components/schemas/Schedule"
          }
        },
        "required": [
          "schedule"
        ]
      },
      "EventScheduleUpdated": {
        "type": "object",
        "properties": {
          "schedule": {
            "$ref": "#/components/schemas/Schedule"
          },
          "change": {
            "type": "string",
            "enum": [
              "settings",
              "paused",
              "resumed",
              "auto_disabled"
            ]
          }
        },
        "required": [
          "schedule",
          "change"
        ]
      },
      "EventScheduleDeleted": {
        "type": "object",
        "properties": {
          "schedule": {
            "$ref": "#/components/schemas/Schedule"
          }
        },
        "required": [
          "schedule"
        ]
      },
      "EventRuleCreated": {
        "type": "object",
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/AutomationRule"
          }
        },
        "required": [
          "rule"
        ]
      },
      "EventRuleUpdated": {
        "type": "object",
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/AutomationRule"
          },
          "change": {
            "type": "string",
            "enum": [
              "settings",
              "enabled",
              "disabled",
              "auto_disabled"
            ]
          }
        },
        "required": [
          "rule",
          "change"
        ]
      },
      "EventRuleDeleted": {
        "type": "object",
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/AutomationRule"
          }
        },
        "required": [
          "rule"
        ]
      },
      "EventWebhookCreated": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": [
          "webhook"
        ]
      },
      "EventWebhookUpdated": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          },
          "change": {
            "type": "string",
            "enum": [
              "settings",
              "enabled",
              "disabled",
              "secret_rotated",
              "auto_disabled"
            ]
          }
        },
        "required": [
          "webhook",
          "change"
        ]
      },
      "EventWebhookDeleted": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          }
        },
        "required": [
          "webhook"
        ]
      },
      "EventWebhookTest": {
        "type": "object",
        "properties": {
          "webhook": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "required": [
          "webhook"
        ]
      },
      "ListRunCommentsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Comment"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "CreateRunCommentBody": {
        "type": "object",
        "properties": {
          "taskKey": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*$",
            "maxLength": 80,
            "description": "The task to comment on (any task of the run)."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Plain text: blank lines separate paragraphs, a single newline is a line break, and `@Name` becomes a mention when it matches exactly one member."
          },
          "body": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "doc"
              },
              "content": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The node type (`paragraph`, `text`, `mention`, `bulletList`, …)."
                    },
                    "attrs": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "text": {
                      "type": "string",
                      "description": "Text nodes only."
                    },
                    "marks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "attrs": {
                            "type": "object",
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "description": "Child nodes of the same shape (nested arbitrarily deep)."
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              }
            },
            "required": [
              "type"
            ],
            "description": "A rich-text document (ProseMirror JSON). Allowed node types: paragraph, text, heading, bulletList, orderedList, listItem, blockquote, codeBlock, hardBreak, horizontalRule, image, table, tableRow, tableCell, tableHeader, mention, mergeTag (attrs.fieldKey must be a valid field key, else dropped), embed (an https video src on YouTube, Loom or Vimeo, else removed); marks: bold, italic, code, link, textStyle, highlight. Anything else is dropped on save. A mention node is `{ type: \"mention\", attrs: { id: \"<member user id>\" } }` — its label is always re-derived from the member list."
          }
        },
        "required": [
          "taskKey"
        ],
        "additionalProperties": false
      },
      "RequestRunFileBody": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "The display name. Send the SAME string again at finalize."
          },
          "size": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 26214400,
            "description": "The byte size (at most 26214400 — 25 MB)."
          },
          "contentType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The MIME type you will send as the PUT's Content-Type — it becomes the stored type (echoed in `upload.headers`)."
          },
          "target": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "field"
              },
              "fieldKey": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$",
                "maxLength": 80,
                "description": "A File field of the run's workflow version."
              }
            },
            "required": [
              "kind",
              "fieldKey"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "filename",
          "size",
          "contentType",
          "target"
        ],
        "additionalProperties": false
      },
      "FinalizeRunFileBody": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "target": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "field"
              },
              "fieldKey": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$",
                "maxLength": 80,
                "description": "A File field of the run's workflow version."
              }
            },
            "required": [
              "kind",
              "fieldKey"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "filename",
          "target"
        ],
        "additionalProperties": false
      },
      "FinalizeRunFileResponse": {
        "type": "object",
        "properties": {
          "attachment": {
            "$ref": "#/components/schemas/Attachment"
          },
          "run": {
            "$ref": "#/components/schemas/Run"
          }
        },
        "required": [
          "attachment",
          "run"
        ]
      },
      "ListRunFilesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "ListRunActivityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "ListWorkflowsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "CreateWorkflowBody": {
        "type": "object",
        "properties": {
          "template": {
            "$ref": "#/components/schemas/WorkflowTemplate"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "folderId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "publish": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "template"
        ],
        "additionalProperties": false
      },
      "CreateWorkflowResponse": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "folder": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "keyDateFieldKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "kickoffFormEnabled": {
            "type": "boolean"
          },
          "publishedVersion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "number": {
                    "type": "integer"
                  },
                  "publishedAt": {
                    "$ref": "#/components/schemas/Instant"
                  }
                },
                "required": [
                  "id",
                  "number",
                  "publishedAt"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "taskCount": {
            "type": "integer"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Instant"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowSection"
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleDef"
            }
          },
          "import": {
            "$ref": "#/components/schemas/ImportReport"
          },
          "publishWarnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "status",
          "icon",
          "color",
          "folder",
          "keyDateFieldKey",
          "kickoffFormEnabled",
          "publishedVersion",
          "taskCount",
          "createdAt",
          "updatedAt",
          "sections",
          "rules",
          "import",
          "publishWarnings"
        ]
      },
      "UpdateWorkflowBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "folderId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "keyDateFieldKey": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FieldKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        },
        "additionalProperties": false
      },
      "GetWorkflowSchemaResponse": {
        "type": "object",
        "properties": {
          "workflowId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "versionId": {
            "$ref": "#/components/schemas/Uuid"
          },
          "versionNumber": {
            "type": "integer"
          },
          "start": {
            "type": "object",
            "additionalProperties": {}
          },
          "fields": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "workflowId",
          "versionId",
          "versionNumber",
          "start",
          "fields"
        ]
      },
      "ListViewsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/View"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "CreateViewBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "query": {
            "type": "object",
            "properties": {
              "workflowId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "active",
                    "completed",
                    "on_hold",
                    "archived"
                  ],
                  "x-processcart-open-enum": true,
                  "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
                },
                "maxItems": 4
              },
              "priority": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "none",
                    "low",
                    "medium",
                    "high",
                    "urgent"
                  ],
                  "x-processcart-open-enum": true,
                  "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
                },
                "maxItems": 5
              },
              "labels": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "maxItems": 50
              },
              "assignee": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "me"
                      }
                    },
                    "required": [
                      "kind"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "user"
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "kind",
                      "id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "group"
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "kind",
                      "id"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "due": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "today",
                      "week",
                      "none"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "q": {
                "type": "string",
                "maxLength": 200
              },
              "qMode": {
                "type": "string",
                "enum": [
                  "prefix",
                  "contains"
                ]
              },
              "sort": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "enum": [
                      "name",
                      "key_date",
                      "due",
                      "started",
                      "completed",
                      "progress",
                      "priority"
                    ]
                  },
                  "dir": {
                    "type": "string",
                    "enum": [
                      "asc",
                      "desc"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "columns": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "workflow",
                    "status",
                    "priority",
                    "progress",
                    "key_date",
                    "due",
                    "assignees",
                    "started",
                    "completed"
                  ]
                },
                "maxItems": 9
              }
            },
            "additionalProperties": false,
            "description": "The board query the view selects. Send only the members you set; the rest take the board's defaults: `{\"workflowId\":null,\"status\":[\"active\",\"on_hold\"],\"priority\":[],\"labels\":[],\"assignee\":null,\"due\":null,\"q\":\"\",\"qMode\":\"prefix\",\"sort\":{\"key\":\"started\",\"dir\":\"desc\"},\"columns\":[\"status\",\"priority\",\"progress\",\"key_date\",\"due\",\"assignees\",\"started\"]}`. `sort.key` without `dir` takes that key's natural direction (`asc` for `name`, `key_date` and `due`, else `desc`). An unknown member is a 422."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "org",
              "groups"
            ],
            "default": "org"
          },
          "groupIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "maxItems": 20
          }
        },
        "required": [
          "name",
          "query"
        ],
        "additionalProperties": false
      },
      "UpdateViewBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "query": {
            "type": "object",
            "properties": {
              "workflowId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "active",
                    "completed",
                    "on_hold",
                    "archived"
                  ],
                  "x-processcart-open-enum": true,
                  "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
                },
                "maxItems": 4
              },
              "priority": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "none",
                    "low",
                    "medium",
                    "high",
                    "urgent"
                  ],
                  "x-processcart-open-enum": true,
                  "description": "Open enum: new values may be added without a version bump — treat an unknown value as such."
                },
                "maxItems": 5
              },
              "labels": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "maxItems": 50
              },
              "assignee": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "me"
                      }
                    },
                    "required": [
                      "kind"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "user"
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "kind",
                      "id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "group"
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "kind",
                      "id"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "due": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "today",
                      "week",
                      "none"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "q": {
                "type": "string",
                "maxLength": 200
              },
              "qMode": {
                "type": "string",
                "enum": [
                  "prefix",
                  "contains"
                ]
              },
              "sort": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "enum": [
                      "name",
                      "key_date",
                      "due",
                      "started",
                      "completed",
                      "progress",
                      "priority"
                    ]
                  },
                  "dir": {
                    "type": "string",
                    "enum": [
                      "asc",
                      "desc"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "columns": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "workflow",
                    "status",
                    "priority",
                    "progress",
                    "key_date",
                    "due",
                    "assignees",
                    "started",
                    "completed"
                  ]
                },
                "maxItems": 9
              }
            },
            "additionalProperties": false,
            "description": "Changes to the view's board query. Send only the members you change; the rest keep the view's stored values (`null` clears `workflowId`, `assignee` or `due`). `sort.key` without `dir` takes that key's natural direction. An unknown member is a 422."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "org",
              "groups"
            ]
          },
          "groupIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "maxItems": 20
          }
        },
        "additionalProperties": false
      },
      "ListViewRunsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Run"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "ListUsersResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/User"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "ListGroupsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "hasMore"
        ]
      },
      "ExportRunsCsvResponse": {
        "type": "string",
        "description": "The CSV text: a header row, then one row per run (UTF-8, BOM, CRLF)."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "No usable credential. `unauthorized` — Authentication required; `invalid_api_key` — Invalid API key; `key_revoked` — API key revoked.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWW-Authenticate"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Problem"
                },
                {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "invalid_api_key",
                        "key_revoked"
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "The verb is not supported on this path. `method_not_allowed` — Method not allowed.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Allow": {
            "$ref": "#/components/headers/Allow"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Problem"
                },
                {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "method_not_allowed"
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  }
}