Skip to content

API V1 · Resources

Upload a resource file ZIP archive

POST
/v1/{workspaceUrl}/projects/{projectUrl}/resources/zip
curl --request POST \
--url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/zip \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: multipart/form-data' \
--form file=@translations.json

Uploads a ZIP archive containing multiple resource files to the specified project. The archive is extracted and all visible files within it are imported. Language detection is performed automatically based on file names and paths. Import behavior for source and target languages can be controlled through optional parameters.

workspaceUrl
required
string

WorkspaceUrl

projectUrl
required
string

ProjectUrl

source:createNew
boolean

If this file belongs to the source language: If new segments should be created

source:updateExisting
boolean

If this file belongs to the source language: If changed segments should be updated

source:deactivateMissing
boolean

If this file belongs to the source language: If removed segments should be deactivated

target:createNew
boolean

If this file belongs to the target language: If new segments should be created

target:updateExisting
boolean

If this file belongs to the target language: If changed segments should be updated

target:deactivateMissing
boolean

If this file belongs to the target language: If removed segments should be deactivated

branch
string

Name of the project branch to import into. If omitted, the project’s default branch is used. Returns 422 if the branch name does not exist in the project.

Media typemultipart/form-data
object
file
required

The zip file that will be uploaded

string format: binary

Successfully uploaded and extracted the ZIP archive. All contained resource files have been scheduled for import.

Media typeapplication/json

Examples

ExamplezipUploadSuccess

Successful ZIP upload

ZipUploadSuccess

{
"status": "Success"
}

Bad Request: The ZIP archive is empty or contains no visible files.

Media typeapplication/json

Unauthorized: Authentication credentials are missing or invalid.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Forbidden: The authenticated user does not have resource management permission on this project.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Not Found: The specified workspace or project does not exist.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Unprocessable Entity: The specified branch name does not exist in the project, or an archive entry has an extension the project type cannot import (one files.invalid_extension error per entry, naming it).

Media typeapplication/json
object
error
object
code
string
description
string
status
object
error
boolean
is4xxClientError
boolean
is5xxServerError
boolean
is1xxInformational
boolean
is2xxSuccessful
boolean
is3xxRedirection
boolean
validationErrors
Array<object>
object
field
string
errors
Array<object>
object
code
string
description
string
parameters
object
key
additional properties

Examples

ExampleunsupportedFile

Unsupported file extension

UnsupportedFile

{
"validationErrors": [
{
"field": "files",
"errors": [
{
"code": "files.invalid_extension",
"description": "File 'Resources.en.txt' has an unsupported extension; this project imports: resx, resw.",
"parameters": {
"file": "Resources.en.txt"
}
}
]
}
]
}

Internal Server Error: An unexpected error occurred during the import process.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}