v1

latestOpenAPI 3.0.0Proprietary2026-07-26316155742.7 KB
Repo Syncs

Create a Repo Sync

Create a new Repo Sync.

post/accounts/{account_id}/repo_syncs

Path parameters

account_idstring required

Account ID

Headers

X-PhraseApp-OTPstring

Two-Factor-Authentication token (optional)

Request body

project_idstring required

ID of the project to connect the Repo Sync to.

namestring nullable

Optional custom display name for this repo sync. Defaults to null; when null the project name is used as the display name.

git_provider'github' | 'gitlab' | 'bitbucket'

The Git provider to use.

connection_type'token' | 'github_app' | 'self_hosted' required

The authentication method used to connect to the Git provider. Defaults to token if not specified.

Valid values:

  • token — Personal access token stored on the Repo Sync. Supported by all providers.
  • github_app — Authenticate via the Phrase GitHub App installation on your account. GitHub only. The account must already have the GitHub App installed; if not, the response will include a github_app_installation_url.
  • self_hosted — Token-based auth for self-hosted Git instances. Requires custom_api_endpoint.
repo_namestring required

Full repository name including the owner, e.g. my-org/my-repo.

base_branchstring

The default branch to use for imports and exports.

pr_branchstring

Branch that translations are exported to before opening a pull request. If omitted, exports go directly to base_branch.

auto_importboolean

Enable automatic import of translations triggered by pushes to the repository.

access_tokenstring

Personal access token for the Git provider. Required when connection_type is token or self_hosted. Not used for github_app.

custom_api_endpointstring

Custom API endpoint URL for self-hosted Git instances. Required when connection_type is self_hosted.

Example request

{
  "project_id": "abcd1234abcd1234abcd1234abcd1234",
  "git_provider": "github",
  "connection_type": "github_app",
  "repo_name": "my-org/my-repo",
  "base_branch": "main",
  "pr_branch": "phrase-translations",
  "access_token": "ghp_xxxxxxxxxxxxxxxxxxxx",
  "custom_api_endpoint": "https://git.example.com/api/v4"
}

Response

Created

idstring
namestring nullable

Optional custom display name for this repo sync. When null or blank, the sync is displayed using the associated project name.

providerstring
enabledboolean
auto_importboolean
repo_namestring
pr_branchstring nullable

Branch used as the source of exports/PRs. May be null when the sync is configured to push directly to base_branch.

created_atstring date-time
last_import_atstring date-time nullable
last_export_atstring date-time nullable

Example response

{
  "id": "abcd1234cdef1234abcd1234cdef1234",
  "project": {
    "id": "abcd1234cdef1234abcd1234cdef1234",
    "name": "My Android Project",
    "main_format": "xml",
    "created_at": "2015-01-28T09:52:53Z",
    "updated_at": "2015-01-28T09:52:53Z"
  },
  "provider": "github",
  "enabled": true,
  "auto_import": true,
  "repo_name": "organization/repo",
  "created_at": "2015-01-28T09:52:53Z",
  "last_import_at": "2015-01-28T09:52:53Z",
  "last_export_at": "2015-01-28T09:52:53Z"
}