Jobs

GET /v2/projects/:project_id/jobs

List all jobs for the given project.

This endpoint is paginated.

Parameters

Name Type Description
owned_by string filter by user owning job
assigned_to string filter by user assigned to job
state string filter by state of job Valid states are draft, in_progress, completed

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs?owned_by=abcd1234cdef1234abcd1234cdef1234&assigned_to=abcd1234cdef1234abcd1234cdef1234&state=completed" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp jobs list <project_id> \
--owned-by abcd1234cdef1234abcd1234cdef1234 \
--assigned-to abcd1234cdef1234abcd1234cdef1234 \
--state completed

Response

Status: 200
[ { "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z" }, { "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z" } ]

GET /v2/projects/:project_id/jobs/:id

Get details on a single job for a given project.

Example Request

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

Response

Status: 200
{ "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z", "owner": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "job_tag_name": "Job_123", "locales": [ { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "English", "code": "en-GB" } ], "keys": [ { "id": "dbcd1234cdef1234abcd1234cdef1234", "name": "greeting.hello" } ] }

POST /v2/projects/:project_id/jobs

Create a new job.

Parameters

Name Type Description
name string Job name
briefing
optional
string Briefing for the translators
due_date
optional
datetime Date the job should be finished
tags array of strings tags of keys that should be included within the job
translation_key_ids array of strings ids of keys that should be included within the job

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST \
  -d '{"name":"de","briefing":"de-DE","due_date":"2017-08-15","tags":["myUploadTag"],"translation_key_ids":["abcd1234cdef1234abcd1234cdef1234"]}' \
  -H 'Content-Type: application/json'
phraseapp job create <project_id> \
--name de \
--briefing de-DE \
--due-date 2017-08-15 \
--tags "myUploadTag" \
--translation-key-ids "abcd1234cdef1234abcd1234cdef1234"

Response

Status: 201
{ "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z", "owner": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "job_tag_name": "Job_123", "locales": [ { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "English", "code": "en-GB" } ], "keys": [ { "id": "dbcd1234cdef1234abcd1234cdef1234", "name": "greeting.hello" } ] }

PATCH /v2/projects/:project_id/jobs/:id

Update an existing job.

Parameters

Name Type Description
name string Job name
briefing
optional
string Briefing for the translators
due_date
optional
datetime Date the job should be finished

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"name":"de","briefing":"de-DE","due_date":"2017-08-15"}' \
  -H 'Content-Type: application/json'
phraseapp job update <project_id> <id> \
--name de \
--briefing de-DE \
--due-date 2017-08-15

Response

Status: 200
{ "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z", "owner": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "job_tag_name": "Job_123", "locales": [ { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "English", "code": "en-GB" } ], "keys": [ { "id": "dbcd1234cdef1234abcd1234cdef1234", "name": "greeting.hello" } ] }

DELETE /v2/projects/:project_id/jobs/:id

Delete an existing job.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X DELETE
phraseapp job delete <project_id> <id>

Response

Status: 204

POST /v2/projects/:project_id/jobs/:id/start

Starts an existing job in state draft.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs/:id/start" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST
phraseapp job start <project_id> <id>

Response

Status: 200
{ "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z", "owner": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "job_tag_name": "Job_123", "locales": [ { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "English", "code": "en-GB" } ], "keys": [ { "id": "dbcd1234cdef1234abcd1234cdef1234", "name": "greeting.hello" } ] }

POST /v2/projects/:project_id/jobs/:id/complete

Mark a job as completed.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs/:id/complete" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST
phraseapp job complete <project_id> <id>

Response

Status: 200
{ "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z", "owner": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "job_tag_name": "Job_123", "locales": [ { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "English", "code": "en-GB" } ], "keys": [ { "id": "dbcd1234cdef1234abcd1234cdef1234", "name": "greeting.hello" } ] }

POST /v2/projects/:project_id/jobs/:id/keys

Add multiple keys to a existing job.

Parameters

Name Type Description
translation_key_ids array of strings ids of keys that should added to the job

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs/:id/keys" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST \
  -d '{"translation_key_ids":["abcd1234cdef1234abcd1234cdef1234"]}' \
  -H 'Content-Type: application/json'
phraseapp job keys create <project_id> <id> \
--translation-key-ids "abcd1234cdef1234abcd1234cdef1234"

Response

Status: 200
{ "id": "626ea67628690c73ac86ac81eec2d185", "name": "Translations for new Feature", "briefing": "Some instructions for the translators", "due_date": "2017-02-28T09:52:53Z", "state": "completed", "created_at": "2017-01-28T09:52:53Z", "updated_at": "2017-01-28T09:52:53Z", "owner": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "job_tag_name": "Job_123", "locales": [ { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "English", "code": "en-GB" } ], "keys": [ { "id": "dbcd1234cdef1234abcd1234cdef1234", "name": "greeting.hello" } ] }

DELETE /v2/projects/:project_id/jobs/:id/keys

Remove multiple keys from existing job.

Parameters

Name Type Description
translation_key_ids array of strings ids of keys that should added to the job

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/jobs/:id/keys" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X DELETE \
  -d '{"translation_key_ids":["abcd1234cdef1234abcd1234cdef1234"]}' \
  -H 'Content-Type: application/json'
phraseapp job keys delete <project_id> <id> \
--translation-key-ids "abcd1234cdef1234abcd1234cdef1234"

Response

Status: 204