API docs

Introduction

xedi.ai gives AI agents and developer tools access to XEDI document processing through a simple API and MCP-ready workflow.

Authentication

Each account has one active API token. Use it as a Bearer token when calling the API.

Bearer
Authorization: Bearer xedi_ai_api_key_here

API tokens can be revoked and regenerated from your account settings.

Code examples

request / response

Example API request

curl -X POST https://api.xedi.ai/documents/import-csv \
  -H "Authorization: Bearer xedi_ai_api_key_here" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@orders.csv" \
  -F "format=x12"

Example response

{
  "id": "doc_01HX7Z6M9F8V2",
  "status": "validated",
  "format": "x12",
  "document_type": "850"
}

API Keys

3 endpoints
GET /tokens

Get current API token status

Returns metadata for the active account API token.

Auth required
Response
{
  "data": {
    "id": "tok_01HX7Z6M9F8V2",
    "status": "active",
    "last_used_at": "2026-05-06T09:30:00Z"
  }
}
POST /tokens

Create or regenerate account API token

Issues the account token used for API and MCP access.

Auth required
Response
{
  "data": {
    "id": "tok_01HX7Z6M9F8V2",
    "token": "xedi_ai_api_key_here"
  }
}
DELETE /tokens/{token_id}

Revoke account API token

Revokes the active account API token.

Auth required

Documents

5 endpoints
POST /documents/import

Import document

Import a document through a configured format driver.

Auth required
Request
curl -X POST https://api.xedi.ai/1/documents/import \
  -H "Authorization: Bearer xedi_ai_api_key_here" \
  -F "file=@invoice.csv" \
  -F "partnership_id=ptn_01HX7Z6"
POST /documents/importcsv

Import CSV

Import a CSV file through a mapping collection.

Auth required
Request
curl -X POST https://api.xedi.ai/documents/import-csv \
  -H "Authorization: Bearer xedi_ai_api_key_here" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@orders.csv" \
  -F "format=x12"
Response
{
  "id": "doc_01HX7Z6M9F8V2",
  "status": "validated",
  "format": "x12",
  "document_type": "850"
}
GET /documents/{document_id}

Get document

Return document metadata, status and processing details.

Auth required
Response
{
  "data": {
    "id": "doc_01HX7Z6M9F8V2",
    "status": "validated",
    "direction": "inbound"
  }
}
GET /documents/{document_id}/raw

Get document raw content

Download the raw source file attached to a document.

Auth required
GET /documents/{document_id}/convert

Convert document

Convert a document into a supported output representation.

Auth required

Partners

3 endpoints
GET /partners

List partners

Return trading partner records available to the account.

Auth required
GET /partners/{partner_id}

Get partner

Return partner metadata and supported document details.

Auth required
GET /partnerships

List partnerships

Return configured trading relationships and routing context.

Auth required

Document Types & Schemas

3 endpoints
GET /documenttypes

List document types

Return supported document types for EDI processing.

Auth required
GET /schemas

List schemas

Return available schema records and versions.

Auth required
GET /schemas/{message}

Get schema

Return the message definition for a schema.

Auth required

Files

2 endpoints
POST /files

Upload file

Upload a file for document processing or later retrieval.

Auth required
Request
curl -X POST https://api.xedi.ai/1/files \
  -H "Authorization: Bearer xedi_ai_api_key_here" \
  -F "file=@orders.csv"
GET /files/{file_id}

Get file

Return or download a stored file by identifier.

Auth required

Tasks & Usage

3 endpoints
GET /tasks

List tasks

Return queued, running and completed processing tasks.

Auth required
GET /tasks/{task_id}

Get task

Return task status, operation metadata and any result links.

Auth required
GET /usages

Get usage summary

Return usage records for document processing and validation.

Auth required

OpenAPI YAML

Use the raw YAML file to generate client types or internal API notes.

Open YAML