# Generate SAF-T File Generates the SAF-T file for a specific period. The operation is asynchronous — the first response returns 202 while the file is being generated; keep requesting until you receive 200 with the download URL. If there are no documents to export in the selected period, returns 200 with a message instead of a url. Endpoint: GET /api/v3/saft/export.json Version: 3.1.0 Security: apiKeyAuth ## Query parameters: - `api_key` (string, required) Your API Key. Example: "YOUR_API_KEY" - `type` (string) SAF-T type. Enum: "all", "guides" - `period` (string) The period for which to generate the SAF-T. Enum: "year", "month", "week", "day" - `year` (integer) The year for which to generate the SAF-T, from 2015 to the current year (otherwise 422). Defaults to the current year. Example: 2026 - `month` (integer) The month for which to generate the SAF-T, 1 to 12 (otherwise 422). Defaults to the current month. Example: 6 - `day` (string) Required when period is week or day; ignored for year and month. With period=day it is the exact day. With period=week it can be any day of the wanted week (Monday to Sunday); the week is cut at the month boundaries of year/month. Omitting it with week or day returns 500 (after the company-data check). Example: "1" - `overwrite` (boolean) Accepted for compatibility; it has no effect. ## Response 200 fields (application/json): - `url` (string) Link to download your SAF-T file. Absent when there are no documents to export in the selected period — see message instead. Example: "https://some.url" - `message` (string) Present instead of url when there are no documents to export in the selected period. Example: "There aren't any documents to export on the selected period." ## Response 202 fields (application/json): - `message` (string) Example: "The SAF-T file generation was started. Please keep requesting until you get back the url." ## Response 401 fields (application/json): - `errors` (array) Example: [{"error":"Authentication Error"}] - `errors.error` (string) ## Response 409 fields (application/json): - `message` (string) Example: "Warning! There is required information missing from Company information. Before you export the SAF-T PT, please go to Company information and fill out the missing fields." ## Response 422 fields (application/json): - `errors` (array) Example: [{"error":"An unexpected error occurred"}] - `errors.error` (string) ## Response 500 fields (application/json): - `errors` (array) Example: [{"error":"An unexpected error occurred"}] - `errors.error` (string)