Context

Upload new context

Changed on

Visual Context provides a visual representation of the source content to Translators and Editors as they are performing their work, and is a very effective way to ensure high-quality translations. Visual Context is displayed in the Smartling CAT Tool - the environment in which translations are performed.

The following context types are supported via the Smartling API:

  • HTML: HTML files or files with content type text/html
  • IMAGE: Image files
  • VIDEO:
    • Video file
    • Link to video, such as:
      • YouTube link
      • Vimeo link
      • Direct link to an .mp4 file

Context type is not specified directly, but rather, inferred via analyzing the request body.

This endpoint accepts multipart/form-data request body.

post/context-api/v2/projects/{projectId}/contexts

Request

  • Base URL
    https://api.smartling.com
  • Auth
    HTTP bearer

Path parameters

projectIdstring required

Unique identifier of a Smartling project — 9 lowercase alphanumeric characters.

Example:84c012a33

A unique project identifier. This can be found in the Smartling Dashboard under Account Settings > API.

Request body multipart/form-data

namestring

Context name. Overwrites the content's file name if specified. Parameter meanings for different context types:

Context TypeMeaning
HTMLContext URL or file name. If a valid URL is used, all relative links to resources within the context file will be resolved based on this URL. If the file name is used, the context file should have the <base /> tag specified with the valid URL to resolve all relative links to resources. In all other cases, links to resources will not be resolved and the context might not show correctly. Defaults to context file name if not specified.
IMAGEImage file name.
VIDEOLink to a publicly available video in case content field is empty. The parameter is required for this particular case. Otherwise, video file name.
contentstring binary

The context file to upload.

It should be one of the supported content types(user should insert content type instead of the *. E.g. image/jpeg.):

  • image/*
  • text/html
  • video/*

Maximum file upload size is:

  • 20MB – for HTML and image files.
  • 500MB – for video files.

Note: Exclude this parameter if you choose to upload a video context pointing to external MP4 file, youtube or vimeo.

Response

OK

Example response

{
  "response": {
    "data": {
      "created": "2026-01-15T10:00:00Z"
    }
  }
}

Changes

    • breaking

      added the pattern ^[a-z0-9]{9}$ to the path request parameter projectId

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • info

      for the path request parameter projectId, the format was generalized from uuid to no format