Import master translations JSON

Import translations for multiple workflows from master JSON format for a specific locale

POST
/v2/translations/master-json

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
localeRequiredstring

The locale for which translations are being imported

masterJsonRequiredobject

Master JSON object containing all translations organized by workflow identifier

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

Master translations imported successfully

successRequiredboolean

Overall success status of the import operation

messageRequiredstring

Human-readable message describing the import result

successfularray<string>

List of resource IDs that were successfully imported

failedarray<string>

List of resource IDs that failed to import

export interface Response {
  /**
   * Overall success status of the import operation
   */
  success: boolean;
  /**
   * Human-readable message describing the import result
   */
  message: string;
  /**
   * List of resource IDs that were successfully imported
   */
  successful?: string[];
  /**
   * List of resource IDs that failed to import
   */
  failed?: string[];
}
 
curl -X POST "https://api.novu.co/v2/translations/master-json" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "locale": "en_US",
    "masterJson": {
      "workflows": {
        "welcome-email": {
          "welcome.title": "Welcome to our platform",
          "welcome.message": "Hello there!"
        },
        "password-reset": {
          "reset.title": "Reset your password",
          "reset.message": "Click the link to reset"
        }
      }
    }
  }'
{
  "success": true,
  "message": "Successfully imported translations for 2 resources: welcome-email, password-reset",
  "successful": [
    "welcome-email",
    "password-reset"
  ],
  "failed": [
    "missing-workflow"
  ]
}

On this page

No Headings
Edit this page on GitHub