PTC

PTC API Reference

The PTC API uses REST and allows you to integrate software localization into your development process. The API endpoints let you add and update source files, retrieve information, manage translations, and more.

The PTC API can be used in live mode only. It supports standard HTTP methods and returns JSON-formatted responses. Authentication is token-based and project-specific.

Code Snippets

curl -X GET "https://app.ptc.wpml.org/api/v1/source_files/supported_extensions" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

The documentation uses cURL to show how to make HTTP requests to the PTC API, but you can switch tabs to see the same request in other languages.

Authentication

Creating API tokens is a Pro feature. It becomes available when you activate Pay-As-You-Go.

To get started:

  • 1

    Log into your PTC account. If you don’t have one yet, start a free trial and upload your first file manually.

  • 2

    To move an existing project to API integration, go to Settings → Manage API Tokens and add an access token. For subsequent projects, you can select API integration in the setup wizard.

All requests to the PTC API require authentication using a token that gives you access to a single project in PTC.

Include the token in the Authorization header of every request using the Bearer format:

Bearer <AUTHENTICATION_TOKEN>

Response Codes

The PTC API uses standard HTTP response codes to indicate the success or failure of a request.

Authentication Status Codes

200
OK

The request worked as expected.

401
Unauthorized

No valid API token was provided. Check if your token is correct, hasn’t expired, and is included in the Authorization header.

Rate Limiting

The PTC API implements rate limiting to ensure fair usage and maintain service quality. Limits are applied per organization and tracked across specific API operations.

Limit Type Requests Time Frame Scope
File Operations 10 1 minute Per Organization

Affected Endpoints

When Rate Limits Are Exceeded

If a request exceeds the allowed rate, the API returns:

Status: 429 Too Many Requests
{
  "error": "Rate limit exceeded"
}

Available API Categories

1Upload and Manage Source Files via the API

Use these endpoints to upload, replace, and organize your source files. This includes:

  • Uploading a single file or bulk uploading multiple files in a ZIP archive
  • Replacing or updating an existing source file with new content
  • Listing files with filtering, sorting, and pagination options

Go to Upload and Manage Source Files →

2Get Supported File Formats and Target Languages via the API

Use these endpoints to check:

  • The correct ISO codes to use when creating translation jobs or uploading translations
  • Which languages your project supports
  • All source file extensions you can upload to PTC, along with any additional translation files PTC can generate for those inputs

Go to Available File Formats and Target Languages →

3Request and Retrieve Translations via the API

Use these endpoints to submit content for translation, track its progress, and retrieve translations. This includes:

  • Creating translation jobs for JSON-structured content
  • Checking the status of translation jobs
  • Retrieving completed translations

Go to Request and Retrieve Translations →

4Integrate Localization into Your CI/CD Pipeline with the PTC API

Use this guide to automate translations as part of your build process. This includes:

  • Setting up PTC with GitHub Actions, GitLab CI/CD, or other CI/CD systems using ready-made configuration files
  • Running translations automatically and securely during every build

Go to CI/CD Integration →

Try PTC free for 30 days

Translate up to 20,000 words into 2 languages at no cost, then upgrade to Pro to unlock every feature.

Start free trial

Unlock this in Pro

Upgrade to Pro to switch on every feature.

Upgrade to Pro

Included in your Pro account

Open your dashboard to put it to work.

Your Account