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
    • Authentication
    • API Versioning
    • Deployments
    • Error Handling
  • Endpoints
      • POSTEdit File (Sync)
      • POSTEdit File (Async)
      • GETGet Edit Run
      • DELDelete Edit Run
      • GETGet Edit Template
      • POSTGenerate Edit Schema
  • Webhook Events
LogoLogo
Book a demoLog in
EndpointsEdit

Generate Edit Schema

POST
/edit_schemas/generate
POST
/edit_schemas/generate
1from extend_ai import Extend, FileFromUrl, EditSchemaGenerationConfig, EditSchemaGenerationConfigAdvancedOptions
2
3client = Extend(
4 token="YOUR_TOKEN_HERE",
5 extend_api_version="2026-02-09",
6)
7
8client.edit_schemas.generate(
9 file=FileFromUrl(
10 url="https://example.com/form.pdf",
11 ),
12 config=EditSchemaGenerationConfig(
13 instructions="Detect the form fields and use human-readable field names.",
14 advanced_options=EditSchemaGenerationConfigAdvancedOptions(
15 radio_enums_enabled=True,
16 ),
17 ),
18)
1{
2 "schema": {
3 "type": "object",
4 "properties": {},
5 "required": [
6 "string"
7 ],
8 "additionalProperties": true,
9 "dependentRequired": {},
10 "if": {
11 "properties": {},
12 "required": [
13 "string"
14 ],
15 "dependentRequired": {},
16 "allOf": [
17 null
18 ],
19 "oneOf": [
20 null
21 ],
22 "anyOf": [
23 null
24 ]
25 },
26 "then": {
27 "properties": {},
28 "required": [
29 "string"
30 ],
31 "dependentRequired": {},
32 "allOf": [
33 null
34 ],
35 "oneOf": [
36 null
37 ],
38 "anyOf": [
39 null
40 ]
41 },
42 "else": {
43 "properties": {},
44 "required": [
45 "string"
46 ],
47 "dependentRequired": {},
48 "allOf": [
49 null
50 ],
51 "oneOf": [
52 null
53 ],
54 "anyOf": [
55 null
56 ]
57 },
58 "allOf": [
59 {
60 "properties": {},
61 "required": [
62 "string"
63 ],
64 "dependentRequired": {},
65 "allOf": [
66 null
67 ],
68 "oneOf": [
69 null
70 ],
71 "anyOf": [
72 null
73 ]
74 }
75 ],
76 "oneOf": [
77 {
78 "properties": {},
79 "required": [
80 "string"
81 ],
82 "dependentRequired": {},
83 "allOf": [
84 null
85 ],
86 "oneOf": [
87 null
88 ],
89 "anyOf": [
90 null
91 ]
92 }
93 ],
94 "anyOf": [
95 {
96 "properties": {},
97 "required": [
98 "string"
99 ],
100 "dependentRequired": {},
101 "allOf": [
102 null
103 ],
104 "oneOf": [
105 null
106 ],
107 "anyOf": [
108 null
109 ]
110 }
111 ],
112 "not": {
113 "properties": {},
114 "required": [
115 "string"
116 ],
117 "dependentRequired": {},
118 "allOf": [
119 null
120 ],
121 "oneOf": [
122 null
123 ],
124 "anyOf": [
125 null
126 ]
127 }
128 },
129 "annotatedSchema": {
130 "type": "object",
131 "properties": {},
132 "required": [
133 "string"
134 ],
135 "additionalProperties": true,
136 "dependentRequired": {},
137 "if": {
138 "properties": {},
139 "required": [
140 "string"
141 ],
142 "dependentRequired": {},
143 "allOf": [
144 null
145 ],
146 "oneOf": [
147 null
148 ],
149 "anyOf": [
150 null
151 ]
152 },
153 "then": {
154 "properties": {},
155 "required": [
156 "string"
157 ],
158 "dependentRequired": {},
159 "allOf": [
160 null
161 ],
162 "oneOf": [
163 null
164 ],
165 "anyOf": [
166 null
167 ]
168 },
169 "else": {
170 "properties": {},
171 "required": [
172 "string"
173 ],
174 "dependentRequired": {},
175 "allOf": [
176 null
177 ],
178 "oneOf": [
179 null
180 ],
181 "anyOf": [
182 null
183 ]
184 },
185 "allOf": [
186 {
187 "properties": {},
188 "required": [
189 "string"
190 ],
191 "dependentRequired": {},
192 "allOf": [
193 null
194 ],
195 "oneOf": [
196 null
197 ],
198 "anyOf": [
199 null
200 ]
201 }
202 ],
203 "oneOf": [
204 {
205 "properties": {},
206 "required": [
207 "string"
208 ],
209 "dependentRequired": {},
210 "allOf": [
211 null
212 ],
213 "oneOf": [
214 null
215 ],
216 "anyOf": [
217 null
218 ]
219 }
220 ],
221 "anyOf": [
222 {
223 "properties": {},
224 "required": [
225 "string"
226 ],
227 "dependentRequired": {},
228 "allOf": [
229 null
230 ],
231 "oneOf": [
232 null
233 ],
234 "anyOf": [
235 null
236 ]
237 }
238 ],
239 "not": {
240 "properties": {},
241 "required": [
242 "string"
243 ],
244 "dependentRequired": {},
245 "allOf": [
246 null
247 ],
248 "oneOf": [
249 null
250 ],
251 "anyOf": [
252 null
253 ]
254 }
255 },
256 "mappingResult": {
257 "matches": [
258 {
259 "inputPath": "applicant.address.street",
260 "formFieldKey": "applicant_address_street"
261 }
262 ],
263 "unmatchedInputPaths": [
264 "string"
265 ],
266 "unusedFormFieldKeys": [
267 "string"
268 ]
269 }
270}
Detect fields in a PDF form and synchronously return an edit schema payload. Use this endpoint when you want Extend to bootstrap an `EditRootJSON` schema from an existing form, optionally mapping an existing schema onto the detected fields. This endpoint returns the generated schema directly. There are no schema generation run resources to poll or delete. For more details, see the [Generate Edit Schema guide](https://docs.extend.ai/2026-02-09/editing/generate-edit-schema) and the [Edit File guide](https://docs.extend.ai/2026-02-09/editing/edit).
Was this page helpful?
Previous

Run Workflow

Next
Built with

Detect fields in a PDF form and synchronously return an edit schema payload.

Use this endpoint when you want Extend to bootstrap an EditRootJSON schema from an existing form, optionally mapping an existing schema onto the detected fields.

This endpoint returns the generated schema directly. There are no schema generation run resources to poll or delete.

For more details, see the Generate Edit Schema guide and the Edit File guide.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

x-extend-api-version"2026-02-09"OptionalDefaults to 2026-02-09
API version to use for the request. If you're using an SDK, you can ignore this parameter. If you are not using an SDK and do not specify a version, you will either receive a `400 Bad Request` or be set to a previous legacy version. See [API Versioning](https://docs.extend.ai/2026-02-09/api-reference/api-versioning) for more details.

Request

This endpoint expects an object.
fileobjectRequired
The file to analyze. Files can be provided as a URL or an Extend file ID.
configobjectOptional
Configuration options for edit schema generation.

Response

Successfully generated edit schema
schemaobject
The final generated schema after mapping. If no input schema was provided this will be the same as the annotatedSchema.
annotatedSchemaobject or null
The original schema that was detected and annotated from the file.
mappingResultobject or null

Mapping information between inputSchema paths and detected form fields when an input schema was provided.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error

API version to use for the request. If you’re using an SDK, you can ignore this parameter. If you are not using an SDK and do not specify a version, you will either receive a 400 Bad Request or be set to a previous legacy version. See API Versioning for more details.