### GET /projects/{project_id}/styleguides Source: https://developers.phrase.com/en/api/strings/style-guides/list-style-guides List all style guides associated with a specific project. ```APIDOC ## GET /projects/{project_id}/styleguides ### Description List all styleguides for the given project. ### Method GET ### Endpoint /projects/{project_id}/styleguides ### Parameters #### Path Parameters - **project_id** (string) - Required - The ID of the project. #### Query Parameters - **page** (integer) - Optional - Page number. - **per_page** (integer) - Optional - Number of results per page. ### Response #### Success Response (200) - **styleguide** (array) - A list of styleguide objects. ``` -------------------------------- ### Styleguide Preview Schema Example Source: https://developers.phrase.com/en/api/strings/orders/create-a-new-order Example of a styleguide preview object, including its ID and title. ```json { id: abcd1234cdef1234abcd1234cdef1234, title: My Style Guide } ``` -------------------------------- ### Create a Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/update-a-style-guide Creates a new style guide for a given project. ```APIDOC ## POST /api/projects/{project_id}/styleguides ### Description Creates a new style guide for a given project. ### Method POST ### Endpoint /api/projects/{project_id}/styleguides ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID #### Query Parameters - **access_token** (string) - Required - Your Phrase App token #### Request Body - **title** (string) - Required - Title of the style guide ### Request Example { "example": "{ "title": "My New Style Guide" }" } ### Response #### Success Response (200) - **id** (string) - Style guide ID - **title** (string) - Style guide title - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update #### Response Example { "example": "{ "id": "abcd1234cdef1234abcd1234cdef1234", "title": "My New Style Guide", "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }" } ``` -------------------------------- ### User Preview Schema Example Source: https://developers.phrase.com/en/api/strings/organization-job-templates/get-a-single-organization-job-template Example JSON structure for the user_preview object. ```JSON id: abcd1234cdef1234abcd1234cdef1234 username: johndoe name: John Doe gravatar_uid: 205e460b479e2e5b48aec07710c08d50 ``` -------------------------------- ### Retrieve a single style guide Source: https://developers.phrase.com/en/api/strings/style-guides/get-a-single-style-guide Use these commands to fetch details for a specific style guide within a project. ```Curl curl "https://api.phrase.com/v2/projects/:project_id/styleguides/:id" \ -u USERNAME_OR_ACCESS_TOKEN ``` ```CLI v2 ``` -------------------------------- ### List Style Guides Source: https://developers.phrase.com/en/api/strings/style-guides/update-a-style-guide Retrieves a list of all style guides for a given project. ```APIDOC ## GET /api/projects/{project_id}/styleguides ### Description Retrieves a list of all style guides for a given project. ### Method GET ### Endpoint /api/projects/{project_id}/styleguides ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID #### Query Parameters - **access_token** (string) - Required - Your Phrase App token ### Response #### Success Response (200) - **id** (string) - Style guide ID - **title** (string) - Style guide title - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update #### Response Example { "example": "[ { "id": "abcd1234cdef1234abcd1234cdef1234", "title": "My Style Guide", "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ]" } ``` -------------------------------- ### Create Translation Order Example Source: https://developers.phrase.com/en/api/strings/orders/create-a-new-order Example of creating a translation order with specified source and target locales, translation type, and message. ```json { "source_locale_id":"abcd1234abcd1234abcd1234abcd1234", "target_locale_ids": "1234abcd1234abcd1234abcd1234abcd,abcd1234abcd1234abcd1234abcd1234", "translation_type":"premium", "tag":"my-awesome-feature", "message": "Please make everything sound really nice :)", "styleguide_id":"1234abcd1234abcd1234abcd1234abcd", "category":"C021" } ``` -------------------------------- ### Tag Schema Example Source: https://developers.phrase.com/en/api/strings/tags/create-a-tag An example demonstrating the structure of a tag object, including its name, key count, and creation/update timestamps. ```json { "name": "my-feature", "keys_count": 8, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ``` -------------------------------- ### List Keys with CLI and Query Parameters Source: https://developers.phrase.com/en/api/strings/usage-examples This command-line interface example demonstrates how to list keys using specific project, sort, order, query, and locale ID parameters. Replace placeholders with your actual values. ```bash phrase keys list \ --project_id \ --sort updated_at \ --order desc \ --query "updated_at:>=2013-02-21T00:00:00Z" \ --locale_id abcd1234abcd1234abcd1234abcd1234 \ --access_token ``` -------------------------------- ### Get Single Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/get-a-single-style-guide Retrieves details for a specific style guide within a project. ```APIDOC ## GET /projects/{project_id}/styleguides/{id} ### Description Get details on a single style guide. ### Method GET ### Endpoint /projects/{project_id}/styleguides/{id} ### Parameters #### Path Parameters - **project_id** (string) - Required - The project ID - **id** (string) - Required - The style guide ID ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **id** (string) - Style guide ID - **name** (string) - Style guide name - **content** (string) - Style guide content - **created_at** (string) - Date of creation - **updated_at** (string) - Date of last update #### Response Example ```json { "id": "string", "name": "string", "content": "string", "created_at": "string", "updated_at": "string" } ``` ``` -------------------------------- ### Create Styleguide with cURL Source: https://developers.phrase.com/en/api/strings/style-guides/create-a-style-guide Use this cURL command to create a new styleguide for your project. Ensure you replace ':project_id' with your actual project ID and provide your authentication token. ```bash curl "https://api.phrase.com/v2/projects/:project_id/styleguides" \ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -d '{"title":"Web application style guide","audience":"customer-facing","target_audience":"teenager","grammatical_person":"first_person_singular","vocabulary_type":"technical","business":"We are a travel site that helps customers find the best hotels and flights.","company_branding":"ACME Inc. should never be translated.","formatting":"Never use capital letters","glossary_terms":"Apartment, cabin, loft","grammar_consistency":","literal_translation":"Neutral","overall_tone":"Tone should be fun and light","samples":"http://www.myexample.com/my/document/path/to/samples.pdf"}' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Create a new project Source: https://developers.phrase.com/en/api/strings/projects/create-a-project Examples for creating a project using either Curl or the Phrase CLI v2. ```Curl curl "https://api.phrase.com/v2/projects" \ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -F name=My%20Android%20Project \ -F main_format=yml \ -F shares_translation_memory=true ``` ```CLI v2 phrase projects create \ --data '{"name": "My Android Project", "main_format":"yml", "shares_translation_memory":true}' \ --access_token ``` -------------------------------- ### GET /projects/:project_id/styleguide Source: https://developers.phrase.com/en/api/strings/style-guides/create-a-style-guide Retrieves the style guide details for a specific project. This endpoint allows you to fetch comprehensive information about the project's style guide, including its public URL, target audience, and specific formatting rules. ```APIDOC ## GET /projects/:project_id/styleguide ### Description Retrieves the style guide details for a specific project. ### Method GET ### Endpoint /projects/:project_id/styleguide ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID #### Header Parameters - **X-PhraseApp-OTP** (string) - Optional - Two-Factor-Authentication token (optional) ### Response #### Success Response (200) - **id** (string) - Style guide ID - **title** (string) - Style guide title - **created_at** (string) - Format: date-time - Timestamp of creation - **updated_at** (string) - Format: date-time - Timestamp of last update - **public_url** (string) - URL to the public style guide - **audience** (string) - Target audience for the style guide - **target_audience** (string) - Specific target audience - **grammatical_person** (string) - Grammatical person to use (e.g., first_person_singular, third_person_singular) - **vocabulary_type** (string) - Type of vocabulary used (e.g., technical, informal) - **business** (string) - Description of the business context - **company_branding** (string) - Specific company branding instructions - **formatting** (string) - Formatting guidelines - **glossary_terms** (string) - List of glossary terms - **grammar_consistency** (string) - Grammar consistency rules - **literal_translation** (string) - Guidelines for literal translation - **overall_tone** (string) - Desired overall tone of the content - **samples** (string) - URL to sample documents #### Response Example ```json { "id": "abcd1234cdef1234abcd1234cdef1234", "title": "My Style Guide", "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "public_url": "https://phrase.com/styleguide/my-project/26f065cf597be340", "audience": "customer-facing", "target_audience": "teenager", "grammatical_person": "first_person_singular", "vocabulary_type": "technical", "business": "We are a travel site that helps customers find the best hotels and flights.", "company_branding": "ACME Inc. should never be translated.", "formatting": "Never use capital letters", "glossary_terms": "Apartment, cabin, loft", "grammar_consistency": "", "literal_translation": "Neutral", "overall_tone": "Tone should be fun and light", "samples": "http://www.myexample.com/my/document/path/to/samples.pdf" } ``` #### Error Responses - **400**: Bad request - **404**: Not Found - **429**: Rate Limiting ``` -------------------------------- ### Get a single Repo Sync (CLI v2) Source: https://developers.phrase.com/en/api/strings/repo-syncs/get-a-single-repo-sync This command retrieves a single Repo Sync setting using the Phrase CLI v2. Ensure you have the CLI installed and configured. ```CLI v2 phrase repo_syncs show \ ``` -------------------------------- ### Create Styleguide with Phrase CLI v2 Source: https://developers.phrase.com/en/api/strings/style-guides/create-a-style-guide This command utilizes the Phrase CLI v2 to create a styleguide. Replace '' and '' with your specific project ID and access token. ```bash phrase styleguides create \ --project_id \ --data '{"title": "Web application style guide", "audience":"customer-facing", "target_audience":"teenager", "grammatical_person":"first_person_singular", "vocabulary_type":"technical", "business": "We are a travel site that helps customers find the best hotels and flights.", "company_branding": "ACME Inc. should never be translated.", "formatting": "Never use capital letters", "glossary_terms": "Apartment, cabin, loft", "grammar_consistency":", "literal_translation":"Neutral", "overall_tone": "Tone should be fun and light", "samples": "http://www.myexample.com/my/document/path/to/samples.pdf"}' \ --access_token ``` -------------------------------- ### Get Organization Job Template Details (CLI) Source: https://developers.phrase.com/en/api/strings/organization-job-templates/update-an-organization-job-template Use this command to retrieve details of a specific organization job template via the Phrase CLI. Ensure you have the CLI installed and configured with your account and token. ```bash phrase organization_job_templates update \ --account_id \ --id \ --access_token ``` -------------------------------- ### List Styleguides using Phrase CLI v2 Source: https://developers.phrase.com/en/api/strings/style-guides/list-style-guides This command-line interface command lists styleguides for a specified project. Ensure you have the Phrase CLI installed and authenticated. Replace `` and `` with your project ID and access token. ```bash phrase styleguides list \ --project_id \ --access_token ``` -------------------------------- ### Get Job Template Locale (Phrase CLI) Source: https://developers.phrase.com/en/api/strings/job-template-locales/get-a-single-job-template-locale This command uses the Phrase CLI to fetch a job template locale. Ensure you have the CLI installed and authenticated. Provide your project ID, job template ID, job template locale ID, and access token. ```bash phrase job_template_locales show \ --project_id \ --job_template_id \ --job_template_locale_id \ --branch my-feature-branch \ --access_token ``` -------------------------------- ### Fetch Projects with API Key Source: https://developers.phrase.com/en/api/studio/authentication Include your API key in the `X-API-Key` header for all API requests. This example shows how to fetch projects. ```bash curl -X GET "https://api.studio.us.phrase.com/v1/projects" \ -H "X-API-Key: YOUR_API_KEY" ``` -------------------------------- ### Delete a Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/delete-a-style-guide Use this endpoint to delete an existing style guide. Requires project ID and style guide ID. ```Curl curl "https://api.phrase.com/v2/projects/:project_id/styleguides/:id" \ -u USERNAME_OR_ACCESS_TOKEN \ -X DELETE ``` ```CLI v2 phrase styleguides delete \ --project_id \ --id \ --access_token ``` -------------------------------- ### Update Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/update-a-style-guide Updates an existing style guide for a given project. This endpoint allows modification of various style guide attributes. ```APIDOC ## PATCH /api/v2/projects/:project_id/styleguides/:id ### Description Updates an existing style guide for a given project. This endpoint allows modification of various style guide attributes. ### Method PATCH ### Endpoint /api/v2/projects/:project_id/styleguides/:id ### Parameters #### Path Parameters - **project_id** (string) - Required - The ID of the project - **id** (string) - Required - The ID of the style guide #### Request Body - **title** (string) - Optional - The title of the style guide - **audience** (string) - Optional - The target audience for the style guide - **target_audience** (string) - Optional - Specific target audience details - **grammatical_person** (string) - Optional - Grammatical person (e.g., first_person_singular) - **vocabulary_type** (string) - Optional - Type of vocabulary (e.g., technical, popular) - **business** (string) - Optional - Description of the business context - **company_branding** (string) - Optional - Company branding guidelines - **formatting** (string) - Optional - Formatting requirements - **glossary_terms** (string) - Optional - List of glossary terms - **grammar_consistency** (string) - Optional - Grammar consistency requirements - **literal_translation** (string) - Optional - Literal translation preference - **overall_tone** (string) - Optional - Overall tone requirements - **samples** (string) - Optional - Links to sample pages or documents ### Request Example ```json { "title": "Web application style guide", "audience": "customer-facing", "target_audience": "teenager", "grammatical_person": "first_person_singular", "vocabulary_type": "technical", "business": "We are a travel site that helps customers find the best hotels and flights.", "company_branding": "ACME Inc. should never be translated.", "formatting": "Never use capital letters", "glossary_terms": "Apartment, cabin, loft", "grammar_consistency": "", "literal_translation": "Neutral", "overall_tone": "Tone should be fun and light", "samples": "http://www.myexample.com/my/document/path/to/samples.pdf" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the updated style guide - **title** (string) - The title of the style guide - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update #### Response Example ```json { "id": "example-style-guide-id", "title": "Web application style guide", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:30:00Z" } ``` ``` -------------------------------- ### Create an Upload Batch Source: https://developers.phrase.com/en/api/strings/upload-batches/create-upload-batch Use these examples to create a new upload batch for a specific project. Ensure the project_id is provided in the path and the required authentication token is included. ```Curl curl "https://api.phrase.com/v2/projects/:project_id/upload_batches" \ -X POST \ -H "Content-Type: application/json" \ -d '{ "branch": "my-feature-branch", "delete_unmentioned_keys": true, "upload_ids": [ "abcd1234cdef1234abcd1234cdef1234", "bcde2345defg2345bcde2345defg2345" ] }' \ -u : ``` ```CLI v2 phrase upload_batches create --project-id :project_id \ --data '{ "branch": "my-feature-branch", "delete_unmentioned_keys": true, "upload_ids": [ "abcd1234cdef1234abcd1234cdef1234", "bcde2345defg2345bcde2345defg2345" ] }' \ --access_token ``` -------------------------------- ### Upload Preview Package via API Source: https://developers.phrase.com/en/guides/build-a-tms-plugin/live-preview Upload a ZIP package containing the HTML entry point and assets to enable live preview for a specific project. ```bash curl --request POST "${TMS_BASE_URL}/api2/v1/projects/${PROJECT_UID}/jobPreviewPackage" \ --header "Authorization: Bearer ${ACCESS_TOKEN}" \ --form "file=@preview-package.zip" ``` -------------------------------- ### Start LQA Assessment Source: https://developers.phrase.com/en/api/tms/latest/language-quality-assessment/start-lqa-assessment Initiates an LQA assessment for a given job part. If an assessment is already started or finished, it will be discarded and started fresh. ```APIDOC ## POST /jobs/:job_id/parts/:part_id/lqa_assessments ### Description Starts an LQA assessment for the specified job part. If the assessment has already been started or finished, it will be discarded and started fresh. ### Method POST ### Endpoint /jobs/:job_id/parts/:part_id/lqa_assessments ### Parameters #### Path Parameters - **job_id** (string) - Required - The ID of the job. - **part_id** (string) - Required - The ID of the job part. ### Request Example (No request body is specified for this endpoint) ### Response #### Success Response (201 Created) - **id** (string) - The ID of the newly created LQA assessment. - **job_id** (string) - The ID of the associated job. - **part_id** (string) - The ID of the associated job part. - **status** (string) - The status of the LQA assessment (e.g., "started"). #### Response Example ```json { "id": "a1b2c3d4e5f67890", "job_id": "12345abcde", "part_id": "67890fghij", "status": "started" } ``` ``` -------------------------------- ### Include Keys in a Phrase Project Source: https://developers.phrase.com/en/api/strings/keys/include-a-locale-on-a-collection-of-keys Use these examples to include keys in a project via the Phrase API or CLI. ```Curl curl "https://api.phrase.com/v2/projects/:project_id/keys/include" \ -u USERNAME_OR_ACCESS_TOKEN \ -X PATCH \ -d '{"branch":"my-feature-branch","q":"mykey* translated:true","target_locale_id":"abcd1234abcd1234abcd1234abcd1234","tags":"landing-page,release-1.2"}' \ -H 'Content-Type: application/json' ``` ```CLI v2 phrase keys include \ --project_id \ --data '{"branch":"my-feature-branch", "q":"'mykey* translated:true'", "target_locale_id":"abcd1234abcd1234abcd1234abcd1234", "tags":"landing-page,release-1.2"}' \ --access_token ``` -------------------------------- ### POST /api2/v1/lqa/assessments/{jobUid} Source: https://developers.phrase.com/en/api/tms/latest/language-quality-assessment/start-lqa-assessment Starts an LQA (Language Quality Assessment) for a given job part. If an assessment has already been started or finished, it will be discarded and started anew. ```APIDOC ## POST /api2/v1/lqa/assessments/{jobUid} ### Description Starts LQA assessment for the given job part. If the assessment has already been started or finished, it's discarded and started fresh. ### Method POST ### Endpoint /api2/v1/lqa/assessments/{jobUid} ### Parameters #### Path Parameters - **jobUid** (string) - Required - The unique identifier of the job. ### Responses #### Success Response (200) - **lqaProfile** (object) - Basic info about LQA assessment, including profile details. - **startedDate** (string) - When assessment started or empty if it was not yet. #### Response Example ```json { "lqaProfile": { "uid": "string", "name": "string", "errorCategories": { "accuracy": {}, "fluency": {}, "terminology": {}, "style": {} }, "penaltyPoints": {}, "passFailThreshold": {}, "isDefault": true, "dateCreated": "2023-10-27T10:00:00Z", "organization": { "uid": "string" } }, "startedDate": "2023-10-27T10:05:00Z" } ``` #### Error Responses - **400**: Bad request - **401**: Not authorized - **403**: Forbidden - **404**: Resource not found - **405**: Method not allowed - **408**: Timeout - **410**: Gone - **415**: Unsupported media type - **429**: Too many requests - **500**: Internal server error - **501**: Not implemented ``` -------------------------------- ### Delete a Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/update-a-style-guide Deletes an existing style guide. ```APIDOC ## DELETE /api/projects/{project_id}/styleguides/{id} ### Description Deletes an existing style guide. ### Method DELETE ### Endpoint /api/projects/{project_id}/styleguides/{id} ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID - **id** (string) - Required - Style guide ID #### Query Parameters - **access_token** (string) - Required - Your Phrase App token ### Response #### Success Response (204) No Content #### Response Example { "example": "" } ``` -------------------------------- ### Import Repository Sync Source: https://developers.phrase.com/en/api/strings/repo-syncs/import-from-code-repository Use these examples to trigger a repository sync import via cURL or the Phrase CLI v2. ```Curl curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/import"\ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -d '{"repository_branch":"my-feature-branch", "branch":"my-strings-branch"}' \ -H 'Content-Type: application/json' ``` ```CLI v2 phrase repo_syncs import \ --id \ --data '{"repository_branch":"my-feature-branch", "branch":"my-strings-branch"}' \ --access_token ``` -------------------------------- ### Update a Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/update-a-style-guide Updates an existing style guide. ```APIDOC ## PUT /api/projects/{project_id}/styleguides/{id} ### Description Updates an existing style guide. ### Method PUT ### Endpoint /api/projects/{project_id}/styleguides/{id} ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID - **id** (string) - Required - Style guide ID #### Query Parameters - **access_token** (string) - Required - Your Phrase App token #### Request Body - **title** (string) - Optional - New title for the style guide - **public_url** (string) - Optional - URL to the public style guide - **audience** (string) - Optional - Target audience for the style guide - **target_audience** (string) - Optional - Specific target audience - **grammatical_person** (string) - Optional - Grammatical person to use - **vocabulary_type** (string) - Optional - Type of vocabulary - **business** (string) - Optional - Business context - **company_branding** (string) - Optional - Company branding guidelines - **formatting** (string) - Optional - Formatting rules - **glossary_terms** (string) - Optional - Glossary terms - **grammar_consistency** (string) - Optional - Grammar consistency rules - **literal_translation** (string) - Optional - Literal translation guidelines - **overall_tone** (string) - Optional - Overall tone of the content - **samples** (string) - Optional - URL to samples document ### Request Example { "example": "{ "title": "Updated Style Guide Title", "audience": "developers" }" } ### Response #### Success Response (200) - **id** (string) - Style guide ID - **title** (string) - Style guide title - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update - **public_url** (string) - URL to the public style guide - **audience** (string) - Target audience for the style guide - **target_audience** (string) - Specific target audience - **grammatical_person** (string) - Grammatical person to use - **vocabulary_type** (string) - Type of vocabulary - **business** (string) - Business context - **company_branding** (string) - Company branding guidelines - **formatting** (string) - Formatting rules - **glossary_terms** (string) - Glossary terms - **grammar_consistency** (string) - Grammar consistency rules - **literal_translation** (string) - Literal translation guidelines - **overall_tone** (string) - Overall tone of the content - **samples** (string) - URL to samples document #### Response Example { "example": "{ "id": "abcd1234cdef1234abcd1234cdef1234", "title": "Updated Style Guide Title", "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "public_url": "https://phrase.com/styleguide/my-project/26f065cf597be340", "audience": "developers", "target_audience": "teenager", "grammatical_person": "first_person_singular", "vocabulary_type": "technical", "business": "We are a travel site that helps customers find the best hotels and flights.", "company_branding": "ACME Inc. should never be translated.", "formatting": "Never use capital letters", "glossary_terms": "Apartment, cabin, loft", "grammar_consistency": "", "literal_translation": "Neutral", "overall_tone": "Tone should be fun and light", "samples": "http://www.myexample.com/my/document/path/to/samples.pdf" }" } ``` -------------------------------- ### Activate Repository Sync (Phrase CLI) Source: https://developers.phrase.com/en/api/strings/repo-syncs/activate-a-repo-sync Activate a repository sync using the Phrase CLI. Ensure you have the CLI installed and authenticated. Replace `` and `` with your specific values. ```bash phrase repo_syncs activate \ --id \ --access_token ``` -------------------------------- ### Start a Job Source: https://developers.phrase.com/en/api/strings/jobs/start-a-job Starts an existing job in the draft state. ```APIDOC ## Start a Job ### Description Starts an existing job in state draft. ### Method POST ### Endpoint `/jobs/:id/start` ``` -------------------------------- ### Create a project screenshot Source: https://developers.phrase.com/en/api/strings/screenshots/create-a-screenshot Use these commands to upload a new screenshot to a specific project. ```Curl curl "https://api.phrase.com/v2/projects/:project_id/screenshots" \ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -F branch=my-feature-branch \ -F name=A%20screenshot%20name \ -F description=A%20screenshot%20description \ -F filename=@/path/to/my/screenshot.png ``` ```CLI v2 phrase screenshots create \ --project_id \ --branch "my-feature-branch" --name "A screenshot name" --description "A screenshot description" --filename "/path/to/my/screenshot.png" \ --access_token ``` -------------------------------- ### Show a Style Guide Source: https://developers.phrase.com/en/api/strings/style-guides/update-a-style-guide Retrieves a single style guide by its ID. ```APIDOC ## GET /api/projects/{project_id}/styleguides/{id} ### Description Retrieves a single style guide by its ID. ### Method GET ### Endpoint /api/projects/{project_id}/styleguides/{id} ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID - **id** (string) - Required - Style guide ID #### Query Parameters - **access_token** (string) - Required - Your Phrase App token ### Response #### Success Response (200) - **id** (string) - Style guide ID - **title** (string) - Style guide title - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update - **public_url** (string) - URL to the public style guide - **audience** (string) - Target audience for the style guide - **target_audience** (string) - Specific target audience - **grammatical_person** (string) - Grammatical person to use (e.g., first_person_singular) - **vocabulary_type** (string) - Type of vocabulary (e.g., technical) - **business** (string) - Business context for the style guide - **company_branding** (string) - Company branding guidelines - **formatting** (string) - Formatting rules - **glossary_terms** (string) - Glossary terms - **grammar_consistency** (string) - Grammar consistency rules - **literal_translation** (string) - Literal translation guidelines - **overall_tone** (string) - Overall tone of the content - **samples** (string) - URL to samples document #### Response Example { "example": "{ "id": "abcd1234cdef1234abcd1234cdef1234", "title": "My Style Guide", "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z", "public_url": "https://phrase.com/styleguide/my-project/26f065cf597be340", "audience": "customer-facing", "target_audience": "teenager", "grammatical_person": "first_person_singular", "vocabulary_type": "technical", "business": "We are a travel site that helps customers find the best hotels and flights.", "company_branding": "ACME Inc. should never be translated.", "formatting": "Never use capital letters", "glossary_terms": "Apartment, cabin, loft", "grammar_consistency": "", "literal_translation": "Neutral", "overall_tone": "Tone should be fun and light", "samples": "http://www.myexample.com/my/document/path/to/samples.pdf" }" } ``` -------------------------------- ### Show Release Details CLI Source: https://developers.phrase.com/en/api/strings/releases/get-a-single-release Use this command to display specific release details. Ensure you provide all required IDs and an access token. ```bash phrase releases show \\ --account_id \\ --distribution_id \\ --id \\ --access_token ``` -------------------------------- ### POST /projects Source: https://developers.phrase.com/en/api/strings/projects/create-a-project Create a new project with specific settings and configurations. ```APIDOC ## POST /projects ### Description Creates a new project in the Phrase platform. Allows configuration of translation memory, workflows, and machine translation settings. ### Method POST ### Endpoint /projects ### Parameters #### Request Body - **shares_translation_memory** (boolean) - Optional - Indicates whether the project should share the account's translation memory - **project_image** (string) - Optional - Image to identify the project - **remove_project_image** (boolean) - Optional - Indicates whether the project image should be deleted - **account_id** (string) - Optional - Account ID to specify the actual account the project should be created in - **point_of_contact** (string) - Optional - User ID of the point of contact for the project - **source_project_id** (string) - Optional - When a source project ID is given, a clone of that project will be created - **workflow** (string) - Optional - Review Workflow. "simple" / "review" - **machine_translation_enabled** (boolean) - Optional - Enable machine translation support in the project - **enable_branching** (boolean) - Optional - Enable branching in the project - **protect_master_branch** (boolean) - Optional - Protect the master branch in project where branching is enabled - **enable_all_data_type_translation_keys_for_translators** (boolean) - Optional - Allow translators to edit translations other than strings - **enable_icu_message_format** (boolean) - Optional - Validate and highlight ICU messages - **zero_plural_form_enabled** (boolean) - Optional - Displays the input fields for the 'ZERO' plural form - **autotranslate_enabled** (boolean) - Optional - Autopilot, requires machine_translation_enabled - **autotranslate_check_new_translation_keys** (boolean) - Optional - Requires autotranslate_enabled to be true - **autotranslate_check_new_uploads** (boolean) - Optional - Requires autotranslate_enabled to be true ### Request Example { "shares_translation_memory": true, "workflow": "review", "machine_translation_enabled": true } ``` -------------------------------- ### Notification schema example Source: https://developers.phrase.com/en/api/strings/notification-groups/mark-a-notification-group-as-read Example JSON structure for a notification object. ```json { "id": "abcd1234", "event_name": "keys:create", "data": "object notification data", "resource": "object of notification resource", "locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "de", "code": "de-DE", "default": true, "main": false, "rtl": false, "plural_forms": [ "zero", "one", "other" ], "source_locale": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "en", "code": "en-GB" }, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }, "user": { "id": "abcd1234cdef1234abcd1234cdef1234", "username": "joe.doe", "name": "Joe Doe" }, "project": { "id": "abcd1234cdef1234abcd1234cdef1234", "name": "My Android Project", "main_format": "xml", "project_image_url": "http://assets.example.com/project.png", "account": { "id": "abcd1234" } } } ``` -------------------------------- ### List Repository Syncs with CLI v2 Source: https://developers.phrase.com/en/api/strings/repo-syncs/get-repo-syncs Use this command to list repository syncs for a given account. Ensure you provide your account ID and access token. ```bash phrase repo_syncs list \ --account_id abcd1234 \ --access_token ``` -------------------------------- ### UID Example Source: https://developers.phrase.com/en/api/language-ai/file-translations/file-processing-metadata Example value for the unique identifier of a translation operation. ```JSON "random-uid" ``` -------------------------------- ### List Styleguides using cURL Source: https://developers.phrase.com/en/api/strings/style-guides/list-style-guides Use this cURL command to retrieve a list of all styleguides in your project. Replace `:project_id` with your actual project ID and `USERNAME_OR_ACCESS_TOKEN` with your credentials. ```curl curl "https://api.phrase.com/v2/projects/:project_id/styleguides" \ -u USERNAME_OR_ACCESS_TOKEN ``` -------------------------------- ### List Documents (CLI) Source: https://developers.phrase.com/en/api/strings/documents/list-documents Use the Phrase CLI to list documents in your project. Ensure you replace and with your actual project ID and access token. ```bash phrase documents list \ --project_id \ --access_token ``` -------------------------------- ### Get a Single Job Source: https://developers.phrase.com/en/api/strings/jobs/get-a-single-job Get details on a single job for a given project. ```APIDOC ## GET /jobs/:id ### Description Get details on a single job for a given project. ### Method GET ### Endpoint `/jobs/:id` ### Parameters #### Path Parameters - **id** (string) - Required - The id of the job ``` -------------------------------- ### Organization Job Template Schema Example Source: https://developers.phrase.com/en/api/strings/organization-job-templates/get-a-single-organization-job-template Example JSON structure for the organization_job_template object. ```JSON id: 626ea67628690c73ac86ac81eec2d185 name: template briefing: text created_at: '2017-01-28T09:52:53Z' updated_at: '2017-01-28T09:52:53Z' ``` -------------------------------- ### Create a Job Template Source: https://developers.phrase.com/en/api/strings/job-templates/create-a-job-template Examples for creating a new job template using either Curl or the Phrase CLI v2. ```Curl curl "https://api.phrase.com/v2/projects/:project_id/job_templates" -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -d '{"branch":"my-feature-branch","name":"template","briefing":"text"}' \ -H 'Content-Type: application/json' ``` ```CLI v2 phrase job_templates create \ --project_id \ --data '{"branch":"my-feature-branch", "name":"template", "briefing":"text"}' \ --access_token ``` -------------------------------- ### Error Response Example Source: https://developers.phrase.com/en/api/tms/latest/job/get-web-editor-url Example JSON structure for a 400 Bad Request error response. ```json { "errorCode": "NOT_UNIQUE_TARGET_LANG", "errorDescription": "Only files with identical target languages can be joined", "errorDetails": [ { "code": "NOT_UNIQUE_TARGET_LANG", "args": { "targetLocales": [ "de", "en" ] }, "message": "Only files with identical target languages can be joined" }, { "code": "TOO_MANY_SEGMENTS", "args": { "maxSegments": 40000, "segments": 400009 }, "message": "Up to 40000 segments can be opened in the CAT Web Editor, job has 400009 segments" } ] } ``` -------------------------------- ### Organization Job Template Details Schema Example Source: https://developers.phrase.com/en/api/strings/organization-job-templates/get-a-single-organization-job-template Example JSON structure for the organization_job_template_details object. ```JSON owner: id: abcd1234cdef1234abcd1234cdef1234 username: joe.doe name: Joe Doe creator: id: abcd1234cdef1234abcd1234cdef1234 username: joe.doe name: Joe Doe locales: - id: abcd1234cdef1234abcd1234cdef1234 name: English code: en-GB ``` -------------------------------- ### Create a Webhook using Phrase CLI Source: https://developers.phrase.com/en/api/strings/webhooks/create-a-webhook This command demonstrates how to create a webhook using the Phrase CLI. Replace '' and '' with your specific project ID and access token. ```bash phrase webhooks create \ --project_id \ --data '{"callback_url": "http://example.com/hooks/phraseapp-notifications", "description": "My webhook for chat notifications", "events": "locales:create,translations:update"}' \ --access_token ``` -------------------------------- ### POST /projects/{project_id}/styleguides Source: https://developers.phrase.com/en/api/strings/style-guides/create-a-style-guide Create a new style guide for a specific project. ```APIDOC ## POST /projects/{project_id}/styleguides ### Description Create a new style guide. ### Method POST ### Endpoint /projects/{project_id}/styleguides ### Parameters #### Path Parameters - **project_id** (string) - Required - The ID of the project. #### Request Body - **title** (string) - Required - Style guide title - **audience** (string) - Optional - Audience description - **target_audience** (string) - Optional - Can be one of: not_specified, children, teenager, young_adults, adults, old_adults. - **grammatical_person** (string) - Optional - Can be one of: not_specified, first_person_singular ### Request Example { "title": "Web application style guide", "audience": "customer-facing", "target_audience": "teenager" } ``` -------------------------------- ### Direct File Upload Request Example Source: https://developers.phrase.com/en/api/studio/projects/create-project Demonstrates a full request payload for creating a project using direct file upload. ```json { "sourceLanguage": "en", "subtitleProfiles": [ { "subtitleProfileId": "00000000-0000-0000-0000-000000000001" } ] } ```