For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog in
DocumentationAPI ReferenceModel VersioningChangelog
DocumentationAPI ReferenceModel VersioningChangelog
    • Studio
    • Support
    • Benchmarks
    • Status
  • Getting Started
    • Overview
    • API Quickstart
    • Dashboard Quickstart
    • Agent Quickstart
  • Dev Tools
    • SDKs
    • CLI
  • Capabilities
      • Overview
      • Configuration
      • Response Format
      • Best Practices
      • Error Handling
      • Generate Edit Schema
LogoLogo
Book a demoLog in
On this page
  • Quick start
  • Response
  • Request configuration
  • A common workflow
CapabilitiesEditing

Generate Edit Schema

Was this page helpful?
Previous

Overview

Next
Built with

Generate Edit Schema detects the fields in a PDF form and returns an edit schema you can pass straight to /edit or /edit_runs. The returned schema has field positions annotated, so you don’t have to write extend_edit:bbox coordinates by hand. Optionally, supply your own schema and Extend maps it onto the detected fields.

Reach for it when you:

  • Need a starter schema for a new PDF form.
  • Want to map an existing schema onto a vendor-specific layout.
  • Need annotated field locations before running edits at scale.
  • Want to add conditional form logic on top of detected fields.

This endpoint is synchronous and returns the generated schema directly — there are no schema-generation run objects to poll or delete.

Quick start

We’ll detect the fields in a PDF form. Grab a key from the Developers page and store it as the EXTEND_API_KEY environment variable. If you’re using an SDK, see the installation instructions.

$export EXTEND_API_KEY="your_api_key_here"
Python
TypeScript
Java
Go
cURL
1import os
2from extend_ai import Extend
3
4client = Extend(token=os.environ["EXTEND_API_KEY"])
5
6result = client.edit_schemas.generate(
7 file={"url": "https://example.com/form.pdf"},
8 config={
9 "instructions": "Detect the form fields and use human-readable field names.",
10 "advancedOptions": {"radioEnumsEnabled": True},
11 },
12)
13
14print(result)

Response

The response contains the generated schema and optional mapping metadata.

FieldTypeDescription
schemaobjectThe final generated schema after mapping. If no inputSchema was provided, this is the same as annotatedSchema. Pass it to /edit or /edit_runs.
annotatedSchemaobject | nullThe original schema detected from the file, annotated with field locations.
mappingResultobject | nullPresent when you provide an inputSchema. Contains matches, unmatchedInputPaths, and unusedFormFieldKeys.

Request configuration

The config object is an edit schema generation config:

FieldTypeDescription
inputSchemaobjectAn existing edit schema to map onto the detected form fields. When provided, the response includes a mappingResult.
instructionsstringCustom instructions for field detection and naming.
advancedOptions.tableParsingEnabledbooleanParse table regions as arrays of objects. Defaults to false.
advancedOptions.radioEnumsEnabledbooleanModel radio fields as enums so only one widget in a group is selected. Defaults to false.
advancedOptions.nativeFieldsOnlybooleanOnly use native AcroForm fields from the PDF and skip object detection. Defaults to false.

A common workflow

The generated schema uses the same format as edit runs, including support for root-level JSON Schema conditionals. A common workflow is:

  1. Generate a base schema from the PDF form.
  2. Add conditional requirements for follow-up fields.
  3. Use the refined schema with /edit or /edit_runs.

For the exact request and response schemas, see the Generate Edit Schema API reference.