Translations
List Translations
List all Translations that exist in Directus.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Cursor for use in pagination. Often used in combination with limit.
Responses
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
GET /translations
import { createDirectus, rest, readTranslations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readTranslations(query_object));
// Not currently available in GraphQL
{
"data": [
{
"id": "sc4346aa4-81a8-4885-b3a8-f647e4f6f769",
"key": "Test",
"language": "en-US",
"string": "Test"
}
],
"meta": {}
}
Create Multiple Translations
Create multiple new translations.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Responses
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
POST /translations
import { createDirectus, rest, createtranslations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createtranslations(translation_object_array));
// Not currently available in GraphQL
{
"data": [
{
"id": "sc4346aa4-81a8-4885-b3a8-f647e4f6f769",
"key": "Test",
"language": "en-US",
"string": "Test"
}
],
"meta": {}
}
Delete Multiple Translations
Delete multiple existing translations.
Responses
DELETE /translations
import { createDirectus, rest, deleteTranslations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteTranslations(translation_id_array));
// Not currently available in GraphQL
Update Multiple Translations
Update multiple Translations at the same time.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Responses
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
PATCH /translations
import { createDirectus, rest, updateTranslations } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateTranslations(translation_id_array, partial_translation_object));
// Not currently available in GraphQL
{
"data": [
{
"id": "sc4346aa4-81a8-4885-b3a8-f647e4f6f769",
"key": "Test",
"language": "en-US",
"string": "Test"
}
],
"meta": {}
}
Create a Translation
Create a new translation.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Responses
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
POST /translations
import { createDirectus, rest, createTranslation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createTranslation(translation_object));
// Not currently available in GraphQL
{
"data": {
"id": "sc4346aa4-81a8-4885-b3a8-f647e4f6f769",
"key": "Test",
"language": "en-US",
"string": "Test"
}
}
Retrieve a Translation
List an existing translation by primary key.
Query Parameters
Unique identifier of the Translation.
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
GET /translations/{id}
import { createDirectus, rest, readTranslation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readTranslation(translation_id, query_object));
// Not currently available in GraphQL
{
"data": {
"id": "sc4346aa4-81a8-4885-b3a8-f647e4f6f769",
"key": "Test",
"language": "en-US",
"string": "Test"
}
}
Delete a Translation
Delete an existing translation.
Query Parameters
Unique identifier of the Translation.
Responses
DELETE /translations/{id}
import { createDirectus, rest, deleteTranslation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteTranslation(translation_id));
// Not currently available in GraphQL
Update a Translation
Update an existing translation.
Query Parameters
Unique identifier of the Translation.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
Responses
Primary key of the translations.
The translation key.
The language of the translation.
The translation value.
PATCH /translations/{id}
import { createDirectus, rest, updateTranslation } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateTranslation(translation_id, partial_translation_object));
// Not currently available in GraphQL
{
"data": {
"id": "sc4346aa4-81a8-4885-b3a8-f647e4f6f769",
"key": "Test",
"language": "en-US",
"string": "Test"
}
}