> ## Documentation index
> Fetch the complete documentation index at: https://novu.docs7.io/llms.txt
> Ask it with GET https://novu.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Upload master translations JSON file

> Upload a master JSON file containing translations for multiple workflows. Locale is automatically detected from filename (e.g., en_US.json)

`POST /v2/translations/master-json/upload`

## OpenAPI

````yaml https://spec.speakeasy.com/novu/novu/json-development-with-code-samples post /v2/translations/master-json/upload
openapi: 3.0.0
info:
  title: Novu API
  description: Novu REST API. Please see https://docs.novu.co/api-reference for
    more details.
  version: 3.19.2
  contact:
    name: Novu Support
    url: https://discord.gg/novu
    email: support@novu.co
  termsOfService: https://novu.co/terms
  license:
    name: MIT
    url: https://opensource.org/license/mit
servers:
  - url: https://api.novu.co
  - url: https://eu.api.novu.co
security:
  - secretKey: []
tags:
  - name: Events
    description: Events represent a change in state of a subscriber. They are used
      to trigger workflows, and enable you to send notifications to subscribers
      based on their actions.
    externalDocs:
      url: https://docs.novu.co/workflows
  - name: Subscribers
    description: A subscriber in Novu represents someone who should receive a
      message. A subscriber's profile information contains important attributes
      about the subscriber that will be used in messages (name, email). The
      subscriber object can contain other key-value pairs that can be used to
      further personalize your messages.
    externalDocs:
      url: https://docs.novu.co/subscribers/subscribers
  - name: Topics
    description: Topics are a way to group subscribers together so that they can be
      notified of events at once. A topic is identified by a custom key. This
      can be helpful for things like sending out marketing emails or notifying
      users of new features. Topics can also be used to send notifications to
      the subscribers who have been grouped together based on their interests,
      location, activities and much more.
    externalDocs:
      url: https://docs.novu.co/subscribers/topics
  - name: Integrations
    description: With the help of the Integration Store, you can easily integrate
      your favorite delivery provider. During the runtime of the API, the
      Integrations Store is responsible for storing the configurations of all
      the providers.
    externalDocs:
      url: https://docs.novu.co/platform/integrations/overview
  - name: Workflows
    description: All notifications are sent via a workflow. Each workflow acts as a
      container for the logic and blueprint that are associated with a type of
      notification in your system.
    externalDocs:
      url: https://docs.novu.co/workflows
  - name: Messages
    description: A message in Novu represents a notification delivered to a
      recipient on a particular channel. Messages contain information about the
      request that triggered its delivery, a view of the data sent to the
      recipient, and a timeline of its lifecycle events. Learn more about
      messages.
    externalDocs:
      url: https://docs.novu.co/workflows/messages
  - name: Environments
    description: Environments allow you to manage different stages of your
      application development lifecycle. Each environment has its own set of API
      keys and configurations, enabling you to separate development, staging,
      and production workflows.
    externalDocs:
      url: https://docs.novu.co/platform/environments
  - name: Layouts
    description: Layouts are reusable wrappers for your email notifications.
    externalDocs:
      url: https://docs.novu.co/platform/workflow/layouts
  - name: Translations
    description: Used to localize your notifications to different languages.
    externalDocs:
      url: https://docs.novu.co/platform/workflow/advanced-features/translations
  - name: Domains
    description: Used to manage your inbound email domains.
    externalDocs:
      url: https://docs.novu.co/platform/domains
  - name: Agents
    description: Agents are conversational assistants that receive inbound messages
      from connected channels and respond through a custom code bridge or a
      managed runtime provider.
    externalDocs:
      url: https://docs.novu.co/agents
paths:
  /v2/translations/master-json/upload:
    post:
      description: Upload a master JSON file containing translations for multiple
        workflows. Locale is automatically detected from filename (e.g.,
        en_US.json)
      operationId: TranslationController_uploadMasterJsonEndpoint
      parameters:
        - name: idempotency-key
          in: header
          description: A header for idempotency purposes
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Master JSON file with locale as filename (e.g., en_US.json)
              required:
                - file
      responses:
        "200":
          description: Master translations uploaded successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ImportMasterJsonResponseDto"
      security:
        - secretKey: []
        - secretKey: []
      summary: Upload master translations JSON file
      tags:
        - Translations
      x-speakeasy-group: Translations.Master
      x-speakeasy-name-override: upload
      x-codeSamples:
        - lang: php
          label: PHP
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use novu;

            use novu\Models\Operations;


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

            $requestBody = new
            Operations\TranslationControllerUploadMasterJsonEndpointRequestBody(
                file: new Operations\File(
                    fileName: 'example.file',
                    content: file_get_contents('example.file');,
                ),
            );


            $response = $sdk->translations->master->upload(
                requestBody: $requestBody
            );


            if ($response->importMasterJsonResponseDto !== null) {
                // handle response
            }
        - lang: python
          label: Python
          source: |-
            from novu_py import Novu


            with Novu(
                secret_key="YOUR_SECRET_KEY_HERE",
            ) as novu:

                res = novu.translations.master.upload(request_body={
                    "file": {
                        "file_name": "example.file",
                        "content": open("example.file", "rb"),
                    },
                })

                # Handle response
                print(res)
        - lang: go
          label: Go
          source: >-
            package main


            import(
            	"context"
            	"github.com/novuhq/novu-go/v3"
            	"os"
            	"github.com/novuhq/novu-go/v3/models/operations"
            	"log"
            )


            func main() {
                ctx := context.Background()

                s := v3.New(
                    v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
                )

                example, fileErr := os.Open("example.file")
                if fileErr != nil {
                    panic(fileErr)
                }

                res, err := s.Translations.Master.Upload(ctx, operations.TranslationControllerUploadMasterJSONEndpointRequestBody{
                    File: operations.File{
                        FileName: "example.file",
                        Content: example,
                    },
                }, nil)
                if err != nil {
                    log.Fatal(err)
                }
                if res.ImportMasterJSONResponseDto != nil {
                    // handle response
                }
            }
        - lang: typescript
          label: TypeScript
          source: |-
            import { Novu } from "@novu/api";
            import { openAsBlob } from "node:fs";

            const novu = new Novu({
              secretKey: "YOUR_SECRET_KEY_HERE",
            });

            async function run() {
              const result = await novu.translations.master.upload({
                file: await openAsBlob("example.file"),
              });

              console.log(result);
            }

            run();
        - lang: csharp
          label: Csharp (SDK)
          source: >-
            using Novu;

            using Novu.Models.Components;

            using Novu.Models.Requests;


            var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");


            var res = await sdk.Translations.Master.UploadAsync(requestBody: new
            TranslationControllerUploadMasterJsonEndpointRequestBody() {
                File = new Novu.Models.Requests.File() {
                    FileName = "example.file",
                    Content = System.IO.File.ReadAllBytes("example.file"),
                },
            });


            // handle response
components:
  securitySchemes:
    secretKey:
      type: apiKey
      name: Authorization
      in: header
      description: 'API key authentication. Allowed headers-- "Authorization: ApiKey
        <novu_secret_key>".'
      x-speakeasy-example: YOUR_SECRET_KEY_HERE
  schemas:
    ImportMasterJsonResponseDto:
      type: object
      properties:
        success:
          type: boolean
          description: Overall success status of the import operation
          example: true
        message:
          type: string
          description: Human-readable message describing the import result
          example: "Successfully imported translations for 2 resources: welcome-email,
            password-reset"
        successful:
          description: List of resource IDs that were successfully imported
          example:
            - welcome-email
            - password-reset
          type: array
          items:
            type: string
        failed:
          description: List of resource IDs that failed to import
          example:
            - missing-workflow
          type: array
          items:
            type: string
      required:
        - success
        - message
````
