We collect minimal analytics to understand how the site is used. If you decline, we do not load analytics.
Docs/Endpoints/POST /drawings/detection/rooms
POST/v1/drawings/detection/rooms

Detects rooms in an architectural floor plan PDF. This is an async job — it returns immediately with a job ID and you poll for the detections. Returns bounding boxes, polygons, and, when available, the room number and label extracted from nearby plan text. Detections are in PDF coordinate space.

Floor plansAsync · 202

Request

↑

This endpoint requires a document_id. Upload your PDF first →

Auth via X-API-Key header (or a bearer token). Body is JSON — this endpoint does not accept file uploads directly.

document_idreq
string (UUID)
UUID of a document uploaded via POST /v1/documents. Must belong to this account and not be expired.
page_numbers
int[]
1-based page numbers to scan. Omit to scan the whole document.
webhook_url
string
URL to notify when the job finishes.
confidence_min
number
Minimum detection confidence. Defaults to 0.5.
use_gpu
boolean
Route the job to the GPU queue.

There are additional optional inference overrides (model_type, model_key, target_longest_edge, etc.) for advanced use; all default to server-side values when omitted.

Code examples

curl -X POST https://api.anchorgrid.ai/v1/drawings/detection/rooms \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "document_id": "550e8400-e29b-41d4-a716-446655440000",
    "page_numbers": [1, 2],
    "confidence_min": 0.5
  }'

Response — 202 Accepted

The job is enqueued immediately. Poll GET /v1/jobs/{job_id} until status is complete or failed.

job_id
string
Use this to poll for results.
status
string
Always queued on this response.
poll_url
string
Path only — prepend https://api.anchorgrid.ai to build the full URL.

Result shape

When status === "complete", the result field on the job (fetched via GET /v1/jobs/{job_id}) contains:

document_id
string
UUID of the source document.
rooms_found
integer
Total number of rooms detected.
pages_analyzed
integer
Number of pages that were scanned.
model_version
string
Version of the room-detector model used.
processing_time_ms
integer
Wall-clock processing time, in milliseconds.
rooms
array
One entry per detected room.
rooms[].id
string
Stable room identifier.
rooms[].page
integer
1-based PDF page index where the room was detected.
rooms[].bbox
object
Axis-aligned bounding box in PDF point coordinates: x1, y1, x2, y2.
rooms[].polygon
[number, number][]
Room outline as an ordered list of [x, y] points, in PDF point coordinates.
rooms[].confidence
number
Detection confidence score.
rooms[].class_label
string
Detector class, e.g. "room".
rooms[].room_number
string | null
Room number extracted from nearby plan text, when available.
rooms[].label
string | null
Room name/label extracted from nearby plan text, when available.
rooms[].area
number
Room area in square PDF points (1/72 in), computed from the polygon when available, otherwise from the bbox.
total_area
number
Sum of rooms[].area across all detected rooms, in square PDF points.

Errors

401
Missing or invalid X-API-Key.
404
document_id not found or expired.
422
Validation error — malformed UUID or invalid body.
503
Task queue unavailable — retry.

Response Preview

202 OK
{
  "job_id": "abc123...",
  "status": "queued",
  "poll_url": "/v1/jobs/abc123..."
}