---
title: "Start a takeoff on a document"
method: POST
path: "/takeoffs"
tags: ["Takeoffs"]
---

# Start a takeoff on a document

`POST /takeoffs`

## Request

- Base URL: `https://api.aginera.ai/partner/v1`
- URL: `https://api.aginera.ai/partner/v1/takeoffs`
- Auth: OAuth 2 (authorization code, authorization URL `https://auth.aginera.ai/oauth/authorize`, token URL `https://auth.aginera.ai/oauth/token`; client credentials, token URL `https://login.microsoftonline.com/65f567a9-6e6a-4f81-863c-aea4ece1f8eb/oauth2/v2.0/token`, scopes: `takeoffs:run`)

Places a credit hold for the maximum plausible cost (estimated_credits) and queues the job. The final charge never exceeds the hold. 402 insufficient_credits if the hold cannot be placed.

## Headers

- `Idempotency-Key` string: Replays within 24 hours return the original response.

## Request body

- TakeoffCreate
  - `document_id` string, required
  - `discipline` 'electrical' | 'mechanical' | 'plumbing' | 'fire_protection' | 'process' | 'structural' | 'multi_discipline', required
  - `pages` integer[]: 1-based page numbers. Omit for all pages.
  - `scope` 'full' | 'pages'
  - `external_ref` string: Your own identifier for this resource; unique per tenant.
  - `options` object
    - `include_schedules` boolean
    - `units` 'imperial' | 'metric' | 'as_drawn'
    - `depth` 'standard' | 'deep'
  - `metadata` Metadata

## Response `202`

OK

- Takeoff
  - `id` string, required
  - `document_id` string, required
  - `project_id` string, required
  - `discipline` 'electrical' | 'mechanical' | 'plumbing' | 'fire_protection' | 'process' | 'structural' | 'multi_discipline', required
  - `status` 'queued' | 'processing' | 'completed' | 'failed' | 'cancelled', required
  - `external_ref` string, nullable, required
  - `progress` Progress, required
    - `percent` integer, required
    - `pages_processed` integer
    - `pages_total` integer
  - `queue_position` integer
  - `origin` 'api' | 'web_app': api = started through the API or an agent; web_app = a completed extraction run in the Aginera web app (read-only here; credits were billed by the app, so estimated_credits and credits_charged are 0).
  - `pages_requested` integer, required
  - `estimated_credits` number, required: Maximum that will be charged; the final charge never exceeds it.
  - `result_summary` object
    - `item_count` integer, required
    - `sheet_count` integer, required
    - `pages_processed` integer
    - `credits_charged` number, required
    - `route_count` integer
    - `schedule_count` integer
    - `by_trade` object
  - `warnings` Warning[], required
    - `code` 'discipline_mismatch' | 'scanned_pages_low_quality' | 'pages_skipped_no_content' | 'no_items_found' | 'partial_pages_failed' | 'duplicate_document' | 'pages_not_read' | 'free_plan_sheets', required
    - `message` string, required
    - `pages` integer[]
  - `failure` Failure
    - `code` 'document_unreadable' | 'unsupported_content' | 'no_pages_selected' | 'capacity' | 'cancelled' | 'internal', required
    - `message` string, required
  - `metadata` object, required
  - `created_at` string, date-time, required
  - `started_at` string, date-time, nullable, required
  - `completed_at` string, date-time, nullable, required

## Other responses

- `402`: Insufficient credits
- `default`: Error (RFC 7807)

---

[API](https://skmtc.dev/aginera/apis/aginera-takeoff-estimation-api.md) · [All operations](https://skmtc.dev/aginera/apis/aginera-takeoff-estimation-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aginera/apis/aginera-takeoff-estimation-api/revisions/39115958da1e?raw)
