openapi: 3.0.3
info:
title: Phrase Strings API Reference Accounts Authorizations 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: Authorizations
description: "The endpoints provided by the Authorizations API are **only accessible via Basic authentication with email and password**.\n\nWhen creating a new authorization, the new access token for this authorization will be returned in the immediate response but not later, due to security reasons. When accessing authorizations later, you will only see the last eight chars of the token in plain text (`token_last_eight`) and the SHA256 digest of the token for reference (`hashed_token`).\n\nFor instructions on how authorization in general works, see our [Auth Guide](#overview--authentication).\n\n### Scopes\n\nWhen creating or updating an OAuth authorization, you can define a list of scopes to limit the access that can be performed by that authorization.\n\n#### Available Scopes\n\n
\n
\n \n \n | Scope | \n Description | \n
\n \n \n \n read | \n Read projects, locales, keys, translations, orders | \n
\n \n write | \n Write projects, locales, keys, translations but not orders | \n
\n \n orders.create | \n Create and confirm orders | \n
\n \n team.manage | \n Manage invitations and members | \n
\n \n
\n
\n"
paths:
/authorizations:
get:
summary: List authorizations
description: List all your authorizations.
operationId: authorizations/list
tags:
- Authorizations
parameters:
- $ref: '#/components/parameters/X-PhraseApp-OTP'
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/authorization'
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'
'404':
$ref: '#/components/responses/404'
'429':
$ref: '#/components/responses/429'
x-code-samples:
- lang: Curl
source: "curl \"https://api.phrase.com/v2/authorizations\" \\\n -u USERNAME"
- lang: CLI v2
source: phrase authorizations list
x-cli-version: '2.5'
post:
summary: Create an authorization
description: Create a new authorization.
operationId: authorization/create
tags:
- Authorizations
parameters:
- $ref: '#/components/parameters/X-PhraseApp-OTP'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/authorization_with_token'
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/authorizations\" \\\n -u USERNAME \\\n -X POST \\\n -d '{\"note\":\"My Deploy Script\",\"scopes\":[\"read\",\"write\"],\"expires_at\":\"2015-03-30T09:52:53Z\"}' \\\n -H 'Content-Type: application/json'"
- lang: CLI v2
source: 'phrase authorizations create \
--data ''{"note": "My Deploy Script", "scopes": "read,write", "expires_at": "2015-03-30T09:52:53Z"}'''
requestBody:
required: true
content:
application/json:
schema:
type: object
title: authorization/create/parameters
required:
- note
properties:
note:
description: A note to help you remember what the access is used for.
type: string
example: My Deploy Script
scopes:
description: A list of scopes that the access can be used for.
type: array
items:
type: string
example:
- read
- write
expires_at:
description: Expiration date for the authorization token. Null means no expiration date (default).
type: string
format: date-time
example: '2015-03-30T09:52:53Z'
x-cli-version: '2.5'
/authorizations/{id}:
get:
summary: Get a single authorization
description: Get details on a single authorization.
operationId: authorization/show
tags:
- Authorizations
parameters:
- $ref: '#/components/parameters/X-PhraseApp-OTP'
- $ref: '#/components/parameters/id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/authorization'
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/authorizations/:id\" \\\n -u USERNAME"
- lang: CLI v2
source: 'phrase authorizations show \
--id '
x-cli-version: '2.5'
patch:
summary: Update an authorization
description: Update an existing authorization.
operationId: authorization/update
tags:
- Authorizations
parameters:
- $ref: '#/components/parameters/X-PhraseApp-OTP'
- $ref: '#/components/parameters/id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/authorization'
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/authorizations/:id\" \\\n -u USERNAME \\\n -X PATCH \\\n -d '{\"note\":\"My Deploy Script\",\"scopes\":[\"read\",\"write\"],\"expires_at\":\"2015-03-30T09:52:53Z\"}' \\\n -H 'Content-Type: application/json'"
- lang: CLI v2
source: 'phrase authorizations update \
--id \
--data ''{"note": "My Deploy Script", "scopes": "read,write", "expires_at": "2015-03-30T09:52:53Z"}'''
requestBody:
required: true
content:
application/json:
schema:
type: object
title: authorization/update/parameters
properties:
note:
description: A note to help you remember what the access is used for.
type: string
example: My Deploy Script
scopes:
description: A list of scopes that the access can be used for.
type: array
items:
type: string
example:
- read
- write
expires_at:
description: Expiration date for the authorization token. Null means no expiration date (default).
type: string
format: date-time
example: '2015-03-30T09:52:53Z'
x-cli-version: '2.5'
delete:
summary: Delete an authorization
description: Delete an existing authorization. API calls using that token will stop working.
operationId: authorization/delete
tags:
- Authorizations
parameters:
- $ref: '#/components/parameters/X-PhraseApp-OTP'
- $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/authorizations/:id\" \\\n -u USERNAME \\\n -X DELETE"
- lang: CLI v2
source: 'phrase authorizations delete \
--id '
x-cli-version: '2.5'
components:
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'
'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'
'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'
'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'
headers:
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
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
parameters:
id:
in: path
name: id
description: ID
required: true
schema:
type: string
X-PhraseApp-OTP:
in: header
name: X-PhraseApp-OTP
description: Two-Factor-Authentication token (optional)
required: false
allowEmptyValue: false
schema:
type: string
page:
in: query
name: page
description: Page number
required: false
allowEmptyValue: false
schema:
type: integer
example: 1
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
schemas:
authorization:
type: object
title: authorization
properties:
id:
type: string
note:
type: string
token_last_eight:
type: string
hashed_token:
type: string
scopes:
type: array
items:
type: string
expires_at:
type: string
format: date-time
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
example:
id: abcd1234cdef1234abcd1234cdef1234
note: My Deploy Script
token_last_eight: 1234abcd
hashed_token: abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234
scopes:
- read
expires_at: '2015-03-30T09:52:53Z'
created_at: '2015-01-28T09:52:53Z'
updated_at: '2015-01-28T09:52:53Z'
authorization_with_token:
allOf:
- $ref: '#/components/schemas/authorization'
- type: object
title: authorization_with_token
properties:
token:
type: string
example:
token: abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234abcd1234cdef1234
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