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

# Get Export

> Retrieve a previously generated compliance export by ID.

## Endpoint

```
GET /v1/dpdp/exports/:exportId
```

## Authentication

Requires a developer API key in the `Authorization` header.

## Request Headers

| Header          | Value              |
| --------------- | ------------------ |
| `Authorization` | `Bearer <api_key>` |

## Path Parameters

| Parameter  | Type     | Required | Description   |
| ---------- | -------- | -------- | ------------- |
| `exportId` | `string` | Yes      | The export ID |

## Example Request

```bash theme={null}
curl https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/dpdp/exports/exp_01HXYZ... \
  -H "Authorization: Bearer gx_..."
```

## Response -- 200 OK

```json theme={null}
{
  "exportId": "exp_01HXYZ...",
  "type": "dpdp-audit",
  "dateFrom": "2026-01-01T00:00:00.000Z",
  "dateTo": "2026-04-01T00:00:00.000Z",
  "format": "json",
  "status": "completed",
  "recordCount": 42,
  "data": {
    "exportType": "dpdp-audit",
    "dateRange": {
      "from": "2026-01-01T00:00:00.000Z",
      "to": "2026-04-01T00:00:00.000Z"
    },
    "generatedAt": "2026-04-05T14:00:00.000Z",
    "developerId": "dev_01HXYZ...",
    "consentRecords": [...],
    "auditLog": [...],
    "grievances": [...]
  },
  "expiresAt": "2026-04-12T14:00:00.000Z",
  "createdAt": "2026-04-05T14:00:00.000Z"
}
```

## Response Fields

| Field         | Type     | Description                                                              |
| ------------- | -------- | ------------------------------------------------------------------------ |
| `exportId`    | `string` | Unique export ID                                                         |
| `type`        | `string` | Export type: `dpdp-audit`, `gdpr-article-15`, or `eu-ai-act-conformance` |
| `dateFrom`    | `string` | ISO-8601 start date of the export window                                 |
| `dateTo`      | `string` | ISO-8601 end date of the export window                                   |
| `format`      | `string` | Output format                                                            |
| `status`      | `string` | Export status: `completed`                                               |
| `recordCount` | `number` | Total number of records in the export                                    |
| `data`        | `object` | The export data payload                                                  |
| `expiresAt`   | `string` | ISO-8601 expiry timestamp (exports expire after 7 days)                  |
| `createdAt`   | `string` | ISO-8601 creation timestamp                                              |

## Error Responses

| Status | Code           | Description                |
| ------ | -------------- | -------------------------- |
| 401    | `UNAUTHORIZED` | Invalid or missing API key |
| 404    | `NOT_FOUND`    | Export not found           |

## SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  import Grantex from '@grantex/sdk';

  const grantex = new Grantex({ apiKey: 'gx_...' });

  const report = await grantex.dpdp.getExport('exp_01HXYZ...');
  // report.status → "completed"
  // report.data → { consentRecords: [...], auditLog: [...] }
  ```

  ```python Python theme={null}
  from grantex import Grantex

  grantex = Grantex(api_key="gx_...")

  report = grantex.dpdp.get_export("exp_01HXYZ...")
  print(report.status, report.record_count)
  ```
</CodeGroup>
