Create a translation

Create a translation for a specific workflow and locale, if the translation already exists, it will be updated

POST
/v2/translations

Authorization

Authorization<token>

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

In: header

Authorization<token>

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

In: header

Request Body

application/jsonRequired
resourceIdRequiredstring

The resource ID to associate translation with. Accepts identifier or slug format

resourceTypeRequiredstring

The resource type to associate translation with

Value in: "workflow"
localeRequiredstring

Locale code (e.g., en_US, es_ES)

contentRequiredobject

Translation content as JSON object

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

Translation created or updated successfully

resourceIdRequiredstring

Resource identifier

resourceTypeRequiredstring

Resource type

Value in: "workflow"
localeRequiredstring

Locale code

contentRequiredobject

Translation content as JSON object

createdAtRequiredstring

Creation timestamp

updatedAtRequiredstring

Last update timestamp

export interface Response {
  /**
   * Resource identifier
   */
  resourceId: string;
  /**
   * Resource type
   */
  resourceType: "workflow";
  /**
   * Locale code
   */
  locale: string;
  /**
   * Translation content as JSON object
   */
  content: {};
  /**
   * Creation timestamp
   */
  createdAt: string;
  /**
   * Last update timestamp
   */
  updatedAt: string;
}
 
curl -X POST "https://api.novu.co/v2/translations" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceId": "welcome-email",
    "resourceType": "workflow",
    "locale": "en_US",
    "content": {
      "welcome.title": "Welcome",
      "welcome.message": "Hello there!"
    }
  }'
{
  "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"
}

On this page

No Headings
Edit this page on GitHub