# Request a resource export

`POST https://api.lingohub.com/v1/{workspaceUrl}/projects/{projectUrl}/exports`

LingoHub API V1 · [Exports](https://developers.lingohub.com/reference/v1/operations/tags/exports.md) · operation `v1ResourceExportsRequestExport`

Initiates the creation of a resource export that is assembled asynchronously in the background. Once completed, the export produces a downloadable ZIP file containing the project's resource files. The optional request body allows filtering by specific file paths, language codes, and overriding the export format. Use the GET endpoint with the returned export ID to poll for completion status and retrieve the download URL.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `workspaceUrl` | path | yes | string | workspaceUrl |
| `projectUrl` | path | yes | string | projectUrl |

## Example request

```sh
curl --request POST \
  --url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/exports \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "filePaths": [
    "config/locales/%{locale}/messages.yml"
  ],
  "iso2Slugs": [
    "en",
    "de",
    "fr"
  ],
  "exportFormat": "standard_json",
  "branch": "main"
}'
```

## Responses

- `200`: Successfully created the resource export request. The export is being assembled in the background.
- `401`: Unauthorized: Authentication credentials are missing or invalid.
- `403`: Forbidden: The authenticated user does not have resource view permission on this project.
- `404`: Not Found: The specified workspace, project, or a filtered resource file path does not exist.
- `422`: Unprocessable Entity: The specified branch name does not exist in the project.

## OpenAPI definition

The complete definition of this operation, with every schema it references:

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "LingoHub API V1",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.lingohub.com",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Exports",
      "description": "Endpoints for requesting a resource export and checking their statuses"
    }
  ],
  "paths": {
    "/v1/{workspaceUrl}/projects/{projectUrl}/exports": {
      "post": {
        "tags": [
          "Exports"
        ],
        "summary": "Request a resource export",
        "description": "Initiates the creation of a resource export that is assembled asynchronously in the background. Once completed, the export produces a downloadable ZIP file containing the project's resource files. The optional request body allows filtering by specific file paths, language codes, and overriding the export format. Use the GET endpoint with the returned export ID to poll for completion status and retrieve the download URL.",
        "operationId": "v1ResourceExportsRequestExport",
        "parameters": [
          {
            "name": "workspaceUrl",
            "in": "path",
            "description": "workspaceUrl",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectUrl",
            "in": "path",
            "description": "projectUrl",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created the resource export request. The export is being assembled in the background.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceExportResponse"
                },
                "examples": {
                  "exportCreated": {
                    "summary": "Newly created export (processing)",
                    "description": "exportCreated",
                    "value": {
                      "id": "reg_3163-0556-1428-5087674",
                      "status": "PROCESSING",
                      "resourceExports": [],
                      "errorDetails": null,
                      "filePath": null,
                      "downloadUrl": null,
                      "triggerType": "API_V1",
                      "createdAt": "2025-01-15T10:30:00.000+00:00"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: The authenticated user does not have resource view permission on this project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "404": {
            "description": "Not Found: The specified workspace, project, or a filtered resource file path does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity: The specified branch name does not exist in the project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ResourceExportRequest": {
        "type": "object",
        "description": "optional request body that acts as filter and may specify the export format",
        "properties": {
          "filePaths": {
            "type": "array",
            "description": "An additional filter for requesting the export of particular files. If not given, all files of the project will be exported. File paths (including locale placeholder if applicable) as seen in Resources view.",
            "example": [
              "config/locales/%{locale}/messages.yml"
            ],
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "iso2Slugs": {
            "type": "array",
            "description": "An additional filter for requesting the export of particular languages. If not given, all files of all languages of the project will be exported. ISO-639-1 codes of project languages.",
            "example": [
              "en",
              "de",
              "fr"
            ],
            "items": {
              "type": "string",
              "description": "Language code that uniquely identifies a locale. Valid examples would be 'en', 'en-GB', 'de', 'de-DE' etc. according to [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)."
            },
            "uniqueItems": true
          },
          "exportFormat": {
            "type": "string",
            "description": "Several project types allow to download files in a different format than as defined by the project type. This setting overrides the export format. If not given, the type of the project will be used.",
            "enum": [
              "strings.ios",
              "xml.android.resources",
              "properties",
              "standard_json"
            ],
            "example": "standard_json"
          },
          "branch": {
            "type": "string",
            "description": "Name of the project branch to export from. If omitted, the project's default branch is used. Returns 422 if the branch name does not exist in the project.",
            "example": "main"
          }
        }
      },
      "ResourceExportResponse": {
        "type": "object",
        "description": "Response containing the status and details of a resource export, including individual file entries and download URLs.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for this resource export.",
            "example": "reg_abc123def456"
          },
          "status": {
            "$ref": "#/components/schemas/ResourceExportParamStatus",
            "description": "The compound status of this resource export. Reflects the overall progress across all entries."
          },
          "resourceExports": {
            "type": "array",
            "description": "The list of individual resource export entries (one per file/locale combination).",
            "items": {
              "$ref": "#/components/schemas/ResourceExportEntryResponse"
            }
          },
          "errorDetails": {
            "type": "string",
            "description": "Detailed information about the error that occurred, if the export failed. Null on success."
          },
          "filePath": {
            "type": "string",
            "description": "The name of the ZIP file that is or will be generated for this export.",
            "example": "frontend-app.zip"
          },
          "downloadUrl": {
            "type": "string",
            "description": "The S3 download URL for the exported ZIP. Null while the export is in progress or if an error occurred.",
            "example": "https://lingohub-exports.s3.amazonaws.com/exports/abc123/frontend-app.zip"
          },
          "triggerType": {
            "$ref": "#/components/schemas/TriggerType",
            "description": "The trigger that caused this resource export (e.g. manual, webhook)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the resource export was created.",
            "example": "2025-02-20T14:45:00.000+00:00"
          }
        },
        "required": [
          "id",
          "resourceExports",
          "status"
        ]
      },
      "ResourceExportParamStatus": {
        "type": "string",
        "enum": [
          "NEW",
          "SCHEDULED",
          "PROCESSING",
          "SUCCESS",
          "SKIPPED",
          "ERROR"
        ]
      },
      "ResourceExportEntryResponse": {
        "type": "object",
        "description": "Status and download information for a single file within a resource export.",
        "properties": {
          "filePath": {
            "type": "string",
            "description": "The file path of the exported entry, including locale placeholder if applicable.",
            "example": "config/locales/en/messages.yml"
          },
          "iso2Slug": {
            "type": "string",
            "description": "The ISO-639-1 language code for this entry.",
            "example": "de-AT"
          },
          "status": {
            "$ref": "#/components/schemas/ResourceExportParamStatus",
            "description": "The processing status of this individual export entry."
          },
          "downloadUrl": {
            "type": "string",
            "description": "The S3 download URL for this individual file. Null while processing or if an error occurred.",
            "example": "https://lingohub-exports.s3.amazonaws.com/exports/abc123/messages_de-AT.yml"
          }
        }
      },
      "TriggerType": {
        "type": "string",
        "enum": [
          "DOWNLOAD_SINGLE",
          "DOWNLOAD_MULTIPLE",
          "REPOSITORY_PUSH_MULTIPLE",
          "REPOSITORY_PUSH",
          "DISTRIBUTION_RELEASE",
          "PACKAGES",
          "BACKUPS",
          "ZENDESK_SELECTED",
          "ZENDESK_ALL",
          "ZENDESK_PUSH",
          "API_V1",
          "API_V2",
          "SINGLE_FILE_API_V1",
          "SEGMENT_CONTAINER",
          "XLIFF",
          "STORYBLOK_PUSH",
          "CONTENTFUL_PUSH",
          "CSV",
          "HUBSPOT_PUSH",
          "STRIPO_PUSH",
          "CRISP_HELPDESK_PUSH"
        ]
      },
      "V1ErrorInfo": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "API key authentication. Create API keys in your LingoHub workspace settings. Keys use the `lh-api_` prefix. Pass the full key as the Bearer token.",
        "scheme": "bearer"
      }
    }
  }
}
````
