> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/api/api-reference/b2b-manager/file-definition-rules.md).

# File Definition Rules

Submit an EDI specification PDF (X12 or EDIFACT) and receive parsing and/or generation File Definition Rules JSON, generated asynchronously. Submit endpoints return a `requestId` immediately (202); poll the matching GET endpoint until the job reaches `completed` or `failed`. Job records expire 24 hours after submission. Submissions are rate-limited per caller (10 per hour, with an administrator bypass); the document-types catalog allows 100 per hour and 10 per 60 seconds. The API only produces rules — it persists nothing. Celigo's AI assistant in integrator.io drives these endpoints for interactive onboarding; call them directly to script partner onboarding in bulk.

### File definition rules schemas

## The FdrSubmitRequest object

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"components":{"schemas":{"FdrSubmitRequest":{"type":"object","required":["pdf","documentType"],"properties":{"pdf":{"type":"string","description":"Base64-encoded EDI specification PDF. Must decode to a text-bearing\nPDF: a scanned or image-only document is accepted, and the job then\nfails with `DETECTION_FAILED`. A value that isn't base64 or doesn't\ndecode to a PDF is rejected with `422 PDF_EXTRACTION_FAILED`, and\nencoded payloads over 50 MB with `413 PAYLOAD_TOO_LARGE`."},"documentType":{"type":"integer","description":"X12 transaction set number (e.g. 850), or 0 to auto-detect an\nEDIFACT specification from the PDF contents. Values outside the\nsupported set fail with `400 INVALID_DOCUMENT_TYPE`; discover the\nsupported set via `GET /v1/filedefinitionrules/document-types`. A\nsupported value that names a different transaction set than the PDF\n(an 850 guide submitted as 810) is accepted, and the job then fails\nwith `INVALID_DOCUMENT_TYPE`."}}}}}}
```

## The FileDefinitionGenerationJob object

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"components":{"schemas":{"FileDefinitionGenerationJob":{"type":"object","required":["requestId"],"description":"State of an async FDR generation job. `startedAt` appears once\nprocessing begins; `completedAt`, and either `result` or `error`,\nappear when the job finishes. Job records expire 24 hours after\nsubmission — polling after that returns `404 REQUEST_NOT_FOUND`.","properties":{"requestId":{"type":"string","format":"uuid","description":"Identifier returned by the submit endpoint; use it to poll."},"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"Job lifecycle state. Keep polling until `completed` or `failed`."},"createdAt":{"type":"string","format":"date-time","description":"When the job was submitted."},"startedAt":{"type":"string","format":"date-time","description":"When processing began. Absent while queued."},"completedAt":{"type":"string","format":"date-time","description":"When the job finished (either outcome). Absent until then."},"result":{"type":"object","description":"Present when `status` is `completed`.","properties":{"parsingFdr":{"type":["object","null"],"additionalProperties":true,"description":"Opaque parsing FDR JSON artifact."},"generationFdr":{"type":["object","null"],"additionalProperties":true,"description":"Opaque generation FDR JSON artifact."}}},"error":{"type":"object","description":"Present when `status` is `failed`.","required":["code","message"],"properties":{"code":{"type":"string","description":"Failure code — typically DETECTION_FAILED (no text to read, as in\na scanned or image-only PDF, or not recognizably X12 or EDIFACT),\nINVALID_DOCUMENT_TYPE (the PDF is for a different transaction set\nthan `documentType`), UNSUPPORTED_TYPE, or GENERATION_FAILED."},"message":{"type":"string","description":"Human-readable failure reason."}}}}}}}}
```

## The FileDefinitionParsingJob object

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"components":{"schemas":{"FileDefinitionParsingJob":{"type":"object","required":["requestId"],"description":"State of an async FDR parsing job — identical lifecycle to the\ngeneration job, but `result` carries only `parsingFdr`.","properties":{"requestId":{"type":"string","format":"uuid","description":"Identifier returned by the submit endpoint; use it to poll."},"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"Job lifecycle state. Keep polling until `completed` or `failed`."},"createdAt":{"type":"string","format":"date-time","description":"When the job was submitted."},"startedAt":{"type":"string","format":"date-time","description":"When processing began. Absent while queued."},"completedAt":{"type":"string","format":"date-time","description":"When the job finished (either outcome). Absent until then."},"result":{"type":"object","description":"Present when `status` is `completed`.","properties":{"parsingFdr":{"type":["object","null"],"additionalProperties":true,"description":"Opaque parsing FDR JSON artifact."}}},"error":{"type":"object","description":"Present when `status` is `failed`.","required":["code","message"],"properties":{"code":{"type":"string","description":"Failure code — typically DETECTION_FAILED (no text to read, as in\na scanned or image-only PDF, or not recognizably X12 or EDIFACT),\nINVALID_DOCUMENT_TYPE (the PDF is for a different transaction set\nthan `documentType`), UNSUPPORTED_TYPE, or GENERATION_FAILED."},"message":{"type":"string","description":"Human-readable failure reason."}}}}}}}}
```

## Submit an FDR generation job

> Submits an async job that produces both parsing and generation FDR\
> artifacts from the supplied EDI specification PDF. Returns a\
> \`requestId\` immediately; poll\
> \`GET /v1/filedefinitionrules/generate/{requestId}\` for status and\
> results. Rate-limited to 10 submissions per caller per hour\
> (administrators bypass the limit).

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"tags":[{"name":"File Definition Rules","description":"Submit an EDI specification PDF (X12 or EDIFACT) and receive parsing\nand/or generation File Definition Rules JSON, generated asynchronously.\nSubmit endpoints return a `requestId` immediately (202); poll the\nmatching GET endpoint until the job reaches `completed` or `failed`.\nJob records expire 24 hours after submission. Submissions are\nrate-limited per caller (10 per hour, with an administrator bypass);\nthe document-types catalog allows 100 per hour and 10 per 60 seconds.\nThe API only produces rules — it persists nothing. Celigo's AI assistant in\nintegrator.io drives these endpoints for interactive onboarding; call\nthem directly to script partner onboarding in bulk.\n\n## File definition rules schemas\n\n{% openapi-schemas spec=\"filedefinitionrules\" schemas=\"FdrSubmitRequest,FileDefinitionGenerationJob,FileDefinitionParsingJob\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"FdrSubmitRequest":{"type":"object","required":["pdf","documentType"],"properties":{"pdf":{"type":"string","description":"Base64-encoded EDI specification PDF. Must decode to a text-bearing\nPDF: a scanned or image-only document is accepted, and the job then\nfails with `DETECTION_FAILED`. A value that isn't base64 or doesn't\ndecode to a PDF is rejected with `422 PDF_EXTRACTION_FAILED`, and\nencoded payloads over 50 MB with `413 PAYLOAD_TOO_LARGE`."},"documentType":{"type":"integer","description":"X12 transaction set number (e.g. 850), or 0 to auto-detect an\nEDIFACT specification from the PDF contents. Values outside the\nsupported set fail with `400 INVALID_DOCUMENT_TYPE`; discover the\nsupported set via `GET /v1/filedefinitionrules/document-types`. A\nsupported value that names a different transaction set than the PDF\n(an 850 guide submitted as 810) is accepted, and the job then fails\nwith `INVALID_DOCUMENT_TYPE`."}}},"Error":{"type":"object","additionalProperties":false,"required":["errors"],"properties":{"errors":{"type":"array","description":"One or more errors from this request.","items":{"$ref":"#/components/schemas/ErrorItem"}},"correlationId":{"type":"string","description":"Matches the X-Correlation-ID response header when the service set one."}}},"ErrorItem":{"type":"object","additionalProperties":false,"required":["code","message","source"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Human-readable description of this error."},"source":{"type":"string","description":"Field or component that produced the error (`pdf`, `documentType`, `Authorization`, `requestId`, `rate_limiter`, `generation`)."}}},"ErrorCode":{"type":"string","description":"Machine-readable failure code returned by the FDR service.","enum":["INVALID_DOCUMENT_TYPE","INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","REQUEST_NOT_FOUND","PAYLOAD_TOO_LARGE","RATE_LIMIT_EXCEEDED","PDF_EXTRACTION_FAILED","UNSUPPORTED_TYPE","DETECTION_FAILED","GENERATION_FAILED","SERVICE_UNAVAILABLE"]}},"responses":{"400-bad-request":{"description":"Invalid documentType or request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Missing Authorization header or scheme is not Bearer JWT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403-forbidden":{"description":"Token is invalid or expired, or the caller lacks permission or a valid AShare.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413-payload-too-large":{"description":"Encoded pdf exceeds the 50 MB limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"pdf is not valid base64 or decoded bytes do not start with %PDF.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429-rate-limit":{"description":"Caller exceeded the endpoint's rate limit.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500-internal":{"description":"Unexpected FDR service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503-unavailable":{"description":"Job store or PDF storage is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/filedefinitionrules/generate":{"post":{"operationId":"submitFdrGeneration","tags":["File Definition Rules"],"summary":"Submit an FDR generation job","description":"Submits an async job that produces both parsing and generation FDR\nartifacts from the supplied EDI specification PDF. Returns a\n`requestId` immediately; poll\n`GET /v1/filedefinitionrules/generate/{requestId}` for status and\nresults. Rate-limited to 10 submissions per caller per hour\n(administrators bypass the limit).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FdrSubmitRequest"}}}},"responses":{"202":{"description":"Job accepted.","content":{"application/json":{"schema":{"type":"object","required":["fileDefinitionGenerationJob"],"properties":{"fileDefinitionGenerationJob":{"type":"object","required":["requestId"],"properties":{"requestId":{"type":"string","format":"uuid","description":"Poll handle for the job."}}}}}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"413":{"$ref":"#/components/responses/413-payload-too-large"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"},"429":{"$ref":"#/components/responses/429-rate-limit"},"500":{"$ref":"#/components/responses/500-internal"},"503":{"$ref":"#/components/responses/503-unavailable"}}}}}}
```

## Poll an FDR generation job

> Returns the job's current state. When \`status\` is \`completed\`,\
> \`result\` carries \`parsingFdr\` and \`generationFdr\`; when \`failed\`,\
> \`error\` carries the code and message. Non-administrators can only\
> poll their own jobs. Job records expire after 24 hours\
> (\`404 REQUEST\_NOT\_FOUND\`).

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"tags":[{"name":"File Definition Rules","description":"Submit an EDI specification PDF (X12 or EDIFACT) and receive parsing\nand/or generation File Definition Rules JSON, generated asynchronously.\nSubmit endpoints return a `requestId` immediately (202); poll the\nmatching GET endpoint until the job reaches `completed` or `failed`.\nJob records expire 24 hours after submission. Submissions are\nrate-limited per caller (10 per hour, with an administrator bypass);\nthe document-types catalog allows 100 per hour and 10 per 60 seconds.\nThe API only produces rules — it persists nothing. Celigo's AI assistant in\nintegrator.io drives these endpoints for interactive onboarding; call\nthem directly to script partner onboarding in bulk.\n\n## File definition rules schemas\n\n{% openapi-schemas spec=\"filedefinitionrules\" schemas=\"FdrSubmitRequest,FileDefinitionGenerationJob,FileDefinitionParsingJob\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"FileDefinitionGenerationJob":{"type":"object","required":["requestId"],"description":"State of an async FDR generation job. `startedAt` appears once\nprocessing begins; `completedAt`, and either `result` or `error`,\nappear when the job finishes. Job records expire 24 hours after\nsubmission — polling after that returns `404 REQUEST_NOT_FOUND`.","properties":{"requestId":{"type":"string","format":"uuid","description":"Identifier returned by the submit endpoint; use it to poll."},"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"Job lifecycle state. Keep polling until `completed` or `failed`."},"createdAt":{"type":"string","format":"date-time","description":"When the job was submitted."},"startedAt":{"type":"string","format":"date-time","description":"When processing began. Absent while queued."},"completedAt":{"type":"string","format":"date-time","description":"When the job finished (either outcome). Absent until then."},"result":{"type":"object","description":"Present when `status` is `completed`.","properties":{"parsingFdr":{"type":["object","null"],"additionalProperties":true,"description":"Opaque parsing FDR JSON artifact."},"generationFdr":{"type":["object","null"],"additionalProperties":true,"description":"Opaque generation FDR JSON artifact."}}},"error":{"type":"object","description":"Present when `status` is `failed`.","required":["code","message"],"properties":{"code":{"type":"string","description":"Failure code — typically DETECTION_FAILED (no text to read, as in\na scanned or image-only PDF, or not recognizably X12 or EDIFACT),\nINVALID_DOCUMENT_TYPE (the PDF is for a different transaction set\nthan `documentType`), UNSUPPORTED_TYPE, or GENERATION_FAILED."},"message":{"type":"string","description":"Human-readable failure reason."}}}}},"Error":{"type":"object","additionalProperties":false,"required":["errors"],"properties":{"errors":{"type":"array","description":"One or more errors from this request.","items":{"$ref":"#/components/schemas/ErrorItem"}},"correlationId":{"type":"string","description":"Matches the X-Correlation-ID response header when the service set one."}}},"ErrorItem":{"type":"object","additionalProperties":false,"required":["code","message","source"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Human-readable description of this error."},"source":{"type":"string","description":"Field or component that produced the error (`pdf`, `documentType`, `Authorization`, `requestId`, `rate_limiter`, `generation`)."}}},"ErrorCode":{"type":"string","description":"Machine-readable failure code returned by the FDR service.","enum":["INVALID_DOCUMENT_TYPE","INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","REQUEST_NOT_FOUND","PAYLOAD_TOO_LARGE","RATE_LIMIT_EXCEEDED","PDF_EXTRACTION_FAILED","UNSUPPORTED_TYPE","DETECTION_FAILED","GENERATION_FAILED","SERVICE_UNAVAILABLE"]}},"responses":{"401-unauthorized":{"description":"Missing Authorization header or scheme is not Bearer JWT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403-forbidden":{"description":"Token is invalid or expired, or the caller lacks permission or a valid AShare.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404-not-found":{"description":"Job id is unknown, belongs to the other operation, is not visible to the caller, or expired after 24 hours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500-internal":{"description":"Unexpected FDR service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/filedefinitionrules/generate/{requestId}":{"get":{"operationId":"pollFdrGeneration","tags":["File Definition Rules"],"summary":"Poll an FDR generation job","description":"Returns the job's current state. When `status` is `completed`,\n`result` carries `parsingFdr` and `generationFdr`; when `failed`,\n`error` carries the code and message. Non-administrators can only\npoll their own jobs. Job records expire after 24 hours\n(`404 REQUEST_NOT_FOUND`).","parameters":[{"name":"requestId","in":"path","required":true,"description":"Request id returned by the submit endpoint.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current job state.","content":{"application/json":{"schema":{"type":"object","required":["fileDefinitionGenerationJob"],"properties":{"fileDefinitionGenerationJob":{"$ref":"#/components/schemas/FileDefinitionGenerationJob"}}}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"$ref":"#/components/responses/404-not-found"},"500":{"$ref":"#/components/responses/500-internal"}}}}}}
```

## Submit an FDR parsing job

> Submits an async job that produces a parsing FDR only (no generation\
> artifact) from the supplied EDI specification PDF. Returns a\
> \`requestId\` immediately; poll\
> \`GET /v1/filedefinitionrules/parse/{requestId}\` for status and\
> results. Rate-limited to 10 submissions per caller per hour\
> (administrators bypass the limit).

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"tags":[{"name":"File Definition Rules","description":"Submit an EDI specification PDF (X12 or EDIFACT) and receive parsing\nand/or generation File Definition Rules JSON, generated asynchronously.\nSubmit endpoints return a `requestId` immediately (202); poll the\nmatching GET endpoint until the job reaches `completed` or `failed`.\nJob records expire 24 hours after submission. Submissions are\nrate-limited per caller (10 per hour, with an administrator bypass);\nthe document-types catalog allows 100 per hour and 10 per 60 seconds.\nThe API only produces rules — it persists nothing. Celigo's AI assistant in\nintegrator.io drives these endpoints for interactive onboarding; call\nthem directly to script partner onboarding in bulk.\n\n## File definition rules schemas\n\n{% openapi-schemas spec=\"filedefinitionrules\" schemas=\"FdrSubmitRequest,FileDefinitionGenerationJob,FileDefinitionParsingJob\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"FdrSubmitRequest":{"type":"object","required":["pdf","documentType"],"properties":{"pdf":{"type":"string","description":"Base64-encoded EDI specification PDF. Must decode to a text-bearing\nPDF: a scanned or image-only document is accepted, and the job then\nfails with `DETECTION_FAILED`. A value that isn't base64 or doesn't\ndecode to a PDF is rejected with `422 PDF_EXTRACTION_FAILED`, and\nencoded payloads over 50 MB with `413 PAYLOAD_TOO_LARGE`."},"documentType":{"type":"integer","description":"X12 transaction set number (e.g. 850), or 0 to auto-detect an\nEDIFACT specification from the PDF contents. Values outside the\nsupported set fail with `400 INVALID_DOCUMENT_TYPE`; discover the\nsupported set via `GET /v1/filedefinitionrules/document-types`. A\nsupported value that names a different transaction set than the PDF\n(an 850 guide submitted as 810) is accepted, and the job then fails\nwith `INVALID_DOCUMENT_TYPE`."}}},"Error":{"type":"object","additionalProperties":false,"required":["errors"],"properties":{"errors":{"type":"array","description":"One or more errors from this request.","items":{"$ref":"#/components/schemas/ErrorItem"}},"correlationId":{"type":"string","description":"Matches the X-Correlation-ID response header when the service set one."}}},"ErrorItem":{"type":"object","additionalProperties":false,"required":["code","message","source"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Human-readable description of this error."},"source":{"type":"string","description":"Field or component that produced the error (`pdf`, `documentType`, `Authorization`, `requestId`, `rate_limiter`, `generation`)."}}},"ErrorCode":{"type":"string","description":"Machine-readable failure code returned by the FDR service.","enum":["INVALID_DOCUMENT_TYPE","INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","REQUEST_NOT_FOUND","PAYLOAD_TOO_LARGE","RATE_LIMIT_EXCEEDED","PDF_EXTRACTION_FAILED","UNSUPPORTED_TYPE","DETECTION_FAILED","GENERATION_FAILED","SERVICE_UNAVAILABLE"]}},"responses":{"400-bad-request":{"description":"Invalid documentType or request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Missing Authorization header or scheme is not Bearer JWT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403-forbidden":{"description":"Token is invalid or expired, or the caller lacks permission or a valid AShare.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413-payload-too-large":{"description":"Encoded pdf exceeds the 50 MB limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"pdf is not valid base64 or decoded bytes do not start with %PDF.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429-rate-limit":{"description":"Caller exceeded the endpoint's rate limit.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500-internal":{"description":"Unexpected FDR service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503-unavailable":{"description":"Job store or PDF storage is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/filedefinitionrules/parse":{"post":{"operationId":"submitFdrParsing","tags":["File Definition Rules"],"summary":"Submit an FDR parsing job","description":"Submits an async job that produces a parsing FDR only (no generation\nartifact) from the supplied EDI specification PDF. Returns a\n`requestId` immediately; poll\n`GET /v1/filedefinitionrules/parse/{requestId}` for status and\nresults. Rate-limited to 10 submissions per caller per hour\n(administrators bypass the limit).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FdrSubmitRequest"}}}},"responses":{"202":{"description":"Job accepted.","content":{"application/json":{"schema":{"type":"object","required":["fileDefinitionParsingJob"],"properties":{"fileDefinitionParsingJob":{"type":"object","required":["requestId"],"properties":{"requestId":{"type":"string","format":"uuid","description":"Poll handle for the job."}}}}}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"413":{"$ref":"#/components/responses/413-payload-too-large"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"},"429":{"$ref":"#/components/responses/429-rate-limit"},"500":{"$ref":"#/components/responses/500-internal"},"503":{"$ref":"#/components/responses/503-unavailable"}}}}}}
```

## Poll an FDR parsing job

> Returns the job's current state. When \`status\` is \`completed\`,\
> \`result\` carries \`parsingFdr\` only; when \`failed\`, \`error\` carries\
> the code and message. Non-administrators can only poll their own\
> jobs. Job records expire after 24 hours (\`404 REQUEST\_NOT\_FOUND\`).

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"tags":[{"name":"File Definition Rules","description":"Submit an EDI specification PDF (X12 or EDIFACT) and receive parsing\nand/or generation File Definition Rules JSON, generated asynchronously.\nSubmit endpoints return a `requestId` immediately (202); poll the\nmatching GET endpoint until the job reaches `completed` or `failed`.\nJob records expire 24 hours after submission. Submissions are\nrate-limited per caller (10 per hour, with an administrator bypass);\nthe document-types catalog allows 100 per hour and 10 per 60 seconds.\nThe API only produces rules — it persists nothing. Celigo's AI assistant in\nintegrator.io drives these endpoints for interactive onboarding; call\nthem directly to script partner onboarding in bulk.\n\n## File definition rules schemas\n\n{% openapi-schemas spec=\"filedefinitionrules\" schemas=\"FdrSubmitRequest,FileDefinitionGenerationJob,FileDefinitionParsingJob\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"FileDefinitionParsingJob":{"type":"object","required":["requestId"],"description":"State of an async FDR parsing job — identical lifecycle to the\ngeneration job, but `result` carries only `parsingFdr`.","properties":{"requestId":{"type":"string","format":"uuid","description":"Identifier returned by the submit endpoint; use it to poll."},"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"Job lifecycle state. Keep polling until `completed` or `failed`."},"createdAt":{"type":"string","format":"date-time","description":"When the job was submitted."},"startedAt":{"type":"string","format":"date-time","description":"When processing began. Absent while queued."},"completedAt":{"type":"string","format":"date-time","description":"When the job finished (either outcome). Absent until then."},"result":{"type":"object","description":"Present when `status` is `completed`.","properties":{"parsingFdr":{"type":["object","null"],"additionalProperties":true,"description":"Opaque parsing FDR JSON artifact."}}},"error":{"type":"object","description":"Present when `status` is `failed`.","required":["code","message"],"properties":{"code":{"type":"string","description":"Failure code — typically DETECTION_FAILED (no text to read, as in\na scanned or image-only PDF, or not recognizably X12 or EDIFACT),\nINVALID_DOCUMENT_TYPE (the PDF is for a different transaction set\nthan `documentType`), UNSUPPORTED_TYPE, or GENERATION_FAILED."},"message":{"type":"string","description":"Human-readable failure reason."}}}}},"Error":{"type":"object","additionalProperties":false,"required":["errors"],"properties":{"errors":{"type":"array","description":"One or more errors from this request.","items":{"$ref":"#/components/schemas/ErrorItem"}},"correlationId":{"type":"string","description":"Matches the X-Correlation-ID response header when the service set one."}}},"ErrorItem":{"type":"object","additionalProperties":false,"required":["code","message","source"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Human-readable description of this error."},"source":{"type":"string","description":"Field or component that produced the error (`pdf`, `documentType`, `Authorization`, `requestId`, `rate_limiter`, `generation`)."}}},"ErrorCode":{"type":"string","description":"Machine-readable failure code returned by the FDR service.","enum":["INVALID_DOCUMENT_TYPE","INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","REQUEST_NOT_FOUND","PAYLOAD_TOO_LARGE","RATE_LIMIT_EXCEEDED","PDF_EXTRACTION_FAILED","UNSUPPORTED_TYPE","DETECTION_FAILED","GENERATION_FAILED","SERVICE_UNAVAILABLE"]}},"responses":{"401-unauthorized":{"description":"Missing Authorization header or scheme is not Bearer JWT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403-forbidden":{"description":"Token is invalid or expired, or the caller lacks permission or a valid AShare.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404-not-found":{"description":"Job id is unknown, belongs to the other operation, is not visible to the caller, or expired after 24 hours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500-internal":{"description":"Unexpected FDR service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/filedefinitionrules/parse/{requestId}":{"get":{"operationId":"pollFdrParsing","tags":["File Definition Rules"],"summary":"Poll an FDR parsing job","description":"Returns the job's current state. When `status` is `completed`,\n`result` carries `parsingFdr` only; when `failed`, `error` carries\nthe code and message. Non-administrators can only poll their own\njobs. Job records expire after 24 hours (`404 REQUEST_NOT_FOUND`).","parameters":[{"name":"requestId","in":"path","required":true,"description":"Request id returned by the submit endpoint.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current job state.","content":{"application/json":{"schema":{"type":"object","required":["fileDefinitionParsingJob"],"properties":{"fileDefinitionParsingJob":{"$ref":"#/components/schemas/FileDefinitionParsingJob"}}}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"$ref":"#/components/responses/404-not-found"},"500":{"$ref":"#/components/responses/500-internal"}}}}}}
```

## List supported document types

> Returns the X12 transaction set numbers the generator supports (24 sets\
> as of v1.2.0) and whether EDIFACT auto-detection is available\
> (\`documentType: 0\`). Rate-limited to 100 requests per hour and 10 per\
> 60 seconds per caller.

```json
{"openapi":"3.2.0","info":{"title":"File Definition Rules","version":"1.0.0"},"tags":[{"name":"File Definition Rules","description":"Submit an EDI specification PDF (X12 or EDIFACT) and receive parsing\nand/or generation File Definition Rules JSON, generated asynchronously.\nSubmit endpoints return a `requestId` immediately (202); poll the\nmatching GET endpoint until the job reaches `completed` or `failed`.\nJob records expire 24 hours after submission. Submissions are\nrate-limited per caller (10 per hour, with an administrator bypass);\nthe document-types catalog allows 100 per hour and 10 per 60 seconds.\nThe API only produces rules — it persists nothing. Celigo's AI assistant in\nintegrator.io drives these endpoints for interactive onboarding; call\nthem directly to script partner onboarding in bulk.\n\n## File definition rules schemas\n\n{% openapi-schemas spec=\"filedefinitionrules\" schemas=\"FdrSubmitRequest,FileDefinitionGenerationJob,FileDefinitionParsingJob\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"DocumentTypesResponse":{"type":"object","additionalProperties":false,"required":["fileDefinitionDocumentTypes"],"properties":{"fileDefinitionDocumentTypes":{"$ref":"#/components/schemas/FileDefinitionDocumentTypes"}}},"FileDefinitionDocumentTypes":{"type":"object","additionalProperties":false,"required":["supportedTypes","edifactSupported"],"properties":{"supportedTypes":{"type":"array","description":"Sorted X12 transaction set numbers this service can generate.","items":{"type":"integer"}},"edifactSupported":{"type":"boolean","description":"When true, submit documentType 0 to auto-detect EDIFACT from the PDF."}}},"Error":{"type":"object","additionalProperties":false,"required":["errors"],"properties":{"errors":{"type":"array","description":"One or more errors from this request.","items":{"$ref":"#/components/schemas/ErrorItem"}},"correlationId":{"type":"string","description":"Matches the X-Correlation-ID response header when the service set one."}}},"ErrorItem":{"type":"object","additionalProperties":false,"required":["code","message","source"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Human-readable description of this error."},"source":{"type":"string","description":"Field or component that produced the error (`pdf`, `documentType`, `Authorization`, `requestId`, `rate_limiter`, `generation`)."}}},"ErrorCode":{"type":"string","description":"Machine-readable failure code returned by the FDR service.","enum":["INVALID_DOCUMENT_TYPE","INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","REQUEST_NOT_FOUND","PAYLOAD_TOO_LARGE","RATE_LIMIT_EXCEEDED","PDF_EXTRACTION_FAILED","UNSUPPORTED_TYPE","DETECTION_FAILED","GENERATION_FAILED","SERVICE_UNAVAILABLE"]}},"responses":{"401-unauthorized":{"description":"Missing Authorization header or scheme is not Bearer JWT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403-forbidden":{"description":"Token is invalid or expired, or the caller lacks permission or a valid AShare.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429-rate-limit":{"description":"Caller exceeded the endpoint's rate limit.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500-internal":{"description":"Unexpected FDR service failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/filedefinitionrules/document-types":{"get":{"operationId":"listFdrDocumentTypes","tags":["File Definition Rules"],"summary":"List supported document types","description":"Returns the X12 transaction set numbers the generator supports (24 sets\nas of v1.2.0) and whether EDIFACT auto-detection is available\n(`documentType: 0`). Rate-limited to 100 requests per hour and 10 per\n60 seconds per caller.","responses":{"200":{"description":"Supported document types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTypesResponse"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"429":{"$ref":"#/components/responses/429-rate-limit"},"500":{"$ref":"#/components/responses/500-internal"}}}}}}
```
