> This page is for API.

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

# Confirm uploads

POST https://api.spreadspace.app/api/documents/confirm-uploads
Content-Type: application/json

Confirms several uploaded files at once and starts processing them in one run. Up to 250 job ids per call. Each file reports its own status, so a rejected file does not fail the others. Answers 503 when the processing pipeline is not configured; a pipeline start failure is reported per file as `status: FAILED` with an `error`.

Requires the `documents:write` scope. Rate limit: 1000 requests per minute per key (the `upload` lane).

Reference: https://docs.spreadspace.app/api/api-reference/documents/confirm-uploads

## Authentication

- `Authorization` header (bearer token, required) — Bearer token. Use `ss_live_…` for live data or `ss_test_…` for the sandbox (test mode). See [Authentication](https://docs.spreadspace.app/api/authentication).

## Request

### Headers

- `Idempotency-Key` (string, optional) — Idempotency token. Retries that reuse the key within 24h replay the original response. Up to 255 characters; a UUID is typical. See [Idempotency](https://docs.spreadspace.app/api/idempotency).
- `SpreadSpace-Version` (string, optional) — Pin the API version, e.g. `2026-10-07`. Omit to get the latest. See [Versioning](https://docs.spreadspace.app/api/versioning).

### Body (application/json)

This endpoint expects a BatchConfirmRequest.

- `job_ids` (list of string, required)
- `sample_document` (string, optional, nullable) — Test mode only: selects which sample document every job in this batch returns. Must be one of the published sample document ids (any other value is a 400); ignored on live keys.

## Response

### 200

OK

- `results` (list of BatchJobResult, required)
- `sample` (boolean, optional, nullable) — `true` when these results are test-mode sample data rather than a real extraction. Omitted on live responses.

### 202

Accepted

- `results` (list of BatchJobResult, required)
- `sample` (boolean, optional, nullable) — `true` when these results are test-mode sample data rather than a real extraction. Omitted on live responses.

## Errors

### 400 Bad Request Error

Bad request: validation failed, the cursor is malformed, or the API version is unknown.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 401 Unauthorized Error

Unauthorized: the bearer token or API key is missing or invalid.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 402 Payment Required Error

Payment required: the standard error envelope whose `type` says why: `subscription_required` (no active or trialing subscription), `spend_cap_reached` (the workspace's monthly usage limit is used up), or `insufficient_credits` (the prepaid balance cannot cover this upload; `details` carries `balance_usd`, `reserved_usd`, `in_flight_docs`, `incoming_docs` and `per_doc_reservation_usd` as decimal strings).

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 403 Forbidden Error

Forbidden: authentication succeeded but the caller is not permitted to perform this action, for example an API key missing the required scope, an embed session reaching a loan it was not minted for, or a feature outside the workspace's plan.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 404 Not Found Error

Not found: the resource does not exist or is not visible to the calling tenant.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 409 Conflict Error

Conflict: a version mismatch, where `details.current_version` carries the version the resource is actually at so the client can reload and re-apply, or an idempotency key reused with a different request body.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 429 Too Many Requests Error

Too many requests: the standard error envelope with `type` `rate_limited` (the endpoint's rate budget), `idempotency_in_progress` (a request with the same `Idempotency-Key` is still executing) or `usage_throttled` (the workspace is under an admission throttle). Honor `Retry-After`.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 500 Internal Server Error

Internal server error: an unexpected failure. Quote the `request_id` in support tickets. A mutation sent with an `Idempotency-Key` replays this fault under that key rather than re-running; confirm the resource state before resending with a new key.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 503 Service Unavailable Error

Service unavailable: the operation cannot run right now and nothing was changed. Retry, after `Retry-After` when the response carries it.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

## Types

### BatchJobResult

- `job_id` (string, required)
- `status` (enum, required)
  - Allowed values: `PROCESSING`, `DUPLICATE`, `FAILED`, `ERROR`
- `child_jobs` (list of BatchChildJob, optional, nullable)
- `error` (string, optional, nullable)

### ApiErrorBody

Inner body of the canonical API error envelope.

- `type` (string, required) — Stable error type identifier. Pattern-match on this value, not the human-readable message.
- `message` (string, required) — Human-readable error message. Subject to wording changes; do not parse.
- `request_id` (string, optional, nullable) — Per-request correlation ID (matches `X-Request-ID` response header). Quote in support tickets.
- `details` (map from string to string, optional, nullable) — Structured detail. Some error types populate documented keys in every environment: a version conflict (409) carries `current_version`, the version the resource is actually at, so the client can reload and re-apply. Free-form diagnostic detail beyond those keys appears in development environments only. An `insufficient_credits` 402 carries `balance_usd`, `reserved_usd`, `in_flight_docs`, `incoming_docs` and `per_doc_reservation_usd` as decimal strings.

### BatchChildJob

- `job_id` (string, required)
- `file_name` (string, required)
- `status` (enum, optional) — Terminal status for this entry when it was rejected on its own: `FAILED` (a paused format such as HTML or a spreadsheet) or `DUPLICATE` (the same content was already uploaded). Omitted when the entry proceeds normally, and the parent job's status applies.
  - Allowed values: `FAILED`, `DUPLICATE`
- `error` (string, optional, nullable) — Message explaining a `FAILED` or `DUPLICATE` status. Null otherwise.

## Examples

**Request**

```json
{
  "job_ids": [
    "9f8b7c6d5e4a3b2c1d0e9f8a"
  ]
}
```

**Response**

```json
{
  "results": [
    {
      "job_id": "9f8b7c6d5e4a3b2c1d0e9f8a",
      "status": "PROCESSING",
      "child_jobs": null,
      "error": null
    },
    {
      "job_id": "1a2b3c4d5e6f789012345678",
      "status": "DUPLICATE",
      "child_jobs": null,
      "error": "Duplicate of \"bank_statement_jan_2024.pdf\". This file has already been extracted for this loan. Skipped re-processing to avoid duplicate charges and duplicate entries."
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.spreadspace.app/api/documents/confirm-uploads"

payload = { "job_ids": ["9f8b7c6d5e4a3b2c1d0e9f8a"] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.spreadspace.app/api/documents/confirm-uploads';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"job_ids":["9f8b7c6d5e4a3b2c1d0e9f8a"]}'
};

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.spreadspace.app/api/documents/confirm-uploads"

	payload := strings.NewReader("{\n  \"job_ids\": [\n    \"9f8b7c6d5e4a3b2c1d0e9f8a\"\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.spreadspace.app/api/documents/confirm-uploads")

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  \"job_ids\": [\n    \"9f8b7c6d5e4a3b2c1d0e9f8a\"\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.spreadspace.app/api/documents/confirm-uploads")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"job_ids\": [\n    \"9f8b7c6d5e4a3b2c1d0e9f8a\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.spreadspace.app/api/documents/confirm-uploads', [
  'body' => '{
  "job_ids": [
    "9f8b7c6d5e4a3b2c1d0e9f8a"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.spreadspace.app/api/documents/confirm-uploads");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"job_ids\": [\n    \"9f8b7c6d5e4a3b2c1d0e9f8a\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["job_ids": ["9f8b7c6d5e4a3b2c1d0e9f8a"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.spreadspace.app/api/documents/confirm-uploads")! 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()
```