> This page is for Paperwork API, version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.cloudraker.com/paperwork/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Run several capabilities over one set of files

POST https://api.cloudraker.com/v1/spaces/{spaceId}/pipeline
Content-Type: application/json

Runs several capabilities over one set of files in a single call.

Every file is parsed once, then each step runs over the parsed set — **in parallel, not chained**. A step never consumes another step's output.

**A step is one of:**

* `{ "extract": {…} }`, `{ "redact": {…} }`, `{ "fill": {…} }`, `{ "sign": {…} }` — the same inline config the matching verb takes.
* `{ "action": "act_… | slug", "params": {…} }` — a [saved action](https://docs.cloudraker.com/api/cloud-raker-api/actions/get-action).

There is no `parse` step: parsing is automatic.

**Always asynchronous.** The response is `202` carrying the run id and one `{id, capability}` per step. Poll [the run](https://docs.cloudraker.com/api/cloud-raker-api/runs/get-run) — its `steps[]` reports each step's status and result under the id you were handed at create.

```json
{
  "files": [{ "id": "a04d6597-4e34-4a99-94ea-964c289a4c68" }],
  "steps": [
    { "extract": { "schema": { "type": "object", "properties": { "business_name": { "type": ["string", "null"] } } } } },
    { "redact": { "mode": "targeted" } }
  ]
}
```

**Learn more:** [Pipeline guide](https://docs.cloudraker.com/capabilities/pipeline)

Reference: https://docs.cloudraker.com/paperwork/api/spaces/space-pipeline

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `spaceId` (string, required)

### Body (application/json)

This endpoint expects a V1PipelineBody.

- `files` (list of V1PipelineBodyFilesItems, required) — The input files, up to 100. They are parsed once and every step sees the same parsed set.
- `steps` (list of V1PipelineStep, required) — What to run over the files — up to 20 steps, executed in parallel rather than chained. Each step is either an inline capability config (`{ "extract": {…} }`, `{ "redact": {…} }`, `{ "fill": {…} }`, `{ "sign": {…} }`) or a saved action (`{ "action": "…", "params": {…} }`). There is no `parse` step: parsing is automatic. A step never consumes another step's output.
- `metadata` (map from string to any, optional) — Arbitrary JSON you attach to the run and get back on every read of it. Use it to carry your own identifiers — an order number, a customer id — so a webhook or a polled run reconciles without a lookup table. Capped at 10 KB serialized.
- `webhook` (V1PipelineBodyWebhook, optional) — Where to deliver this run's events, given one of two ways. * `{ "url": "…" }` — a one-off https endpoint for this run only. * `{ "id": "whe_…" }` — a saved endpoint from `POST /v1/webhooks`. Runs hold the reference, so pausing or re-pointing that endpoint applies to this run too. Deliveries are at-least-once and signed — dedupe on `eventId` and verify against `GET /v1/webhooks/jwks.json`.
- `ttl` (integer, optional, default: 86400) — How long, in seconds, to keep this run and its files before purging them automatically. The maximum is 604800 (7 days). The deadline comes back as `expiresAt` on every read of the run. Call `POST /v1/runs/{id}/keep` before then to clear the TTL and move the results into a space permanently. E-signature runs are exempt — an envelope waits for its signers however long that takes.

## Response

### 202

Accepted.

- `object` ("pipeline_run", required)
- `id` (string, required)
- `status` (enum, required) — Where the run is in its life. | Status | Meaning | | --- | --- | | `queued` | Accepted, not started | | `processing` | Work in flight | | `needs_input` | Waiting for an external action, such as an e-signature | | `processed` | Finished; `output` is populated | | `failed` | Finished unsuccessfully | | `cancelled` | Stopped on request | | `expired` | TTL elapsed and the data was purged | The last four are terminal.
  - Allowed values: `queued`, `processing`, `processed`, `failed`, `cancelled`, `expired`, `needs_input`
- `statusUrl` (string, required)
- `steps` (list of V1PipelineAcceptedStepsItems, required)

## Errors

### 400 Bad Request Error

Invalid request (`invalid_request` / `invalid_schema`).

- `any`

### 422 Unprocessable Entity Error

Unusable input file or webhook endpoint.

- `any`

### 429 Too Many Requests Error

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

- `code` (enum, required)
  - Allowed values: `rate_limited`
- `message` (string, required)
- `retryable` (boolean, required)
- `requestId` (string, required)
- `docUrl` (string, optional)

## Types

### V1PipelineBodyFilesItems

An input file, given one of two ways. * `{ "url": "…", "name"?: "…", "processing"?: "…" }` — fetched over http(s) for this run and purged with it. * `{ "id": "…" }` — a file you already registered with `POST /v1/files`, reusable across runs and never re-parsed. * `{ "id": "…", "ephemeral": true }` — a file you uploaded only for this run, purged with it. Use it only on a file no other run uses.

- V1PipelineBodyFilesItems0
- V1PipelineBodyFilesItems1

### V1PipelineStep

- V1PipelineStep0
- V1PipelineStep1
- V1PipelineStep2
- V1PipelineStep3
- V1PipelineStep4
- V1PipelineStep5

### V1PipelineBodyWebhook

Where to deliver this run's events, given one of two ways. * `{ "url": "…" }` — a one-off https endpoint for this run only. * `{ "id": "whe_…" }` — a saved endpoint from `POST /v1/webhooks`. Runs hold the reference, so pausing or re-pointing that endpoint applies to this run too. Deliveries are at-least-once and signed — dedupe on `eventId` and verify against `GET /v1/webhooks/jwks.json`.

- V1PipelineBodyWebhook0
- V1PipelineBodyWebhook1

### V1PipelineAcceptedStepsItems

- `id` (string, required, nullable)
- `capability` (enum, required)
  - Allowed values: `extract`, `parse`, `redact`, `fill`, `sign`, `classify`, `split`, `action`

### V1PipelineBodyFilesItems0

- `url` (string, required)
- `name` (string, optional)
- `processing` (enum, optional)
  - Allowed values: `auto`, `ocr`, `simple`, `transcribe`, `transcribe_diarize`

### V1PipelineBodyFilesItems1

- `id` (string, required)
- `ephemeral` (boolean, optional) — Purge this file with the run (TTL expiry or `DELETE /v1/runs/{id}`), unless you `keep` the run. API workspace only: ignored under `/v1/spaces/{spaceId}/…`.

### V1PipelineStep0

- `extract` (V1PipelineStepOneOf0Extract, required)

### V1PipelineStep1

- `redact` (V1PipelineStepOneOf1Redact, required)

### V1PipelineStep2

- `fill` (V1PipelineStepOneOf2Fill, required)

### V1PipelineStep3

- `sign` (V1PipelineStepOneOf3Sign, required)

### V1PipelineStep4

- `parse` (map from string to any, required)

### V1PipelineStep5

- `action` (string, required)
- `config` (map from string to any, optional)
- `params` (map from string to any, optional)

### V1PipelineBodyWebhook0

- `url` (string, required)

### V1PipelineBodyWebhook1

- `id` (string, required)

### V1PipelineStepOneOf0Extract

- `schema` (map from string to any, optional) — The shape to extract, as a JSON Schema object. Send `action` instead to use a saved shape, or neither to have one inferred. The root must be `{"type": "object"}`. The dialect is deliberately narrow — no `$ref`, `$defs`, `oneOf`, `anyOf`, `allOf`, `const` or `pattern` — with a maximum nesting depth of 5 and a 64 KB size limit. Make primitives nullable (`{"type": ["string", "null"]}`) so a missing value reads as `null` rather than a hallucination.
- `action` (string, optional) — A saved action to run, by id or slug. An alternative to `schema`. The action carries the output shape and any saved settings. Config you send inline on the same call is merged over it, so `action` plus `instructions` refines a saved action for one run without redefining it.
- `hints` (string, optional) — Prose guidance for **schema inference** — only valid when you send neither `schema` nor `action`. Say what the documents are and what matters in them ("freight bills of lading; I care about the load number, the shipper and the total") and the shape is inferred from the document itself. Sending `hints` alongside `schema` or `action` is a `400`: the shape is already decided.
- `instructions` (string, optional) — Free-form guidance for the extraction, applied on top of the schema — house rules, formatting preferences, how to handle ambiguity.
- `citations` (boolean, optional) — Whether to ground each extracted value in the source document. Off by default — grounding is an explicit add-on, so send `citations: true` to ask for it. When on, `output.citations` maps every extracted field to where it came from — `fileId` plus page and bounding box for documents, or `timecodeStart`/`timecodeEnd` for audio. A field the documents simply do not contain comes back as an entry with `notFound: true` and no location.
- `unit` (enum, optional) — What one extraction result covers. - `per_document`: one result object per file (the default). - `across_documents`: one result object for the whole set. The files are read together as one source, in the order you list them, so a recording split into parts reads as one recording. Audio mixed with documents cannot be read as one source: each file is then extracted on its own and the results are merged. - `rows_per_document`: a list of results per file, for documents that hold repeated records.
  - Allowed values: `per_document`, `across_documents`, `rows_per_document`
- `judge` (boolean, optional) — Run a second review pass that scores each extracted value against the evidence it cites, adding a `confidence` (0–5) and leaving the values themselves alone. **It is the only pass that scores**: grounding cites without grading, so an unjudged run returns citations with no `confidence`. Slower and more thorough; worth it on documents where an error is expensive. **The judge audits citations, so it needs `citations: true`.** It scores cited evidence and never re-extracts, so with grounding off there is nothing for it to audit. Sending `judge: true` with `citations: false` is a `400`. When you name an `action`, the saved config's `citations` setting counts — a judge on a saved action that does not ground does nothing.

### V1PipelineStepOneOf1Redact

- `categories` (list of string, optional) — What counts as sensitive, as free text, not an enum. Each hit reports back under the label you asked for, copied exactly. **This list replaces the [defaults](https://docs.cloudraker.com/capabilities/redact#what-counts-as-sensitive); it does not extend them.** Sending a shorter list leaves everything outside it in the file. To keep the defaults and add to them, repeat the defaults next to your own entries.
- `instructions` (string, optional)
- `mode` (enum, optional)
  - Allowed values: `targeted`, `lines`
- `style` (enum, optional)
  - Allowed values: `beep`, `silence`
- `action` (string, optional)

### V1PipelineStepOneOf2Fill

- `template` (V1PipelineStepOneOf2FillTemplate, optional) — The blank form to fill, given one of two ways. * `{ "id": "…" }` — a saved template from `POST /v1/templates`, or any file you own. * `{ "url": "…", "name"?: "…" }` — fetched for this run only and purged with it. Optional when `action` names a saved config that carries one — sending it inline still wins.
- `instructions` (string, optional) — Free-form guidance for the drafting pass — which source document wins a conflict, how to format dates, which fields to leave blank.
- `output` (enum, optional) — What the produced PDF looks like. `flattened` (the default) bakes the values in so nothing can be changed; `editable` leaves the form fillable.
  - Allowed values: `flattened`, `editable`
- `action` (string, optional) — A saved fill action to run, by id or slug. Config you send inline is merged over the saved config.

### V1PipelineStepOneOf3Sign

- `signers` (list of V1PipelineStepOneOf3SignSignersItems, required) — Who can sign — up to 50 people, each with a `name` and an `email`. Omitted `routingOrder` means everyone signs in parallel. Set increasing steps for ordered signing; use a shared `signingGroup` for any-one signing. Every signer verifies their email with a one-time code, then signs by typing their name. Track them individually at `GET /v1/runs/{id}/envelope`.
- `expiresInDays` (integer, optional, default: 7) — Days recipients have to complete signing, measured from dispatch. From 1 to 90; defaults to 7.
- `templateId` (string, optional) — Identifies the template your org signs delegated envelopes from. Consent is granted per template, so this is the scope the signer agrees to. A document produced by `POST /v1/compose` or `POST /v1/fill` carries its template sealed inside it and that value is used; this field is then ignored. Send it only for a delegated envelope whose document has no sealed template. Ignored when no signer is `delegated`.
- `templateName` (string, optional) — Human-readable name of that template. Shown to the signer when their consent is requested, and printed on the audit page of every document signed under it. Like `templateId`, the value sealed into a composed or filled document wins. Required when any `signers[]` entry has `delegated: true` and the document carries no sealed template name: either the document has no seal, or its seal has no name. In the second case, also send the sealed `templateId`, or the run fails. Ignored otherwise.
- `message` (string, optional) — A note included in the invitation email each signer receives.
- `placement` (enum, optional, default: page) — Where signatures land in the document. `page` appends a signature certificate page. `tags` replaces `[Signature N]` placeholders for each required signing slot. Optional `[Initials N]` and `[Date N]` tags add initials and signing dates. Any-one groups share their `fieldIndex` slot.
  - Allowed values: `page`, `tags`
- `cc` (list of V1PipelineStepOneOf3SignCcItems, optional) — Informed-only recipients. CC parties do not sign, receive no OTP or signature tag, and are emailed the sealed document when the envelope completes.
- `language` (enum, optional, default: en) — Language of every recipient-facing asset — invitation and code emails, the signing page, and the audit certificate. Applies to all signers and CC parties. Defaults to en.
  - Allowed values: `en`, `fr`

### V1PipelineStepOneOf2FillTemplate

The blank form to fill, given one of two ways. * `{ "id": "…" }` — a saved template from `POST /v1/templates`, or any file you own. * `{ "url": "…", "name"?: "…" }` — fetched for this run only and purged with it. Optional when `action` names a saved config that carries one — sending it inline still wins.

- V1PipelineStepOneOf2FillTemplate0
- V1PipelineStepOneOf2FillTemplate1

### V1PipelineStepOneOf3SignSignersItems

- `name` (string, required)
- `email` (string, required)
- `delegated` (boolean, optional, default: false) — True if your organization signs on this person’s behalf instead of them signing directly. Requires the e-signature-delegation entitlement and `templateId`. Ignored on `cc`.
- `routingOrder` (integer, optional, default: 1) — Signing step. People in the same step sign in parallel; later steps wait.
- `signingGroup` (string, optional) — People with the same group share one signing slot. The first to sign completes it.
- `fieldIndex` (integer, optional) — Document tag number. A group shares one number; otherwise defaults to roster position.

### V1PipelineStepOneOf3SignCcItems

- `name` (string, required)
- `email` (string, required)
- `delegated` (boolean, optional, default: false) — True if your organization signs on this person’s behalf instead of them signing directly. Requires the e-signature-delegation entitlement and `templateId`. Ignored on `cc`.

### V1PipelineStepOneOf2FillTemplate0

- `id` (string, required)

### V1PipelineStepOneOf2FillTemplate1

- `url` (string, required)
- `name` (string, optional)

## Examples

**Request**

```json
{
  "files": [
    {
      "url": "string"
    }
  ],
  "steps": [
    {
      "extract": {}
    }
  ]
}
```

**Response**

```json
{
  "object": "string",
  "id": "string",
  "status": "queued",
  "statusUrl": "string",
  "steps": [
    {
      "id": "string",
      "capability": "extract"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/v1/spaces/spaceId/pipeline"

payload = {
    "files": [{ "url": "string" }],
    "steps": [{ "extract": {} }]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/v1/spaces/spaceId/pipeline';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"files":[{"url":"string"}],"steps":[{"extract":{}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cloudraker.com/v1/spaces/spaceId/pipeline"

	payload := strings.NewReader("{\n  \"files\": [\n    {\n      \"url\": \"string\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"extract\": {}\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/v1/spaces/spaceId/pipeline")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"files\": [\n    {\n      \"url\": \"string\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"extract\": {}\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cloudraker.com/v1/spaces/spaceId/pipeline")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"files\": [\n    {\n      \"url\": \"string\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"extract\": {}\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cloudraker.com/v1/spaces/spaceId/pipeline', [
  'body' => '{
  "files": [
    {
      "url": "string"
    }
  ],
  "steps": [
    {
      "extract": {}
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/v1/spaces/spaceId/pipeline");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"files\": [\n    {\n      \"url\": \"string\"\n    }\n  ],\n  \"steps\": [\n    {\n      \"extract\": {}\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "files": [["url": "string"]],
  "steps": [["extract": []]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/v1/spaces/spaceId/pipeline")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```