Skip to main content
GET
/
v2
/
translations
/
{resourceType}
/
{resourceId}
/
{locale}
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Operations;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();



$response = $sdk->translations->retrieve(
    resourceType: Operations\PathParamResourceType::Layout,
    resourceId: 'welcome-email',
    locale: 'en_US'

);

if ($response->translationResponseDto !== null) {
    // handle response
}
{
  "resourceId": "welcome-email",
  "resourceType": "workflow",
  "locale": "en_US",
  "content": {
    "welcome.title": "Welcome",
    "welcome.message": "Hello there!"
  },
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-01T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

resourceType
enum<string>
required

Resource type

Available options:
workflow,
layout
resourceId
string
required

Resource ID

locale
string
required

Locale code

Response

Translation found

resourceId
string
required

Resource identifier

Example:

"welcome-email"

resourceType
enum<string>
required

Resource type

Available options:
workflow,
layout
Example:

"workflow"

locale
string
required

Locale code

Example:

"en_US"

content
object
required

Translation content as JSON object

Example:
{
"welcome.title": "Welcome",
"welcome.message": "Hello there!"
}
createdAt
string
required

Creation timestamp

Example:

"2024-01-01T00:00:00.000Z"

updatedAt
string
required

Last update timestamp

Example:

"2024-01-01T00:00:00.000Z"