Send a DWG or DXF file, get back every text entity's exact string and position as JSON — read from the drawing's own TEXT, MTEXT, attribute, dimension, leader, and table entities, not recognized from pixels.
See the DWG to Text tool page, or the docs index for authentication, the shared request/webhook contract, and the generic error table.
POST /webhooks/trigger — same endpoint and fields as every tool, with tool="dwg-to-text" set explicitly (it's not the default).
curl -X POST https://api.anyconvert.app/webhooks/trigger \ -H "x-api-key: your_api_key_here" \ -F "file=@site-plan.dwg" \ -F "fileId=drawing-001" \ -F "referenceId=reference-001" \ -F "tool=dwg-to-text"
An optional options multipart field carrying a JSON object, validated synchronously before a credit is charged — a bad value is rejected with 400, not charged and not queued. Every item carries a conf of 1.0 and a source of dwg-entity — this is exact text, not OCR.
| layouts | string, optional | Default "model". "model", "all", or a list of paper-space layout names. |
| granularity | string, optional | Default "entity" — one item per text entity (multi-line text split into lines), or "word" to also split each line into words. |
| includeHidden | boolean, optional | Default true — include invisible attributes and text on frozen or off layers, flagged rather than removed. |
| includeDefinitions | boolean, optional | Default false — include block-definition template text that isn't placed in any layout. |
| includeRaw | boolean, optional | Default false — keep the undecoded string alongside the decoded one. |
| coordinateSpace | string, optional | Default "page" (aligned with the DWG to PDF output), "world" (drawing units only), or "both". |
| units | string, optional | "drawing" (default) or "mm" for world coordinates. |
The webhook delivers a .json file (not a DWG): every text item's string, position in drawing and page coordinates, source entity (type, layer, block path), and flags (hidden, mirrored, computed, and similar). A per-layout diagnostics block lists entity counts and anything skipped.
Billed per page, not per document — 1 credit for every 5 pages, rounded up. This sits at the same rate as PDF OCR, reflecting the entity-walking and coordinate-transform work behind every page rather than a simple page count.
Delivered via the webhook as outcome=failure with a reason below — see the docs index for the full delivery shape.
| invalid_options | A bad or unknown option, or an unknown layout name. |
| dwg_conversion_failed | The DWG reader itself failed on the file. |
| empty_modelspace | The drawing has no entities at all in the selected layouts. |
| no_extractable_text | The drawing has entities, but none carry any text. |
| invalid_file | The file could not be read, or was not the format this tool expects. |
| render_failed | Something failed during conversion that wasn’t a problem with the input itself. |
| timeout | The job did not finish within its time budget. |
| internal_error | An unexpected error on our side. |