---
title: "Export data"
method: POST
path: "/_fabric/{fabric}/_api/export"
tags: ["Import Export"]
---

# Export data

`POST /_fabric/{fabric}/_api/export`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/export/post.ts> (a function with typed inputs; its response is checked against the schema)

Run the **query** and return list of result documents. **Query** cannot contain the following keywords: **INSERT**, **UPDATE**, **REPLACE**, **REMOVE** and **UPSERT**.

## Path parameters

- `fabric` string, string, required

## Request body

- ApiExport
  - `bindVars` object: Key-value pairs representing the bind parameters. Optional if bind parameters are not used in query.
  - `query` string, string: C8QL query. Default: returns all documents.

## Response `200`

Successfully exported data.

- ExportHttpExamplesRc200
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `result` object[]
    - `_key` string
    - `name` string

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed to validate because you do not have access to the GeoFabric.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find collection.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
