feat(API): align and improve API coverage across v2 endpoints#1145
Merged
Stefan Bruhns (sbruhns) merged 8 commits intoMay 21, 2026
Conversation
A broad pass over the v2 spec to make documented behavior match the
actual API. Every change reflects behavior the API already exhibits;
no endpoint behavior is altered.
## Response coverage
Every v2 operation now documents 401, 403, and (where applicable)
422 alongside the previously-documented 400/404/429. The 403
description on each operation calls out the required OAuth scope,
the permission needed, and any account-feature requirement
(e.g. Glossary, Webhooks, Job Templates, Over-the-Air Translations,
Attachable Screenshots, Verification System, Advanced Workflows,
Workflow, Batch Actions, Branching, Automation Job Creation,
GitLab Sync, History).
### Status-code corrections
- `POST /projects/{project_id}/jobs/{id}/lock` and `.../unlock` now
document the 200 JSON response (was incorrectly listed as 204).
- `GET /projects/{project_id}/locales/{locale_id}/downloads/{id}`
documents 410 Gone for expired downloads.
## New request-body fields
Documents fields the API has been accepting but the spec did not
list:
- **Projects** (create + update): `smart_suggest_enabled`,
`smart_suggest_use_glossary`, `smart_suggest_use_machine_translation`,
`translation_keys_sort_collation`, `autocomplete_job_enabled`,
`job_locking_enabled`, `cldr_version`. `default_encoding` is now
also accepted on create (it was previously only documented on
update).
- **Branches/create**: `base` for chaining branches in the newer
branching system.
- **Locales** (create + update): `unverify_on_source_changes`,
`language_ai_profile`.
- **Translations**: `minor_change` on create + update; `reviewed` on
create (was previously only on update).
- **Keys** (create + update): `excluded_in_locales`,
`format_value_type`.
- **Uploads/create**: `skip_automated_job_creation`,
`figma_page_name`, `upload_meta_data`.
- **Automations** (create + update): `job_owner_id`,
`include_only_updated_locales`.
- **ICU/skeleton**: `id` as an alternative source of content
(mutually exclusive with `content`).
- **Search/in_account**: `project_ids` to scope the search.
## New query parameters
- **Projects/list**: `q` (with the `name:<text>` substring syntax),
enum-tightened `sort_by` and `filters`.
- **Translations/list**: `key_id` and `locale_id` as filters
equivalent to the nested-route forms.
- **Jobs/list**: `states` (multiple at once) and `key_id`.
- **Jobs/show**: `include_figma_preview_attachment`.
- **Tags/list**: `only_system_tags` (inverse of `exclude_system_tags`).
- **Comments/list**: tightened `filters` (`read`/`unread`) and `order`
(`asc`/`desc`) to proper enums.
- **Documents/list**: `q` search.
- **Notifications/list**: `last_days`.
- **Translation orders/list**: `translation_id` filter.
- **Account locales/list**: `page` and `per_page` (pagination is
supported by the endpoint).
## Schema corrections
Fields the API emits are now declared in the corresponding schema:
- **upload_batch**: field renamed from `state` to `status` (matches
the actual JSON payload); adds `uploads_count`.
- **translation_order**: field renamed from `tag` to `tag_name`.
- **invitation**: field renamed from `project_role` to `project_roles`
(plural — the API emits an array).
- **distribution**: renamed `distribution_preview` schema to
`distribution_details`; adds `release_count`, `updated_at`;
marks `deleted_at` nullable.
- **release**: adds `locale_codes` (the form returned by list
endpoints) and `state` (returned by show); clarifies that the
full `locales` array is only returned by the show endpoint.
- **automation**: adds `project_ids`, `job_owner_id`,
`include_only_updated_locales`.
- **branch**: adds the `base` field and a proper `state` enum
(`creating_branch`, `merging_branch`, `syncing_branch`, `merged`,
`success`, `branch_error`, `merge_conflict`).
- **locale**: adds `language_ai_profile`, and
`unverify_on_source_changes` (returned only when the account
feature is enabled).
- **glossary**: adds `spaces`. **glossary_term**: adds the parent
`glossary` association.
- **project_details**: adds `branch`,
`autotranslate_overwrite_unverified_translations`,
`autocomplete_job_enabled`.
- **job_details**: adds `locked` and `figma_preview_attachment`;
documents `annotations` as conditional on
`include_annotations=true`.
- **key_preview** (shared by jobs, translations, versions, search,
glossary terms, comments): adds `data_type` and `tags`.
- **screenshot_marker**: `presentation` is now typed as a JSON object
with `x`, `y`, `w`, `h` (was incorrectly typed as a string).
- **repo_sync**: adds `pr_branch`.
- **job_template** and **organization_job_template**: add
`autotranslate_enabled`. The organization variant also gets an
optional `source_locale_id`.
- **tag**: adds `system_tag`.
- **account_details**: notes that `roles` is only returned when the
account has the Bot Role beta feature enabled.
## Enum tightening
Constraints the API enforces are now declared as enums in the spec:
- `authorizations.scopes`: `read`, `write`, `orders.create`,
`team.manage`.
- Style guides: `target_audience`, `grammatical_person`, and
`vocabulary_type` are constrained to fixed value sets.
- Branches merge/sync: `strategy` accepts `use_main`, `use_branch`,
and the deprecated alias `use_master`.
## Operation descriptions
Filled in gaps where the API does work the prior description did
not mention:
- Asynchronous cascades on branches create/merge/sync, projects
create with `source_project_id`, projects destroy, releases
publish, webhooks test, and locale downloads create.
- Soft-delete semantics on job templates, projects, distributions.
- Default values (e.g. `shares_translation_memory` defaults to
`true` on non-clone project creates).
- Feature-availability notes on every operation gated by a paid or
beta feature.
`paths/repo_syncs/create.yaml`, `paths/automations/create.yaml`, and `paths/automations/index.yaml` had duplicate `'422'` / `'403'` response keys that caused swagger-cli to reject the spec with `duplicated mapping key`. Removes the duplicates and reorders the response block so each status code appears once, in ascending order.
… to Java test, regenerate compiled.json - Restore the `q` filter parameter on GET /locales that was inadvertently dropped - Add `skip_automated_job_creation` parameter to the Java uploads test to match the newly documented field - Regenerate doc/compiled.json to reflect all spec changes in this branch Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Removes the branch-related spec changes from this PR — those files will be handled separately. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sven Dunemann (forelabs)
approved these changes
May 21, 2026
Co-authored-by: Sven Dunemann <sven.dunemann@phrase.com>
Co-authored-by: Sven Dunemann <sven.dunemann@phrase.com>
jablan
reviewed
May 21, 2026
| updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, | ||
| localeMapping, formatOptionsMap, autotranslate, verifyMentionedTranslations, markReviewed, tagOnlyAffectedKeys, | ||
| translationKeyPrefix); | ||
| translationKeyPrefix, null); |
Collaborator
There was a problem hiding this comment.
please add the new parameter using a variable like the others.
Collaborator
|
are we sure not to add something that's not supposed to be exposed? perhaps corresponding features owners should be made aware and review? perhaps this PR could be split into several smaller? e.g. low risk one (40x responses), new parameters, description changes... |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jablan
reviewed
May 21, 2026
| '403': | ||
| "$ref": "../../responses.yaml#/403" | ||
| description: Forbidden. Returned when the access token lacks the `write` scope or when the requesting user is not allowed to unlink keys for this parent. | ||
| '404': |
Collaborator
There was a problem hiding this comment.
not sure we should list 404 result
never mind, we already do, so it's not a time to raise this now.
jablan
approved these changes
May 21, 2026
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A broad pass over the v2 spec to make documented behavior match the actual API. Every change reflects behavior the API already exhibits; no endpoint behavior is altered.
Response coverage
Every v2 operation now documents 401, 403, and (where applicable) 422 alongside the previously-documented 400/404/429. The 403 description on each operation calls out the required OAuth scope, the permission needed, and any account-feature requirement (e.g. Glossary, Webhooks, Job Templates, Over-the-Air Translations, Attachable Screenshots, Verification System, Advanced Workflows, Workflow, Batch Actions, Branching, Automation Job Creation, GitLab Sync, History).
Status-code corrections
POST /projects/{project_id}/jobs/{id}/lockand.../unlocknow document the 200 JSON response (was incorrectly listed as 204).GET /projects/{project_id}/locales/{locale_id}/downloads/{id}documents 410 Gone for expired downloads.New request-body fields
Documents fields the API has been accepting but the spec did not list:
smart_suggest_enabled,smart_suggest_use_glossary,smart_suggest_use_machine_translation,translation_keys_sort_collation,autocomplete_job_enabled,job_locking_enabled,cldr_version.default_encodingis now also accepted on create (it was previously only documented on update).basefor chaining branches in the newer branching system.unverify_on_source_changes,language_ai_profile.minor_changeon create + update;reviewedon create (was previously only on update).excluded_in_locales,format_value_type.skip_automated_job_creation,figma_page_name,upload_meta_data.job_owner_id,include_only_updated_locales.idas an alternative source of content (mutually exclusive withcontent).project_idsto scope the search.New query parameters
q(with thename:<text>substring syntax), enum-tightenedsort_byandfilters.key_idandlocale_idas filters equivalent to the nested-route forms.states(multiple at once) andkey_id.include_figma_preview_attachment.only_system_tags(inverse ofexclude_system_tags).filters(read/unread) andorder(asc/desc) to proper enums.qsearch.last_days.translation_idfilter.pageandper_page(pagination is supported by the endpoint).Schema corrections
Fields the API emits are now declared in the corresponding schema:
statetostatus(matches the actual JSON payload); addsuploads_count.tagtotag_name.project_roletoproject_roles(plural — the API emits an array).distribution_previewschema todistribution_details; addsrelease_count,updated_at; marksdeleted_atnullable.locale_codes(the form returned by list endpoints) andstate(returned by show); clarifies that the fulllocalesarray is only returned by the show endpoint.project_ids,job_owner_id,include_only_updated_locales.basefield and a properstateenum (creating_branch,merging_branch,syncing_branch,merged,success,branch_error,merge_conflict).language_ai_profile, andunverify_on_source_changes(returned only when the account feature is enabled).spaces. glossary_term: adds the parentglossaryassociation.branch,autotranslate_overwrite_unverified_translations,autocomplete_job_enabled.lockedandfigma_preview_attachment; documentsannotationsas conditional oninclude_annotations=true.data_typeandtags.presentationis now typed as a JSON object withx,y,w,h(was incorrectly typed as a string).pr_branch.autotranslate_enabled. The organization variant also gets an optionalsource_locale_id.system_tag.rolesis only returned when the account has the Bot Role beta feature enabled.Enum tightening
Constraints the API enforces are now declared as enums in the spec:
authorizations.scopes:read,write,orders.create,team.manage.target_audience,grammatical_person, andvocabulary_typeare constrained to fixed value sets.strategyacceptsuse_main,use_branch, and the deprecated aliasuse_master.Operation descriptions
Filled in gaps where the API does work the prior description did not mention:
source_project_id, projects destroy, releases publish, webhooks test, and locale downloads create.shares_translation_memorydefaults totrueon non-clone project creates).