---
title: "exportEntities"
method: POST
path: "/v1/entity:export"
tags: ["Import-Export"]
---

# exportEntities

`POST /v1/entity:export`

Export entity data in a CSV-format. The export will export data as close as possible to what is visible on Entity UI tables.
The values exported as in some cases, transformed to human-readable values.

To force the export of raw values, use the `#` prefix in front of your field name when specifying the field on the `fields` param.

## Query parameters

- `job_id` string — The unique identifier of the import job.
- `is_template` boolean — Pass 'true' to generate import template
- `language` string — Export headers translation Language

## Request body

- EntitySearchParams
  - `q` string, required — Lucene [queries supported with ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax)
  - `include_scores` boolean — Adds a `_score` number field to results that can be used to rank by match score
  - `sort` union
    - string
    - string[]
  - `from` integer — The offset from which to start the search results. Only one of `from` or `search_after` should be used.
  - `size` integer — Max search size is 1000 with higher values defaulting to 1000
  - `hydrate` boolean — When true, enables entity hydration to resolve nested $relation & $relation_ref references in-place.
  - `anonymize` boolean — When true, anonymizes PII in the response: identifiers are replaced with deterministic pseudonyms, addresses are generalized and well-known free-text fields are redacted. Anonymization is forced (regardless of this parameter) when the access token was created with `anonymize: true`.
  - `fields` string[] — List of entity fields to include or exclude in the response Use ! to exclude fields, e.g. `!_id` to exclude the `_id` field. Globbing and globstart (**) is supported for nested fields.
  - `aggs` object — Aggregation supported by ElasticSearch allows summarizing data as metrics, statistics, or other analytics.
  - `include_deleted` 'true' | 'false' | 'only' — Whether to include deleted entities in the search results - `true`: include deleted entities - `false`: exclude deleted entities - `only`: include only deleted entities By default, no deleted entities are included in the search results.
  - `highlight` unknown
  - `stable_for` integer — A TTL (in seconds) that specifies how long the context should be maintained. Defaults to 30 seconds; configurable up to 60 seconds to prevent abuse. A value of 0 can be provided the close the context after the query. Defaults to none.
  - `stable_query_id` string — A unique identifier of the query context from the last stable query. The context is maintained for the duration of the stable_for value.
  - `search_after` union[] — The sort values from which to start the search results. Only one of `from` or `search_after` should be used. It is strongly recommended to always use the `sort_end` field from the last search result. Used for deep pagination, typically together with `stable_query_id` to maintain the context between requests. Requires explicit sort to work reliably. Typically used sort fields are `_id` or `_created_at`.
    - union
      - string, nullable
      - number, nullable

## Response `201`

created export url and download url

## Other responses

- `429` — Too many requests

---

[API](https://skmtc.net/epilot/apis/entity-api.md) · [All operations](https://skmtc.net/epilot/apis/entity-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/entity-api/revisions/3020984570dc/schema)
