> 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/api/cloud-raker-api/spaces/space-pipeline

## Authentication

- `Authorization` header (bearer token, required)

## Request

### Path parameters

- `spaceId` (string, required)

### Body (application/json)

- `files` (list of object or object, required) — The input files, up to 100. They are parsed once and every step sees the same parsed set.
  - object
    - `url` (string, required)
    - `name` (string, optional)
    - `processing` (enum, optional)
      - Allowed values: `auto`, `ocr`, `simple`, `transcribe`, `transcribe_diarize`
  - object
    - `id` (string, required)
- `steps` (list of object or object or object or object or object or object, 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.
  - object
    - `extract` (object, required)
      - `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 a timecode 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, read as a single body of evidence. - `rows_per_document` — a list of results per file, for documents that hold repeated records.
        - Allowed values: `per_document`, `across_documents`, `rows_per_document`
      - `model` (string, optional) — Pin the extraction to a specific model. Leave it unset to use the current default, which tracks the best available.
      - `judge` (boolean, optional) — Run a second review pass over the extracted values to catch mistakes. Slower and more thorough — worth it on documents where an error is expensive.
  - object
    - `redact` (object, required)
      - `categories` (list of string, optional)
      - `instructions` (string, optional)
      - `mode` (enum, optional)
        - Allowed values: `targeted`, `lines`
      - `style` (enum, optional)
        - Allowed values: `beep`, `silence`
      - `action` (string, optional)
  - object
    - `fill` (object, required)
      - `template` (object or object, required) — 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.
        - object
          - `id` (string, required)
        - object
          - `url` (string, required)
          - `name` (string, optional)
      - `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.
      - `review` (enum, optional) — Whether a person checks the drafted values before the form is produced. `none` (the default) fills and finishes. `required` parks the run at `needs_input` with one task per document — read it at `GET /v1/runs/{id}/task`, submit corrections to `POST /v1/runs/{id}/task`, or send someone to the ready-made page at `tasks[].url`.
        - Allowed values: `none`, `required`
      - `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.
  - object
    - `sign` (object, required)
      - `signers` (list of object, required) — Who has to sign, in order — up to 50 people, each with a `name` and an `email`. 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`.
        - `name` (string, required)
        - `email` (string, required)
      - `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` puts each signer's stamp over a `[Signature N]` placeholder already present in the document — every signer needs one, or the run fails.
        - Allowed values: `page`, `tags`
  - object
    - `parse` (map from string to any, required)
  - object
    - `action` (string, required)
    - `config` (map from string to any, optional)
    - `params` (map from string to any, optional)
- `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` (object or object, 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`.
  - object
    - `url` (string, required)
  - object
    - `id` (string, required)
- `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` | Parked for a person — see `tasks[]` | | `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 object, required)
  - `id` (string, required, nullable)
  - `capability` (enum, required)
    - Allowed values: `extract`, `parse`, `redact`, `fill`, `sign`, `action`

## 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**

```typescript
import { CloudRakerClient } from "@cloudraker/api";

async function main() {
    const client = new CloudRakerClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.spaces.spacePipeline({
        spaceId: "spaceId",
        body: {
            files: [
                {
                    url: "string",
                },
            ],
            steps: [
                {
                    extract: {},
                },
            ],
        },
    });
}
main();

```

```python
from cloudraker import CloudRaker, V1PipelineBodyFilesItemName, V1PipelineStepExtract, V1PipelineStepExtractExtract

client = CloudRaker(
    token="YOUR_TOKEN_HERE",
)

client.spaces.space_pipeline(
    space_id="spaceId",
    files=[
        V1PipelineBodyFilesItemName(
            url="string",
        )
    ],
    steps=[
        V1PipelineStepExtract(
            extract=V1PipelineStepExtractExtract(),
        )
    ],
)

```

```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()
```