Phrase Automations API

The Automations API from Phrase — 5 operation(s) for automations.

OpenAPI Specification

phrase-automations-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Phrase Strings API Reference Accounts Automations API
  version: 2.0.0
  description: Phrase Strings is a translation management platform for software projects. You can collaborate on language file translation with your team or order translations through our platform. The API allows you to import locale files, download locale files, tag keys or interact in other ways with the localization data stored in Phrase Strings for your account.
  contact:
    name: Phrase Support
    url: https://developers.phrase.com/api/
    email: support@phrase.com
  x-logo:
    url: https://developers.phrase.com/images/phrase-logo.svg
    backgroundColor: '#03eab3'
    altText: Phrase Strings
  termsOfService: https://phrase.com/terms/
  license:
    name: MIT
    url: https://choosealicense.com/licenses/mit/
servers:
- url: https://api.phrase.com/v2
  description: EU production server
- url: https://api.us.app.phrase.com/v2
  description: US production server
security:
- Token: []
- Basic: []
tags:
- name: Automations
paths:
  /accounts/{account_id}/automations:
    get:
      summary: List automations
      description: 'List all automations for an account.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automations/list
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per_page'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/automation'
          headers:
            X-Rate-Limit-Limit:
              $ref: '#/components/headers/X-Rate-Limit-Limit'
            X-Rate-Limit-Remaining:
              $ref: '#/components/headers/X-Rate-Limit-Remaining'
            X-Rate-Limit-Reset:
              $ref: '#/components/headers/X-Rate-Limit-Reset'
            Link:
              $ref: '#/components/headers/Link'
            Pagination:
              $ref: '#/components/headers/Pagination'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations?page=1&per_page=10\" \\\n  -u USERNAME_OR_ACCESS_TOKEN"
      - lang: CLI v2
        source: 'phrase automations list \

          --account_id <account_id> \

          --page 1 \

          --per_page 10 \

          --access_token <token>'
    post:
      summary: Create an automation
      description: 'Create a new automation.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automation/create
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
              - name
              - project_ids
              - status_filters
              - trigger
              type: object
              title: automations/create/parameters
              properties:
                name:
                  description: name of the automation
                  example: Scheduled Job Automation - Hourly
                  type: string
                trigger:
                  type: string
                  enum:
                  - schedule
                  - upload
                project_ids:
                  description: 'List of project IDs to associate with the automation.

                    Currently, only the first ID in the array is used.

                    The array format leaves room for future support of multiple projects.

                    '
                  type: array
                  items:
                    type: string
                  example:
                  - abcd1234cdef1234abcd1234cdef1234
                job_template_id:
                  description: id of job template that the automation uses to create jobs from
                  type: string
                  example: abcd1234cdef1234abcd1234cdef1234
                status_filters:
                  description: "Translation states used when selecting keys for a job. \nStates are derived from associated translations, not the keys themselves. \nWhen review workflow is enabled, `ready_for_review` is internally treated as `translated`.\n"
                  type: array
                  items:
                    type: string
                    enum:
                    - unverified
                    - untranslated
                    - ready_for_review
                tags:
                  description: used to filter which keys are added to jobs
                  type: array
                  items:
                    type: string
                  example:
                  - myTag
                cron_schedule:
                  description: along with time_zone, specifies when the scheduled automation is supposed to run
                  type: string
                  example: 00 13 * * 1,2
                time_zone:
                  description: along with cron_schedule, specifies when the scheduled automation is supposed to run
                  type: string
                  example: GMT
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/automation'
          headers:
            X-Rate-Limit-Limit:
              $ref: '#/components/headers/X-Rate-Limit-Limit'
            X-Rate-Limit-Remaining:
              $ref: '#/components/headers/X-Rate-Limit-Remaining'
            X-Rate-Limit-Reset:
              $ref: '#/components/headers/X-Rate-Limit-Reset'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations\" \\\n  -u USERNAME_OR_ACCESS_TOKEN \\\n  -X POST \\\n  -d '{\"name\":\"Schedule Automation - Hourly\",\"trigger\":\"schedule\",\"project_ids\":[\"1\"],\"job_template_id\":\"2\",\"status_filters\":[\"untranslated\"],\"tag_ids\":[\"3\",\"4\"],\"cron_schedule\":\"00 13 * * 1,2\",\"time_zone\":\"GMT\"}' \\\n  -H 'Content-Type: application/json'"
      - lang: CLI v2
        source: 'phrase automations create \

          --account_id <account_id> \

          --data ''{"name":"Schedule Automation - Hourly","trigger":"schedule","project_ids":["1"],"job_template_id":"2","status_filters":["untranslated"],"tag_ids":["3","4"],"cron_schedule":"00 13 * * 1,2","time_zone":"GMT"}'' \

          --access_token <token>'
  /accounts/{account_id}/automations/{automation_id}:
    get:
      summary: Get a single automation
      description: 'Get details of a single automation.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automation/show
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/automation'
          headers:
            X-Rate-Limit-Limit:
              $ref: '#/components/headers/X-Rate-Limit-Limit'
            X-Rate-Limit-Remaining:
              $ref: '#/components/headers/X-Rate-Limit-Remaining'
            X-Rate-Limit-Reset:
              $ref: '#/components/headers/X-Rate-Limit-Reset'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id\" \\\n  -u USERNAME_OR_ACCESS_TOKEN"
      - lang: CLI v2
        source: 'phrase automations show \

          --account_id <account_id> \

          --id <id> \

          --access_token <token>'
    patch:
      summary: Update an automation
      description: 'Update an existing automation.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automation/update
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
              - name
              - project_ids
              - status_filters
              - trigger
              type: object
              title: automations/create/parameters
              properties:
                name:
                  description: name of the automation
                  example: Scheduled Job Automation - Hourly
                  type: string
                trigger:
                  type: string
                  enum:
                  - schedule
                  - upload
                project_ids:
                  description: 'List of project IDs to associate with the automation.

                    Currently, only the first ID in the array is used.

                    The array format leaves room for future support of multiple projects.

                    '
                  type: array
                  items:
                    type: string
                  example:
                  - abcd1234cdef1234abcd1234cdef1234
                job_template_id:
                  description: id of job template that the automation uses to create jobs from
                  type: string
                  example: abcd1234cdef1234abcd1234cdef1234
                status_filters:
                  description: translation key statuses used to filter keys that are added to jobs
                  type: array
                  items:
                    type: string
                    enum:
                    - unverified
                    - untranslated
                    - ready_for_review
                tags:
                  description: used to filter which keys are added to jobs
                  type: array
                  items:
                    type: string
                  example:
                  - myTag
                cron_schedule:
                  description: along with time_zone, specifies when the scheduled automation is supposed to run
                  type: string
                  example: 00 13 * * 1,2
                time_zone:
                  description: along with cron_schedule, specifies when the scheduled automation is supposed to run
                  type: string
                  example: GMT
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/automation'
          headers:
            X-Rate-Limit-Limit:
              $ref: '#/components/headers/X-Rate-Limit-Limit'
            X-Rate-Limit-Remaining:
              $ref: '#/components/headers/X-Rate-Limit-Remaining'
            X-Rate-Limit-Reset:
              $ref: '#/components/headers/X-Rate-Limit-Reset'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id\" \\\n  -u USERNAME_OR_ACCESS_TOKEN \\\n  -X PATCH \\\n  -d '{\"name\":\"Schedule Automation - Weekly\",\"tag_ids\":[\"5\",\"6\"],time_zone:\"UTC\"}' \\\n  -H 'Content-Type: application/json'"
      - lang: CLI v2
        source: 'phrase automations update \

          --account_id <account_id> \

          --id <id> \

          --data ''{"name":"Schedule Automation - Weekly","tag_ids":["5","6"],time_zone:"UTC"}'' \

          --access_token <token>'
    delete:
      summary: Destroy automation
      description: 'Destroy an automation of an account.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automation/delete
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/id'
      responses:
        '204':
          $ref: '#/components/responses/204'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id\" \\\n  -u USERNAME_OR_ACCESS_TOKEN\n  -X DELETE\n  -H 'Content-Type: application/json'"
      - lang: CLI v2
        source: 'phrase automations delete \

          --account_id <account_id> \

          --id <id> \

          --access_token <token>'
  /accounts/{account_id}/automations/{automation_id}/activate:
    post:
      summary: Activate an automation
      description: 'Activate an automation.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automation/activate
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/automation'
          headers:
            X-Rate-Limit-Limit:
              $ref: '#/components/headers/X-Rate-Limit-Limit'
            X-Rate-Limit-Remaining:
              $ref: '#/components/headers/X-Rate-Limit-Remaining'
            X-Rate-Limit-Reset:
              $ref: '#/components/headers/X-Rate-Limit-Reset'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id/activate\" \\\n  -u USERNAME_OR_ACCESS_TOKEN\n  -X POST\n  -H 'Content-Type: application/json'"
      - lang: CLI v2
        source: 'phrase automations activate \

          --account_id <account_id> \

          --id <id> \

          --access_token <token>'
  /accounts/{account_id}/automations/{automation_id}/deactivate:
    post:
      summary: Deactivate an automation
      description: 'Deactivate an automation.


        For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

        '
      operationId: automation/deactivate
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/automation'
          headers:
            X-Rate-Limit-Limit:
              $ref: '#/components/headers/X-Rate-Limit-Limit'
            X-Rate-Limit-Remaining:
              $ref: '#/components/headers/X-Rate-Limit-Remaining'
            X-Rate-Limit-Reset:
              $ref: '#/components/headers/X-Rate-Limit-Reset'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id/deactivate\" \\\n  -u USERNAME_OR_ACCESS_TOKEN\n  -X POST\n  -H 'Content-Type: application/json'"
      - lang: CLI v2
        source: 'phrase automations deactivate \

          --account_id <account_id> \

          --id <id> \

          --access_token <token>'
  /accounts/{account_id}/automations/{automation_id}/trigger:
    post:
      summary: Trigger an automation
      description: 'Trigger an automation.

        '
      operationId: automation/trigger
      tags:
      - Automations
      parameters:
      - $ref: '#/components/parameters/X-PhraseApp-OTP'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/id'
      responses:
        '204':
          $ref: '#/components/responses/204'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
      x-code-samples:
      - lang: Curl
        source: "curl \"https://api.phrase.com/v2/accounts/:account_id/automations/:id/trigger\" \\\n  -u USERNAME_OR_ACCESS_TOKEN\n  -X POST\n  -H 'Content-Type: application/json'"
      - lang: CLI v2
        source: 'phrase automations trigger \

          --account_id <account_id> \

          --id <id> \

          --access_token <token>'
components:
  schemas:
    account:
      type: object
      title: account
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        company:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        company_logo_url:
          type: string
      example:
        id: abcd1234
        name: Company Account
        slug: company_account
        company: My Awesome Company
        created_at: '2015-01-28T09:52:53Z'
        updated_at: '2015-01-28T09:52:53Z'
        company_logo_url: http://assets.example.com/company_logo.png
    automation:
      type: object
      title: automation
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
          - inactive
          - active
          - error
        trigger:
          type: string
          enum:
          - schedule
          - upload
        status_filters:
          description: translation key statuses used to filter keys that are added to jobs
          type: array
          items:
            type: string
            enum:
            - unverified
            - untranslated
            - ready_for_review
        project_id:
          type: string
        job_template_id:
          type: string
        tags:
          type: array
          items:
            type: string
        cron_schedule:
          type: string
        time_zone:
          type: string
        account:
          $ref: '#/components/schemas/account'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        id: abcd1234cdef1234abcd1234cdef1234
        name: My First Automation
        status: active
        trigger: schedule
        status_filters:
        - unverified
        - untranslated
        - ready_for_review
        project_id: abcd1234cdef1234abcd1234cdef1234
        job_template_id: abcd1234cdef1234abcd1234cdef1234
        tags:
        - tag-1
        - tag-2
        cron_schedule: 00 13 * * 1,2
        time_zone: GMT
        account: account
        created_at: '2021-06-28T09:52:53Z'
        updated_at: '2021-06-28T09:52:53Z'
    errors:
      type: object
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              resource:
                type: string
              field:
                type: string
              message:
                type: string
      example:
        message: Validation Failed
        errors:
        - resource: Resource
          field: name
          message: can't be blank
  headers:
    Pagination:
      description: Pagination details for navigating through a collection of resources, provided in JSON format.
      schema:
        type: object
        properties:
          total_count:
            description: Total count of items in the collection.
            type: integer
            example: 10
          total_pages_count:
            description: Total number of pages available for the collection.
            type: integer
            example: 2
          current_page:
            description: The current page number.
            type: integer
            example: 1
          current_per_page:
            description: Number of items currently displayed per page.
            type: integer
            example: 5
          previous_page:
            description: Page number of the previous page, if available.
            type: integer
          next_page:
            description: Page number of the next page, if available.
            type: integer
            example: 2
    X-Rate-Limit-Reset:
      description: Timestamp of end of current time period as UNIX timestamp, see [Rate Limiting](/en/api/strings/pagination#rate-limiting)
      schema:
        type: integer
    X-Rate-Limit-Remaining:
      description: The number of remaining requests in the current period
      schema:
        type: integer
    X-Rate-Limit-Limit:
      description: The number of allowed requests in the current period
      schema:
        type: integer
    Link:
      description: 'Links to related resources, in the format defined by

        [RFC 5988](https://tools.ietf.org/html/rfc5988#section-5).

        This will include a link with relation type `next` to the

        next page, if there is a next page.'
      schema:
        type: string
  responses:
    '429':
      description: Rate Limiting
      headers:
        X-Rate-Limit-Limit:
          $ref: '#/components/headers/X-Rate-Limit-Limit'
        X-Rate-Limit-Remaining:
          $ref: '#/components/headers/X-Rate-Limit-Remaining'
        X-Rate-Limit-Reset:
          $ref: '#/components/headers/X-Rate-Limit-Reset'
    '422':
      description: Unprocessable entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errors'
      headers:
        X-Rate-Limit-Limit:
          $ref: '#/components/headers/X-Rate-Limit-Limit'
        X-Rate-Limit-Remaining:
          $ref: '#/components/headers/X-Rate-Limit-Remaining'
        X-Rate-Limit-Reset:
          $ref: '#/components/headers/X-Rate-Limit-Reset'
    '400':
      description: Bad request
      headers:
        X-Rate-Limit-Limit:
          $ref: '#/components/headers/X-Rate-Limit-Limit'
        X-Rate-Limit-Remaining:
          $ref: '#/components/headers/X-Rate-Limit-Remaining'
        X-Rate-Limit-Reset:
          $ref: '#/components/headers/X-Rate-Limit-Reset'
    '204':
      description: The resource was deleted successfully.
      headers:
        X-Rate-Limit-Limit:
          $ref: '#/components/headers/X-Rate-Limit-Limit'
        X-Rate-Limit-Remaining:
          $ref: '#/components/headers/X-Rate-Limit-Remaining'
        X-Rate-Limit-Reset:
          $ref: '#/components/headers/X-Rate-Limit-Reset'
    '403':
      description: Forbidden
      headers:
        X-Rate-Limit-Limit:
          $ref: '#/components/headers/X-Rate-Limit-Limit'
        X-Rate-Limit-Remaining:
          $ref: '#/components/headers/X-Rate-Limit-Remaining'
        X-Rate-Limit-Reset:
          $ref: '#/components/headers/X-Rate-Limit-Reset'
    '404':
      description: Not Found
      headers:
        X-Rate-Limit-Limit:
          $ref: '#/components/headers/X-Rate-Limit-Limit'
        X-Rate-Limit-Remaining:
          $ref: '#/components/headers/X-Rate-Limit-Remaining'
        X-Rate-Limit-Reset:
          $ref: '#/components/headers/X-Rate-Limit-Reset'
  parameters:
    X-PhraseApp-OTP:
      in: header
      name: X-PhraseApp-OTP
      description: Two-Factor-Authentication token (optional)
      required: false
      allowEmptyValue: false
      schema:
        type: string
    per_page:
      in: query
      name: per_page
      description: Limit on the number of objects to be returned, between 1 and 100. 25 by default
      required: false
      allowEmptyValue: false
      schema:
        type: integer
      example: 25
    id:
      in: path
      name: id
      description: ID
      required: true
      schema:
        type: string
    account_id:
      in: path
      name: account_id
      description: Account ID
      required: true
      schema:
        type: string
    page:
      in: query
      name: page
      description: Page number
      required: false
      allowEmptyValue: false
      schema:
        type: integer
      example: 1
  securitySchemes:
    Token:
      type: apiKey
      in: header
      name: Authorization
      description: Enter your token in the format `token TOKEN`
    Basic:
      type: http
      scheme: basic
x-tagGroups:
- name: Core Resources
  tags:
  - Projects
  - Locales
  - Keys
  - Translations
  - Uploads
  - Tags
  - Custom Metadata Properties
  - Blacklisted Keys
  - Versions / History
- name: Workflows
  tags:
  - Spaces
  - Jobs
  - Job Comments
  - Job Locales
  - Job Templates
  - Job Template Locales
  - Organization Job Templates
  - Organization Job Template Locales
  - Comments
  - Comment Reactions
  - Comment Replies
  - Branches
- name: Quality
  tags:
  - Glossaries
  - Glossary Terms
  - Glossary Term Translations
- name: Integrations
  tags:
  - Webhooks
  - Distributions
  - Releases
  - Release Triggers
- name: Ordering
  tags:
  - Orders
  - Style guides
- name: User management
  tags:
  - Authorizations
  - Users
  - Accounts
  - Members
  - Invitations
- name: Screenshots
  tags:
  - Screenshots
  - Screenshot Markers
- name: Misc
  tags:
  - Formats
- name: Figma Attachments
  tags:
  - Figma attachments
  - Key's Figma attachments