> For the complete documentation index, see [llms.txt](https://docs.userlane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.userlane.com/developers/analytics-api/public/request-export-endpoint.md). Agents can also search and read this documentation through its [MCP server](https://docs.userlane.com/~gitbook/mcp).

# Request Export Endpoint

Request an export. Repeat the same request until the status is `ready`, then download the file from `downloadUrl`. Identical requests share one export.

While an export is `running` the response carries `retryAfter`, the number of seconds to wait before asking again. Asking sooner is rejected by the rate limit rather than answered. A `ready` response carries `expiresAt`, after which the file is deleted and asking again rebuilds it.

`start` and `end` are inclusive. `end` must not be in the future, and the range must not be longer than 366 days.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://api.userlane.com/analytics"}],"security":[{"ApiTokenAuth":[]}],"components":{"securitySchemes":{"ApiTokenAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Dataset":{"type":"string","enum":["tasks"],"title":"Dataset"},"ExportResponse":{"properties":{"exportId":{"type":"string","title":"Exportid","description":"Identifies the export by its parameters: the same dataset, property, and range always give the same id."},"status":{"$ref":"#/components/schemas/ExportStatus","description":"`running`: ask again later. `ready`: download it from `downloadUrl`. `failed`: see `error`; asking again starts a new run."},"generatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generatedat","description":"When the ready file was generated. Set only when ready."},"downloadUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Downloadurl","description":"Where to download the file. Set only when ready."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiresat","description":"When the file is deleted and `downloadUrl` stops working. Set only when ready. Asking again after that rebuilds the export."},"sizeBytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sizebytes","description":"Compressed size of the file in bytes, so a client can budget the download. This is what a client sending `Accept-Encoding: gzip` receives; one that does not receives the file decompressed, which is several times larger. Set only when ready."},"retryAfter":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retryafter","description":"Seconds to wait before asking again. Set only while running; asking sooner is rejected by the rate limit."},"error":{"anyOf":[{"$ref":"#/components/schemas/ExportFailure"},{"type":"null"}],"description":"Why the run failed. Set only when failed."}},"type":"object","required":["exportId","status"],"title":"ExportResponse"},"ExportStatus":{"type":"string","enum":["running","ready","failed"],"title":"ExportStatus"},"ExportFailure":{"properties":{"reason":{"$ref":"#/components/schemas/ExportFailureReason","description":"Why the run failed. `timeout`: the export took too long, so try a shorter range. `error`: anything else; asking again starts a new run."},"message":{"type":"string","title":"Message","description":"Human-readable explanation of the failure."}},"type":"object","required":["reason","message"],"title":"ExportFailure"},"ExportFailureReason":{"type":"string","enum":["timeout","error"],"title":"ExportFailureReason"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/public/exports/property_id/{property_id}":{"post":{"tags":["public"],"summary":"Request Export Endpoint","description":"Request an export. Repeat the same request until the status is `ready`, then\ndownload the file from `downloadUrl`. Identical requests share one export.\n\nWhile an export is `running` the response carries `retryAfter`, the number\nof seconds to wait before asking again. Asking sooner is rejected by the\nrate limit rather than answered. A `ready` response carries `expiresAt`,\nafter which the file is deleted and asking again rebuilds it.\n\n`start` and `end` are inclusive. `end` must not be in the future, and the\nrange must not be longer than 366 days.","operationId":"request_export_endpoint_public_exports_property_id__property_id__post","parameters":[{"name":"property_id","in":"path","required":true,"schema":{"type":"string","title":"Property Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Type of date range..","default":"custom","title":"Type"},"description":"Type of date range.."},{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date of the range, inclusive. Required. Can be an ISO date ('2024-01-01') or datetime ('2024-01-01T00:00:00.000Z').","title":"Start"},"description":"Start date of the range, inclusive. Required. Can be an ISO date ('2024-01-01') or datetime ('2024-01-01T00:00:00.000Z')."},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date of the range, inclusive. Required. Can be an ISO date ('2024-12-31') or datetime ('2024-12-31T23:59:59.999Z').","title":"End"},"description":"End date of the range, inclusive. Required. Can be an ISO date ('2024-12-31') or datetime ('2024-12-31T23:59:59.999Z')."},{"name":"dataset","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Dataset","description":"Dataset to export."},"description":"Dataset to export."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.userlane.com/developers/analytics-api/public/request-export-endpoint.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
