{"openapi":"3.1.0","info":{"title":"wortwerk API","description":"Authenticate with `Authorization: Bearer <token>`: a personal access token (`wwu_…`, account settings or `wortwerk login`) acts as its user; a project token (`ww_…`, project settings) is limited to reading and syncing its project. Errors are `{ \"error\": code, \"message\": text }`.","version":"1.0.0"},"servers":[{"url":"https://wortwerk.li/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"security":[{"bearer":[]}],"paths":{"/auth/device":{"post":{"operationId":"postAuthDevice","tags":["Auth"],"summary":"Start a device login","description":"OAuth 2.0 device authorization (RFC 8628). Show `userCode` to the user, open `verificationUriComplete` and poll `POST /auth/token` every `interval` seconds.","security":[],"responses":{"200":{"description":"Codes for the CLI","content":{"application/json":{"schema":{"type":"object","properties":{"deviceCode":{"type":"string"},"userCode":{"type":"string"},"verificationUri":{"type":"string"},"verificationUriComplete":{"type":"string"},"expiresIn":{"type":"number"},"interval":{"type":"number"}},"required":["deviceCode","userCode","verificationUri","verificationUriComplete","expiresIn","interval"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientName":{"type":"string","minLength":1,"maxLength":80}},"required":["clientName"]}}}}}},"/auth/token":{"post":{"operationId":"postAuthToken","tags":["Auth"],"summary":"Poll a device login","description":"Returns 400 with `error` = `authorization_pending`, `slow_down`, `access_denied` or `expired_token` until the user approved the login.","security":[],"responses":{"200":{"description":"A personal access token","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]}},"required":["token","user"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceCode":{"type":"string","minLength":1}},"required":["deviceCode"]}}}}}},"/setup":{"post":{"operationId":"postSetup","tags":["Setup"],"summary":"Start browser-assisted project setup","description":"Uploads sanitized local discovery results, opens the setup URL, and polls `POST /setup/token` until the browser flow is complete. An optional personal bearer token binds the browser flow to that user.","security":[],"responses":{"200":{"description":"Codes for the CLI","content":{"application/json":{"schema":{"type":"object","properties":{"deviceCode":{"type":"string"},"userCode":{"type":"string"},"verificationUri":{"type":"string"},"verificationUriComplete":{"type":"string"},"expiresIn":{"type":"number"},"interval":{"type":"number"}},"required":["deviceCode","userCode","verificationUri","verificationUriComplete","expiresIn","interval"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientName":{"type":"string","minLength":1,"maxLength":80},"proposal":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"git":{"type":"object","properties":{"provider":{"type":"string","enum":["github","bitbucket"]},"repo":{"type":"string","pattern":"^[\\w.-]+\\/[\\w.-]+$"},"remote":{"type":"string","maxLength":80},"branch":{"type":"string","maxLength":200}},"required":["provider","repo","remote"]},"patterns":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":300},"format":{"type":"string","enum":["json","yaml","po","script"]},"locales":{"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"}},"confidence":{"type":"number","minimum":0,"maximum":1},"keyCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["path","format","locales","confidence"]}},"sourceLocale":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"},"locales":{"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"}},"localeAliases":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","patterns","locales"]}},"required":["clientName","proposal"]}}}}}},"/setup/token":{"post":{"operationId":"postSetupToken","tags":["Setup"],"summary":"Poll browser-assisted project setup","security":[],"responses":{"200":{"description":"CLI credentials and completed project","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]},"workspace":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"}},"required":["id","slug"]},"project":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"}},"required":["id","slug"]},"run":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},{"type":"null"}]},"warning":{"type":["string","null"]}},"required":["token","user","workspace","project","run","warning"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceCode":{"type":"string","minLength":1}},"required":["deviceCode"]}}}}}},"/me":{"get":{"operationId":"getMe","tags":["Auth"],"summary":"The token and its user","responses":{"200":{"description":"Token info","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"token":{"type":"object","properties":{"kind":{"type":"string","enum":["personal","project"]},"access":{"type":"string","enum":["read","write","ci"]},"workspaceId":{"description":"null: every workspace of the user","type":["string","null"]},"projectId":{"type":["string","null"]}},"required":["kind","access","workspaceId","projectId"]},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":"string"},"role":{"type":"string","description":"owner, admin, member or guest"}},"required":["id","name","slug","plan","role"]}}},"required":["user","token","workspaces"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}}}},"/me/token":{"delete":{"operationId":"deleteMeToken","tags":["Auth"],"summary":"Revoke the token used for this request","responses":{"204":{"description":"Revoked"},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}}}},"/workspaces":{"get":{"operationId":"getWorkspaces","tags":["Workspaces"],"summary":"List workspaces","responses":{"200":{"description":"Workspaces","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":"string"},"role":{"type":"string","description":"owner, admin, member or guest"}},"required":["id","name","slug","plan","role"]}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}}}},"/workspaces/{workspace}":{"get":{"operationId":"getWorkspacesByWorkspace","tags":["Workspaces"],"summary":"Get a workspace with plan and usage","responses":{"200":{"description":"Workspace","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":"object","properties":{"id":{"type":"string"},"maxProjects":{"type":["number","null"]},"maxKeys":{"type":"number"},"maxMembers":{"type":["number","null"]},"machineTranslation":{"type":"boolean"}},"required":["id","maxProjects","maxKeys","maxMembers","machineTranslation"]},"role":{"type":"string","description":"owner, admin, member or guest"},"features":{"type":"object","properties":{"machineTranslation":{"type":"boolean"}},"required":["machineTranslation"]},"usage":{"type":"object","properties":{"projects":{"type":"number"},"keys":{"type":"number"},"members":{"type":"number"}},"required":["projects","keys","members"]}},"required":["id","name","slug","plan","role","features","usage"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspace","required":true}]}},"/workspaces/{workspace}/projects":{"get":{"operationId":"getWorkspacesByWorkspaceProjects","tags":["Projects"],"summary":"List projects","responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"sourceLocale":{"type":"string"},"locales":{"type":"array","items":{"type":"string"}}},"required":["id","name","slug","sourceLocale","locales"]}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspace","required":true}]},"post":{"operationId":"postWorkspacesByWorkspaceProjects","tags":["Projects"],"summary":"Create a project","responses":{"201":{"description":"The new project","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"sourceLocale":{"type":"string"},"locales":{"type":"array","items":{"type":"string"}},"workspaceId":{"type":"string"},"editableLocales":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Locales a guest may edit, null when every locale is editable"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"format":{"type":"string","enum":["json","yaml","po","script"]}},"required":["id","path","format"]}},"repo":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github","bitbucket"]},"repo":{"type":"string"},"branch":{"type":"string"},"localeAliases":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["provider","repo","branch","localeAliases"]},{"type":"null"}]}},"required":["id","name","slug","sourceLocale","locales","workspaceId","editableLocales","files","repo"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"sourceLocale":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"},"locales":{"default":[],"type":"array","items":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"}}},"required":["name","slug","sourceLocale"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspace","required":true}]}},"/projects/{projectId}":{"get":{"operationId":"getProjectsByProjectId","tags":["Projects"],"summary":"Get a project with locales, files and repository","responses":{"200":{"description":"Project","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"sourceLocale":{"type":"string"},"locales":{"type":"array","items":{"type":"string"}},"workspaceId":{"type":"string"},"editableLocales":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Locales a guest may edit, null when every locale is editable"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"format":{"type":"string","enum":["json","yaml","po","script"]}},"required":["id","path","format"]}},"repo":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github","bitbucket"]},"repo":{"type":"string"},"branch":{"type":"string"},"localeAliases":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["provider","repo","branch","localeAliases"]},{"type":"null"}]}},"required":["id","name","slug","sourceLocale","locales","workspaceId","editableLocales","files","repo"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/stats":{"get":{"operationId":"getProjectsByProjectIdStats","tags":["Projects"],"summary":"Translation progress per locale","responses":{"200":{"description":"Stats","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"locale":{"type":"string"},"total":{"type":"number"},"translated":{"type":"number"},"needsReview":{"type":"number"},"approved":{"type":"number"},"untranslated":{"type":"number"}},"required":["locale","total","translated","needsReview","approved","untranslated"]}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/locales":{"post":{"operationId":"postProjectsByProjectIdLocales","tags":["Projects"],"summary":"Add a locale","responses":{"204":{"description":"Added"},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"}},"required":["code"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/locales/{code}":{"delete":{"operationId":"deleteProjectsByProjectIdLocalesByCode","tags":["Projects"],"summary":"Remove a locale","responses":{"204":{"description":"Removed"},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"path","name":"code","required":true}]}},"/projects/{projectId}/files":{"post":{"operationId":"postProjectsByProjectIdFiles","tags":["Files"],"summary":"Add or update a file mapping","responses":{"201":{"description":"File mapping","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"format":{"type":"string","enum":["json","yaml","po","script"]}},"required":["id","path","format"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":300},"format":{"type":"string","enum":["json","yaml","po","script"]},"options":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["path"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/files/{fileId}/download":{"get":{"operationId":"getProjectsByProjectIdFilesByFileIdDownload","tags":["Files"],"summary":"Download a file in one locale","description":"Serialized with the same adapter as git exports, so the output matches what a PR would contain.","responses":{"200":{"description":"File content. `x-wortwerk-path` holds the path in the repository","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"in":"query","name":"locale","schema":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"},"required":true},{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true}]}},"/projects/{projectId}/files/{fileId}/import":{"post":{"operationId":"postProjectsByProjectIdFilesByFileIdImport","tags":["Files"],"summary":"Upload a file in one locale","description":"The request body is the raw file content. Source files of a project connected to a repository come from the repository and cannot be uploaded.","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"202":{"description":"Queued import run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["import","export","pull","push","machine"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"result":{"anyOf":[{},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","status","result","error","createdAt","finishedAt"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"in":"query","name":"locale","schema":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"},"required":true},{"in":"query","name":"overwrite","schema":{"default":"false","type":"string","enum":["true","false"]},"description":"Replace existing translations"},{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true}]}},"/projects/{projectId}/keys":{"get":{"operationId":"getProjectsByProjectIdKeys","tags":["Keys"],"summary":"List keys with their source and translation","responses":{"200":{"description":"One page of keys","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"context":{"type":"string"},"description":{"type":"string"},"isPlural":{"type":"boolean"},"fileId":{"type":["string","null"]},"locale":{"type":"string"},"source":{"type":["string","null"]},"value":{"type":["string","null"]},"status":{"type":"string","enum":["untranslated","translated","needs_review","approved"]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","context","description","isPlural","fileId","locale","source","value","status","updatedAt"]}},"total":{"type":"number"},"nextCursor":{"type":["string","null"]}},"required":["data","total","nextCursor"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"in":"query","name":"locale","schema":{"type":"string"},"required":true,"description":"Locale code, or \"all\" for one row per key and target locale"},{"in":"query","name":"status","schema":{"type":"string","enum":["untranslated","translated","needs_review","approved"]}},{"in":"query","name":"search","schema":{"type":"string","maxLength":200}},{"in":"query","name":"name","schema":{"type":"string","maxLength":500}},{"in":"query","name":"fileId","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]},"post":{"operationId":"postProjectsByProjectIdKeys","tags":["Keys"],"summary":"Create a key","description":"Only for projects without a repository: keys of a connected project are added in the repository.","responses":{"201":{"description":"The key"},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"context":{"default":"","type":"string","maxLength":500},"description":{"default":"","type":"string","maxLength":2000},"fileId":{"default":null,"type":["string","null"]},"sourceValue":{"default":"","type":"string","maxLength":20000}},"required":["name"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/keys/{keyId}/translations/{locale}":{"put":{"operationId":"putProjectsByProjectIdKeysByKeyIdTranslationsByLocale","tags":["Keys"],"summary":"Set a translation","description":"Source edits may only change wording: placeholders, markup and plural forms must stay as in the repository.","responses":{"200":{"description":"The translation","content":{"application/json":{"schema":{"type":"object","properties":{"keyId":{"type":"string"},"locale":{"type":"string"},"value":{"type":"string"},"status":{"type":"string","enum":["untranslated","translated","needs_review","approved"]}},"required":["keyId","locale","value","status"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","maxLength":20000},"status":{"type":"string","enum":["untranslated","translated","needs_review","approved"]},"minor":{"type":"boolean"}},"required":["value"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"path","name":"keyId","required":true},{"schema":{"type":"string"},"in":"path","name":"locale","required":true}]}},"/projects/{projectId}/sync":{"post":{"operationId":"postProjectsByProjectIdSync","tags":["Sync"],"summary":"Pull from the repository, optionally export afterwards","responses":{"202":{"description":"Queued runs","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["import","export","pull","push","machine"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]}},"required":["id","kind","status"]}}},"required":["runs"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"export":{"default":false,"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/machine":{"post":{"operationId":"postProjectsByProjectIdMachine","tags":["Sync"],"summary":"Machine-translate every untranslated key of a locale","description":"Paid plans only. Results are marked as needs review.","responses":{"202":{"description":"Queued run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["import","export","pull","push","machine"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"result":{"anyOf":[{},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","status","result","error","createdAt","finishedAt"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2,3}([-_][A-Za-z0-9]{2,8})*$"}},"required":["locale"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/runs":{"get":{"operationId":"getProjectsByProjectIdRuns","tags":["Sync"],"summary":"Recent runs","responses":{"200":{"description":"Runs, newest first","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["import","export","pull","push","machine"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"result":{"anyOf":[{},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","status","result","error","createdAt","finishedAt"]}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}]}},"/projects/{projectId}/runs/{runId}":{"get":{"operationId":"getProjectsByProjectIdRunsByRunId","tags":["Sync"],"summary":"Get a run","responses":{"200":{"description":"Run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["import","export","pull","push","machine"]},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"result":{"anyOf":[{},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","kind","status","result","error","createdAt","finishedAt"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found","conflict","invalid","limit_reached","forbidden","http","internal"]},"message":{"type":"string"}},"required":["error","message"]}}}},"401":{"description":"Missing, invalid or expired token"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"path","name":"runId","required":true}]}}}}