> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agribackup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AgriBackup Enterprise EUDR API Reference

> Complete reference for the AgriBackup REST API. Authenticate with a Bearer token, submit JSON requests, and receive JSON responses across all EUDR compliance endpoints.

The AgriBackup Enterprise EUDR API is a resource-oriented REST API that covers the full EU Deforestation Regulation compliance lifecycle — from pre-assessment risk scoring through polygon ingestion, batch registration, logistics linking, and automated Due Diligence Statement (DDS) filing. All requests accept and return JSON unless otherwise noted, and all responses use standard HTTP status codes.

## Base URLs

The base URL is determined by your API key prefix. If you use an official SDK, the URL is resolved automatically.

| Environment          | Base URL                         |
| -------------------- | -------------------------------- |
| Production (Mainnet) | `https://live.agribackup.com`    |
| Sandbox (Testnet)    | `https://sandbox.agribackup.com` |

## Authentication

Every request must include your API key as a Bearer token in the `Authorization` header:

```http theme={null}
Authorization: Bearer sk_live_YOUR_API_KEY
```

* Keys prefixed `sk_live_` authenticate against the production environment.
* Keys prefixed `sk_test_` authenticate against the sandbox environment.

Generate and manage your API keys in the [Dashboard](https://dashboard.agribackup.com) or via the [API Keys endpoints](/sdks/enterprise-api-keys/list-api-keys).

## Request & Response Format

* All request bodies must be JSON with `Content-Type: application/json`.
* File uploads (land tenure documents, GeoJSON files) use `multipart/form-data`.
* All timestamps are ISO 8601 in UTC.
* All monetary quantities use decimal strings to avoid floating-point precision issues.

## Idempotency

Async ingestion endpoints (`POST /polygons`, `POST /batches`, `POST /shipments/link`) support idempotency keys. Pass a unique UUID in the `Idempotency-Key` header. If you retry the same key within 24 hours, the original response is returned without re-processing.

```http theme={null}
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
```

## Rate Limits

The API enforces a limit of **100 requests per second** for production keys. Every response includes rate limit headers:

| Header                  | Description                              |
| ----------------------- | ---------------------------------------- |
| `X-RateLimit-Limit`     | Your per-second allowance                |
| `X-RateLimit-Remaining` | Requests remaining in the current window |
| `X-RateLimit-Reset`     | UTC epoch seconds when the window resets |

When you exceed the limit, the API returns `429 Too Many Requests`. Implement exponential backoff before retrying.

## API Resource Groups

<CardGroup cols={2}>
  <Card title="Risk & Assessment" icon="chart-line" href="/sdks/enterprise-risk-management/assess-risk-by-polygon-pre-assessment">
    Pre-assess deforestation risk by polygon or coordinate before full ingestion.
  </Card>

  <Card title="API Keys" icon="key" href="/sdks/enterprise-api-keys/list-api-keys">
    Generate, rotate, and revoke API keys for your organization.
  </Card>

  <Card title="Credentials" icon="lock" href="/sdks/enterprise-credentials/ingest-traces-nt-credentials-into-vault">
    Store and manage TRACES NT credentials for automated DDS submission.
  </Card>

  <Card title="Suppliers" icon="building" href="/sdks/enterprise-suppliers/list-supplier-mappings">
    Map ERP vendor IDs to EU Operator UUIDs for compliant traceability.
  </Card>

  <Card title="Polygons" icon="map" href="/sdks/enterprise-polygons/ingest-geojson-polygons-async">
    Ingest and satellite-verify GeoJSON farm polygons.
  </Card>

  <Card title="Batches" icon="box" href="/sdks/enterprise-batches/register-a-consolidated-eudr-batch-async">
    Register consolidated commodity batches anchored on Hedera DLT.
  </Card>

  <Card title="Logistics" icon="truck" href="/sdks/enterprise-logistics/cryptographically-link-a-batch-to-a-shipment-async">
    Cryptographically link batches to shipments via Bill of Lading.
  </Card>

  <Card title="Declarations" icon="file-certificate" href="/sdks/enterprise-declarations/generate-due-diligence-statement-dds">
    Generate, submit, and revoke Due Diligence Statements for TRACES NT.
  </Card>

  <Card title="Evidence" icon="shield-check" href="/sdks/enterprise-evidence/retrieve-batch-cryptographic-evidence">
    Retrieve Hedera DLT cryptographic evidence for batches, polygons, and shipments.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/sdks/enterprise-webhooks/register-webhook-endpoint">
    Register endpoints to receive real-time compliance event notifications.
  </Card>

  <Card title="Archival" icon="archive" href="/sdks/enterprise-archival/generate-bulk-archive-report">
    Generate and download bulk compliance archive packages for auditors.
  </Card>

  <Card title="Jobs & Diagnostics" icon="circle-check" href="/sdks/enterprise-jobs/retrieve-job-status-and-metrics">
    Monitor async job status and check API infrastructure health.
  </Card>
</CardGroup>

## Error Responses

All errors follow a consistent JSON schema:

```json theme={null}
{
  "code": "POLYGON_NOT_COMPLIANT",
  "message": "One or more referenced polygons have not passed satellite verification.",
  "details": [
    {
      "code": "POLYGON_NOT_VERIFIED",
      "field": "polygonIds",
      "issue": "Polygon poly_abc123 has not completed satellite verification."
    }
  ]
}
```

See the [Error Codes](/reference/error-codes) reference for the complete list of status codes and error types.
