Skip to main content

REST API Integration

Prepare your Parse or Extract async task integration based on the finalized REST field protocol, and understand the production entry release boundaries.

The REST API is designed for backend services, cross-language systems, and workflow orchestration. The public field protocol is finalized, defining Bearer API Key authentication, config_id, biz_id, business paths, and async result query semantics, so you can prepare your integration code.

Integration Prerequisites

  • You have ParseX console access and enter the target Workspace through the officially authorized entry; if you do not have access, contact the service provider or administrator first — do not generate or guess console URLs.
  • You have validated and saved a Parse or Extract configuration with real samples and obtained its config_id.
  • You have prepared compliant input file URLs; when Extract reuses parse results, you also need a valid parsed_file_biz_id.
  • You have planned for the server side to securely store the biz_id returned by REST and perform async result queries once the production Base URL and official authentication method are released.
For detailed limits, see Supported Files and Limits; for configuration rules, see Save and Reuse Configurations.

Finalized Business Paths

MethodBusiness PathPurpose
POST/parse/submitSubmit a Parse task
POST/parse/resultQuery Parse status, results, or shards
POST/extract/submitSubmit an Extract task
POST/extract/resultQuery Extract status and results
All requests use JSON with snake_case fields and carry the following headers:
Authentication
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
API Keys should only be stored on the server side or in a key management system. Do not write them into browser code, repositories, task parameters, or logs.

Use Saved Configurations

The finalized protocol requires choosing between config_id and inline capability parameters. Once the production entry is released, we recommend referencing validated configurations to avoid having different services maintain parsing or extraction rules separately.
  • Parse
  • Extract
A configuration-based call must at least express the following semantics:
- `file_url`: an accessible URL of the file to process.
- `file_name` or the file type information required by the protocol.
- `config_id`: ID of the saved Parse configuration.

For complete parameters and response fields, see the [Document Parsing API](/en/model-studio/parse/parse-submit).
Do not pass both config_id and the corresponding inline processing parameters in the same call, otherwise a ConfigInlineConflict will occur. To adjust rules, create a new configuration and switch to its ID.

Call Flow

  1. Wait for the official Base URL release The production Base URL has not been publicly confirmed. Before the official production endpoint is released, do not treat the {BASE_URL} placeholder as a real address, and do not substitute it with staging or internal addresses.
  2. Submit a task Once the official endpoint is available, call the corresponding submit endpoint, passing the file source, a capability-matching config_id, and the per-run parameters allowed by the protocol. Per-run parameters should not change the processing definition of the saved configuration.
  3. Save request and task identifiers Save request_id and data.biz_id from the response. request_id identifies this API request, and biz_id is used to query the async business task later.
  4. Query task status Call the corresponding result endpoint with the original biz_id. Keep polling while data.status is processing; stop when it is success or failed.
  5. Handle results or errors On success, read the official Parse or Extract result; on failure, save the error code, request_id, biz_id, and config_id, and troubleshoot with the public error codes.

Status and Tracking

Identifier or statusMeaningClient handling
request_idLocator identifier for an API requestRecord it for every submission and query; provide it together with the error code when troubleshooting
biz_idIdentifier of an async business taskPersist after submission and use it with the corresponding result endpoint
processingThe task is still processingContinue querying the original task with a backoff strategy; avoid resubmitting due to waiting
successThe official result is readableValidate the result structure and associate it with config_id, input, and business records
failedThe task failedDecide whether to fix the input, stop, or retry based on the error code
When the result is not yet ready, the API may return HTTP 409 and ResultNotReady. The client should keep querying the original biz_id instead of creating a new task that cannot be correlated.

Retries and Duplicate Submissions

The current public protocol does not define client idempotency keys, duplicate-submission deduplication rules, or an endpoint to look up tasks by request_id. Do not assume submit requests are inherently idempotent, and do not invent your own idempotency headers. Currently, only poll the result endpoint.
  • The client should save its own business correlation key, submission time, and the request_id and biz_id received in the response.
  • If a submit request times out without a response, the public protocol cannot automatically confirm whether the task was created; fall back to a manual or business-side reconciliation process and accept that duplicate submissions cannot be automatically ruled out.
  • Use a capped backoff strategy for result queries; do not poll at high frequency.
  • Only automatically retry errors explicitly marked as retryable; parameter, format, or configuration conflicts should be fixed first.
  • API Overview: Learn about authentication, Base URL placeholder conventions, public business paths, and the async call flow.
  • Error Codes: Decide how to handle errors based on HTTP status and error codes.
  • Tasks and Usage: Learn about public REST task statuses and the console's "Task Records" and usage pages.
Agent Development
Agent Context
Agent Governance & Evolution
Store
Application Marketplace