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

# Exports: Retrieve Your Mapping Results Automatically

> Get mapping results as files on demand or via webhook. Configure export webhooks, trigger manual exports, and customize the file format for your organization.

An export is a file containing your mapping results — matched hotel records with reference IDs, confidence scores, and supplier IDs — delivered after a mapping job completes. You can retrieve results manually by downloading a file at any time, or configure a webhook so Mapping.Travel pushes results to your server automatically when each job finishes. You can also customize the fields and format included in every export.

## Two ways to get results

<CardGroup cols={2}>
  <Card title="Manual download" icon="download">
    Trigger an export on demand and receive a presigned URL to download the results file directly.
  </Card>

  <Card title="Export webhook" icon="webhook">
    Configure a URL and Mapping.Travel calls it automatically whenever a mapping job completes.
  </Card>
</CardGroup>

## Manual export

To trigger an export manually, call `POST /api/v1/mapping/{mappingJobId}/export` with your Bearer token:

```bash theme={null} theme={null}
curl -X POST https://api.mapping.travel/api/v1/mapping/{mappingJobId}/export \
  -H "Authorization: Bearer <token>"
```

The response includes an `exportFileId` and a presigned download URL. Download the file before the URL expires.

## Export webhooks

A webhook lets you receive export files automatically without polling. When a mapping job completes, Mapping.Travel sends an HTTP POST to your configured endpoint with a payload containing the export file URL and job metadata.

### Configure a webhook

<Steps>
  <Step title="Create a webhook config">
    Call `POST /api/v1/export-webhooks` with your endpoint URL:

    ```bash theme={null} theme={null}
    curl -X POST https://api.mapping.travel/api/v1/export-webhooks \
      -H "Authorization: Bearer <token>" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://your-server.example.com/mapping-webhook",
        "active": true
      }'
    ```

    The response includes a webhook `id` you can use to update or delete the config later.
  </Step>

  <Step title="Handle the webhook delivery">
    When a mapping job completes, Mapping.Travel sends a POST request to your URL. Your endpoint must return a `2xx` response to acknowledge receipt.
  </Step>
</Steps>

### Manage webhook configs

| Endpoint                              | Description                                    |
| ------------------------------------- | ---------------------------------------------- |
| `POST /api/v1/export-webhooks`        | Create a new webhook config                    |
| `GET /api/v1/export-webhooks`         | List all webhook configs for your organization |
| `GET /api/v1/export-webhooks/{id}`    | Get a specific webhook config                  |
| `PUT /api/v1/export-webhooks/{id}`    | Update a webhook config                        |
| `DELETE /api/v1/export-webhooks/{id}` | Delete a webhook config                        |

Pass `?activeOnly=true` to `GET /api/v1/export-webhooks` to list only enabled configs.

<Note>
  You can configure multiple webhook endpoints. Mapping.Travel calls all active webhooks when a job completes.
</Note>

## Export format configuration

You can control the shape of every export file your organization receives. Use `PUT /api/v1/export-format` to set or update your format preferences:

```bash theme={null} theme={null}
curl -X PUT https://api.mapping.travel/api/v1/export-format \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "csv",
    "fields": ["id", "name", "referenceHotelId", "matchMethod", "matchConfidence"]
  }'
```

Retrieve your current format config with `GET /api/v1/export-format`. If no config is set, exports use the default format and field set.

<Tip>
  Format config applies to all exports for your organization — both manual downloads and webhook deliveries. Update it before running a mapping job if you need a specific output shape.
</Tip>
