KosmoKrator

productivity

Phrase Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Phrase KosmoKrator integration.

7 functions 7 read 0 write Bearer token auth

Lua Namespace

Agents call this integration through app.integrations.phrase.*. Use lua_read_doc("integrations.phrase") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Client for the Phrase localization platform — Lua API Reference

phrase_list_projects

List all Phrase projects the authenticated user has access to.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default 1).
per_pageintegernoNumber of projects per page (default 25, max 100).

Example

local result = app.integrations.phrase.phrase_list_projects({
  page = 1
  per_page = 25
})

phrase_get_project

Get details of a single Phrase project including name, slug, main format, and metadata.

Parameters

NameTypeRequiredDescription
project_idstringyesThe ID of the project to retrieve.

Example

local result = app.integrations.phrase.phrase_get_project({
  project_id = ""
})

phrase_list_keys

List translation keys in a Phrase project. Optionally filter by name and control pagination.

Parameters

NameTypeRequiredDescription
project_idstringyesThe project ID.
pageintegernoPage number (default 1).
per_pageintegernoNumber of keys per page (default 25, max 100).
qstringnoSearch query to filter keys by name.

Example

local result = app.integrations.phrase.phrase_list_keys({
  project_id = ""
  page = 1
  per_page = 25
  q = ""
})

phrase_get_key

Get a single translation key by ID, including name, description, tags, and plural settings.

Parameters

NameTypeRequiredDescription
project_idstringyesThe project ID.
key_idstringyesThe key ID.

Example

local result = app.integrations.phrase.phrase_get_key({
  project_id = ""
  key_id = ""
})

phrase_list_translations

List translations in a Phrase project. Optionally filter by key or locale.

Parameters

NameTypeRequiredDescription
project_idstringyesThe project ID.
pageintegernoPage number (default 1).
per_pageintegernoNumber of translations per page (default 25, max 100).
key_idstringnoFilter translations by key ID.
locale_idstringnoFilter translations by locale ID.
qstringnoSearch query to filter translations.

Example

local result = app.integrations.phrase.phrase_list_translations({
  project_id = ""
  page = 1
  per_page = 25
  key_id = ""
  locale_id = ""
  q = ""
})

phrase_list_locales

List locales in a Phrase project. Returns locale IDs, codes, names, and default status.

Parameters

NameTypeRequiredDescription
project_idstringyesThe project ID.
pageintegernoPage number (default 1).
per_pageintegernoNumber of locales per page (default 25, max 100).

Example

local result = app.integrations.phrase.phrase_list_locales({
  project_id = ""
  page = 1
  per_page = 25
})

phrase_get_current_user

Get the current authenticated Phrase user’s profile, including username, name, and email.

Example

local result = app.integrations.phrase.phrase_get_current_user({
})

Multi-Account Usage

If you have multiple phrase accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.phrase.function_name({...})

-- Explicit default (portable across setups)
app.integrations.phrase.default.function_name({...})

-- Named accounts
app.integrations.phrase.work.function_name({...})
app.integrations.phrase.personal.function_name({...})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Client for the Phrase localization platform — Lua API Reference

## phrase_list_projects

List all Phrase projects the authenticated user has access to.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default 1). |
| `per_page` | integer | no | Number of projects per page (default 25, max 100). |

### Example

```lua
local result = app.integrations.phrase.phrase_list_projects({
  page = 1
  per_page = 25
})
```

## phrase_get_project

Get details of a single Phrase project including name, slug, main format, and metadata.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | The ID of the project to retrieve. |

### Example

```lua
local result = app.integrations.phrase.phrase_get_project({
  project_id = ""
})
```

## phrase_list_keys

List translation keys in a Phrase project. Optionally filter by name and control pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | The project ID. |
| `page` | integer | no | Page number (default 1). |
| `per_page` | integer | no | Number of keys per page (default 25, max 100). |
| `q` | string | no | Search query to filter keys by name. |

### Example

```lua
local result = app.integrations.phrase.phrase_list_keys({
  project_id = ""
  page = 1
  per_page = 25
  q = ""
})
```

## phrase_get_key

Get a single translation key by ID, including name, description, tags, and plural settings.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | The project ID. |
| `key_id` | string | yes | The key ID. |

### Example

```lua
local result = app.integrations.phrase.phrase_get_key({
  project_id = ""
  key_id = ""
})
```

## phrase_list_translations

List translations in a Phrase project. Optionally filter by key or locale.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | The project ID. |
| `page` | integer | no | Page number (default 1). |
| `per_page` | integer | no | Number of translations per page (default 25, max 100). |
| `key_id` | string | no | Filter translations by key ID. |
| `locale_id` | string | no | Filter translations by locale ID. |
| `q` | string | no | Search query to filter translations. |

### Example

```lua
local result = app.integrations.phrase.phrase_list_translations({
  project_id = ""
  page = 1
  per_page = 25
  key_id = ""
  locale_id = ""
  q = ""
})
```

## phrase_list_locales

List locales in a Phrase project. Returns locale IDs, codes, names, and default status.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | The project ID. |
| `page` | integer | no | Page number (default 1). |
| `per_page` | integer | no | Number of locales per page (default 25, max 100). |

### Example

```lua
local result = app.integrations.phrase.phrase_list_locales({
  project_id = ""
  page = 1
  per_page = 25
})
```

## phrase_get_current_user

Get the current authenticated Phrase user's profile, including username, name, and email.

### Example

```lua
local result = app.integrations.phrase.phrase_get_current_user({
})
```

---

## Multi-Account Usage

If you have multiple phrase accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.phrase.function_name({...})

-- Explicit default (portable across setups)
app.integrations.phrase.default.function_name({...})

-- Named accounts
app.integrations.phrase.work.function_name({...})
app.integrations.phrase.personal.function_name({...})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.phrase.phrase_list_projects({
  page = 1,
  per_page = 1
})
print(result)

Functions

phrase_list_projects

List all Phrase projects the authenticated user has access to. Returns project IDs, names, main formats, and locale counts.

Operation
Read read
Full name
phrase.phrase_list_projects
ParameterTypeRequiredDescription
page integer no Page number (default 1).
per_page integer no Number of projects per page (default 25, max 100).

phrase_get_project

Get details of a single Phrase project including name, slug, main format, default locale, and shares.

Operation
Read read
Full name
phrase.phrase_get_project
ParameterTypeRequiredDescription
project_id string yes The ID of the project to retrieve.

phrase_list_keys

List translation keys in a Phrase project. Optionally filter by name using the query parameter, and control pagination with page and per_page. Returns key IDs, names, and creation dates.

Operation
Read read
Full name
phrase.phrase_list_keys
ParameterTypeRequiredDescription
project_id string yes The project ID.
page integer no Page number (default 1).
per_page integer no Number of keys per page (default 25, max 100).
q string no Search query to filter keys by name.

phrase_get_key

Get a single translation key by ID, including its name, description, tags, and plural settings.

Operation
Read read
Full name
phrase.phrase_get_key
ParameterTypeRequiredDescription
project_id string yes The project ID.
key_id string yes The key ID.

phrase_list_translations

List translations in a Phrase project. Optionally filter by key ID or locale ID, and control pagination with page and per_page. Returns translation content, key names, and locale codes.

Operation
Read read
Full name
phrase.phrase_list_translations
ParameterTypeRequiredDescription
project_id string yes The project ID.
page integer no Page number (default 1).
per_page integer no Number of translations per page (default 25, max 100).
key_id string no Filter translations by key ID.
locale_id string no Filter translations by locale ID.
q string no Search query to filter translations.

phrase_list_locales

List locales in a Phrase project. Returns locale IDs, codes, names, and default status.

Operation
Read read
Full name
phrase.phrase_list_locales
ParameterTypeRequiredDescription
project_id string yes The project ID.
page integer no Page number (default 1).
per_page integer no Number of locales per page (default 25, max 100).

phrase_get_current_user

Get the current authenticated Phrase user's profile, including username, name, email, and account details.

Operation
Read read
Full name
phrase.phrase_get_current_user
ParameterTypeRequiredDescription
No parameters.