Translations

GET /v2/projects/:project_id/translations

List translations for the given project. If you want to download all translations for one locale we recommend to use the locales#download endpoint.

Rate limited: This call has a rate limiting applied
This endpoint is paginated.

Parameters

Name Type Description
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations?sort=updated_at&order=desc&q=PhraseApp*%2520unverified:true%2520excluded:true%2520tags:feature,center" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp translations list <project_id> \
--sort updated_at \
--order desc \
--query 'PhraseApp*%20unverified:true%20excluded:true%20tags:feature,center'

Response

Status: 200
[ { "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }, { "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ]

GET /v2/projects/:project_id/locales/:locale_id/translations

List translations for a specific locale. If you want to download all translations for one locale we recommend to use the locales#download endpoint.

This endpoint is paginated.

Parameters

Name Type Description
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/locales/:locale_id/translations?sort=updated_at&order=desc&q=PhraseApp*%2520unverified:true%2520excluded:true%2520tags:feature,center" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp translations by_locale <project_id> <locale_id> \
--sort updated_at \
--order desc \
--query 'PhraseApp*%20unverified:true%20excluded:true%20tags:feature,center'

Response

Status: 200
[ { "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }, { "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ]

GET /v2/projects/:project_id/keys/:key_id/translations

List translations for a specific key.

This endpoint is paginated.

Parameters

Name Type Description
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/keys/:key_id/translations?sort=updated_at&order=desc&q=PhraseApp*%2520unverified:true%2520excluded:true%2520tags:feature,center" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp translations by_key <project_id> <key_id> \
--sort updated_at \
--order desc \
--query 'PhraseApp*%20unverified:true%20excluded:true%20tags:feature,center'

Response

Status: 200
[ { "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }, { "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ]

GET /v2/projects/:project_id/translations/:id

Get details on a single translation.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations/:id" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp translation show <project_id> <id>

Response

Status: 200
{ "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "user": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "word_count": 2 }

POST /v2/projects/:project_id/translations

Create a translation.

Parameters

Name Type Description
locale_id id Locale. Can be the name or public id of the locale. Preferred is the public id.
key_id id Key
content string Translation content
plural_suffix
optional
string Plural suffix. Can be one of: zero, one, two, few, many, other.
Default: <blank>
unverified
optional
boolean Indicates whether translation is unverified.
Default: false
excluded
optional
boolean Indicates whether translation is excluded.
Default: false

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST \
  -d '{"locale_id":"abcd1234cdef1234abcd1234cdef1234","key_id":"abcd1234cdef1234abcd1234cdef1234","content":"My translation","plural_suffix":"other"}' \
  -H 'Content-Type: application/json'
phraseapp translation create <project_id> \
--locale-id abcd1234cdef1234abcd1234cdef1234 \
--key-id abcd1234cdef1234abcd1234cdef1234 \
--content "My translation" \
--plural-suffix other

Response

Status: 201
{ "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "user": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "word_count": 2 }

PATCH /v2/projects/:project_id/translations/:id

Update an existing translation.

Parameters

Name Type Description
content string Translation content
plural_suffix
optional
string Plural suffix. Can be one of: zero, one, two, few, many, other.
Default: <blank>
unverified
optional
boolean Indicates whether translation is unverified.
Default: false
excluded
optional
boolean Indicates whether translation is excluded.
Default: false

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"content":"My translation","plural_suffix":"other"}' \
  -H 'Content-Type: application/json'
phraseapp translation update <project_id> <id> \
--content "My translation" \
--plural-suffix other

Response

Status: 200
{ "id": "abcd1234cdef1234abcd1234cdef1234", "content": "My translation", "unverified": false, "excluded": false, "plural_suffix": "", "key": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "home.index.headline", "plural": false }, "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE" }, "placeholders": [ "%{count}" ], "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "user": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "word_count": 2 }

PATCH /v2/projects/:project_id/translations/verify

Verify translations matching query.

Parameters

Name Type Description
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations/verify" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"q":"PhraseApp*%20unverified:true%20tags:feature,center","sort":"updated_at","order":"desc"}' \
  -H 'Content-Type: application/json'
phraseapp translations verify <project_id> \
--query 'PhraseApp*%20unverified:true%20tags:feature,center' \
--sort updated_at \
--order desc

Response

Status: 200
{ "records_affected": 96 }

PATCH /v2/projects/:project_id/translations/unverify

Mark translations matching query as unverified.

Parameters

Name Type Description
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations/unverify" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"q":"PhraseApp*%20verified:true%20tags:feature,center","sort":"updated_at","order":"desc"}' \
  -H 'Content-Type: application/json'
phraseapp translations unverify <project_id> \
--query 'PhraseApp*%20verified:true%20tags:feature,center' \
--sort updated_at \
--order desc

Response

Status: 200
{ "records_affected": 96 }

PATCH /v2/projects/:project_id/translations/exclude

Exclude translations matching query from locale export.

Parameters

Name Type Description
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations/exclude" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"q":"PhraseApp*%20verified:true%20tags:feature,center","sort":"updated_at","order":"desc"}' \
  -H 'Content-Type: application/json'
phraseapp translations exclude <project_id> \
--query 'PhraseApp*%20verified:true%20tags:feature,center' \
--sort updated_at \
--order desc

Response

Status: 200
{ "records_affected": 96 }

PATCH /v2/projects/:project_id/translations/include

Include translations matching query in locale export.

Parameters

Name Type Description
q
optional
string Specify a query to find translations by content (including wildcards).

The following qualifiers are supported in the query:
  • tags:XYZ for tags on the translation
  • unverified:{true|false} for verification status
  • excluded:{true|false} for exclusion status
  • updated_at:{>=| for date range queries
Find more examples here.
sort
optional
string Sort criteria. Can be one of: key_name, created_at, updated_at.
Default: key_name
order
optional
string Order direction. Can be one of: asc, desc.
Default: asc

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/translations/include" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"q":"PhraseApp*%20verified:true%20tags:feature,center","sort":"updated_at","order":"desc"}' \
  -H 'Content-Type: application/json'
phraseapp translations include <project_id> \
--query 'PhraseApp*%20verified:true%20tags:feature,center' \
--sort updated_at \
--order desc

Response

Status: 200
{ "records_affected": 96 }