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.
GuidesAPI ReferenceChangelogModel Versioning
GuidesAPI ReferenceChangelogModel Versioning
    • Getting Started
    • Authentication
    • API Versioning
    • SDKs
    • Deployments
  • Processor Endpoints
    • POSTRun Processor
    • GETGet Processor Run
    • GETList Processor Runs
    • POSTCancel Processor Run
    • DELDelete Processor Run
    • GETGet Batch Processor Run
    • GETList Processors
    • POSTCreate Processor
    • POSTUpdate Processor
    • POSTPublish Processor Version
    • GETGet Processor Version
    • GETList Processor Versions
  • Parse Endpoints
    • POSTParse File
    • POSTParse File Async
    • GETGet Parser Run
    • DELDelete Parser Run
  • Workflow Endpoints
    • POSTRun Workflow
    • GETGet Workflow Run
    • GETList Workflow Runs
    • POSTUpdate Workflow Run
    • POSTCancel Workflow Run
    • DELDelete Workflow Run
    • POSTCreate Workflow
    • POSTBatch Run Workflow
    • POSTCorrect Workflow Run Outputs
  • File Endpoints
    • POSTUpload File
    • GETGet File
    • DELDelete File
    • GETList Files
    • POSTCreate File
  • Edit Endpoints
    • POSTEdit File
    • POSTEdit File Async
    • POSTGenerate Edit Schema
    • GETGet Edit Run
    • DELDelete Edit Run
    • GETGet Edit Template
  • Evaluation Set Endpoints
    • GETGet Evaluation Set
    • GETList Evaluation Sets
    • POSTCreate Evaluation Set
    • GETList Evaluation Set Items
    • POSTCreate Evaluation Set Item
    • POSTUpdate Evaluation Set Item
    • DELDelete Evaluation Set Item
    • POSTBulk Create Evaluation Set Items
LogoLogo
Edit Endpoints

Generate Edit Schema

POST
https://api.extend.ai/edit_schemas/generate
POST
/edit_schemas/generate
1import { ExtendClient } from "extend-ai";
2
3const client = new ExtendClient({ token: "YOUR_TOKEN" });
4await client.editSchemas.generate({
5 file: {
6 url: "https://example.com/form.pdf"
7 },
8 config: {
9 instructions: "Detect the form fields and use human-readable field names.",
10 advancedOptions: {
11 radioEnumsEnabled: true
12 }
13 }
14});
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 EditRootJSONSchema 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.

Was this page helpful?
Previous

Get Edit Run

Next
Built with

Authentication

AuthorizationBearer

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

Headers

x-extend-api-version"2025-04-21"Optional
API version to use for the request. If you 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/2025-04-21/developers/api-versioning) for more details.

Request

This endpoint expects an object.
fileobjectRequired
A file object containing either a URL or a fileId.
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
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error

API version to use for the request. If you 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.