POST/v2/projects/{projectId}/tasks/calculate-scope

Calculate task scope

Calculates the scope of a task for a project, language, and task type. Supply keys, languageId, and type, and use the query filters to determine which keys are included. The response reports character, word, and key counts, including keys with conflicts.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

6 parameters · 4 body fields
projectIdintegerrequired
The int64 identifier of the project whose task scope to calculate.
filterStatearray<string>optional
Include keys with translations in these states: UNTRANSLATED, TRANSLATED, REVIEWED, or DISABLED.
filterOutdatedbooleanoptional
Whether to include keys whose translation is outdated.
filterTaskInStatusarray<string>optional
Filter by task membership using `taskType,status`. Status must be IN_OPEN_TASK, NOT_IN_OPEN_TASK, HAS_BEEN_IN_TASK, or NEVER_IN_TASK; task membership is evaluated for the task language, and conditions for different task types are combined with AND.
filterHasSuggestionsbooleanoptional
Whether to include only keys with an active suggestion in the task language.
filterHasNoSuggestionsbooleanoptional
Whether to include only keys without an active suggestion in the task language.

Criteria for calculating task scope, including the selected keys, language, and task type.

branchstringoptional
Branch name to calculate scope for.
keysarray<integer>required
Set of key IDs to include in the scope calculation.
languageIdintegerrequired
The ID of the language for the task scope.
typestringrequired
Task type: TRANSLATE or REVIEW.
Allowed:TRANSLATEREVIEW

5 status codes
200Returns character, key, key-including-conflicts, and word counts for the calculated task scope.
characterCountintegerrequired
keyCountintegerrequired
keyCountIncludingConflictsintegerrequired
wordCountintegerrequired
400Returned when a required field is missing or a value fails validation, such as an invalid task type.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is not authenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user is not permitted to access the project.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project or a referenced resource cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request is invalid; a 401 indicates missing or invalid authentication, and a 403 indicates access is denied. A 404 is returned when the project or a referenced resource cannot be found. The projectId path parameter must identify the project, and keys, languageId, and type are required; type must be TRANSLATE or REVIEW.