---
title: "Charge the scan and start the analysis"
method: POST
path: "/scans/{id}/start"
---

# Charge the scan and start the analysis

`POST /scans/{id}/start`

## Request

- Base URL: `https://api.spacecontext.app/v1`
- URL: `https://api.spacecontext.app/v1/scans/{id}/start`
- Auth: HTTP bearer

Checks that every frame (or the video) is uploaded, uses the free scan or charges the wallet, and starts the analysis. Answers 202 when it started the scan and 200 when the scan had already started. A failed analysis is refunded. Errors: 402 `PAYMENT_METHOD_REQUIRED` (a live scan needs a card on file: added in the console, nothing charged), `INSUFFICIENT_FUNDS` or `SPENDING_CAP_REACHED`, 409 `UPLOAD_INCOMPLETE`, 429 `SCANS_IN_PROGRESS`, 429 `RATE_LIMIT_EXCEEDED` with `Retry-After` when 5 live scans of the account failed that day because of their footage (no usable frame, an unreadable or too long video, nothing recognisable: each refunded) until midnight UTC, 503 `PAYMENTS_UNAVAILABLE` (a live scan where payments are not configured). Test keys are never charged and get the demo result. Needs `scans:write`.

## Path parameters

- `id` string, required

## Response `200`

Already started

- Scan
  - `object` 'scan', required
  - `id` string, required
  - `space_id` string, required
  - `livemode` boolean, required
  - `status` 'awaiting_upload' | 'queued' | 'processing' | 'complete' | 'failed' | 'cancelled', required
  - `stage` 'ingesting' | 'screening' | 'observing' | 'fusing' | 'enriching' | 'saving' | 'verifying' | 'null', nullable, required
  - `input` object, required
    - `kind` 'frames' | 'video', required
    - `language` 'en' | 'it' | 'es' | 'fr' | 'de' | 'pt' | 'nl', required: The language the report is written in.
    - `frame_count` integer, nullable, required
    - `video` object, nullable, required
      - `content_type` string
      - `content_length` integer
    - `has_transcript` boolean, required
  - `charge` object, required
    - `kind` 'free_scan' | 'scan_charge' | 'null', nullable, required
    - `price_cents` integer, required
    - `refunded` boolean, required
  - `error` object, nullable, required
    - `code` string
    - `message` string
  - `upload` object, nullable, required
    - `kind` 'frames' | 'video'
    - `method` 'PUT'
    - `url` string
    - `url_template` string
    - `headers` object: Headers the PUT must carry. Content-Length must equal the declared size (HTTP clients set it from the body).
    - `frame_count` integer
    - `max_bytes` integer
    - `content_types` string[]
    - `expires_at` string, date-time: Direct upload links only: the link must be used (the PUT started) within 15 minutes; an upload begun in time completes. Past it, `GET /scans/{id}` (with `scans:write`) gives a fresh link while the scan waits for its upload.
  - `created_at` string, date-time, nullable, required
  - `started_at` string, date-time, nullable, required
  - `completed_at` string, date-time, nullable, required

## Other responses

- `202`: Started
- `401`: Error response
- `402`: Error response
- `403`: Error response
- `404`: Error response
- `409`: Error response
- `429`: Too many requests. Retry after the number of seconds in `Retry-After`.
- `503`: Error response

---

[API](https://skmtc.dev/spacecontext/apis/space-context-api.md) · [All operations](https://skmtc.dev/spacecontext/apis/space-context-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacecontext/apis/space-context-api/revisions/1dca940259b4?raw)
