---
title: "Run automatic context matching"
method: POST
path: "/context-api/v2/projects/{projectId}/contexts/{contextUid}/match/async"
tags: ["Context"]
---

# Run automatic context matching

`POST /context-api/v2/projects/{projectId}/contexts/{contextUid}/match/async`

Automatically matches context against strings in the project and creates corresponding bindings.
Optionally, you can restrict matching to only a set of strings that you specify to ensure that no unwanted
bindings are created.

The following endpoint does not support video contexts pointing to Youtube or Vimeo videos.

Optical Character Recognition (OCR) is used for `IMAGE` and `VIDEO` contexts, while `HTML` context uses an approximate string matching algorithm.

This is a convenient method provided to save time and complexity in your integration.
Although that our OCR functionality is advanced, it cannot match 100% of strings. If you need complete context coverage,
use either [Create string to context bindings](/#operation/createStringToContextBindings) endpoint to bind
strings manually or check your image contexts in the Smartling Dashboard after
running this request to fill in any blanks. Note that OCR quality may be lower if you are using an unusual or
script-like font.

Applying this operation to a video context, keep in mind the original context will be removed
and image contexts will be created instead for each frame that has one matched string at least.
A string can't be bound to multiple frames simultaneously.

## Path parameters

- `projectId` string, uuid, required
- `contextUid` string, uuid, required

## Request body

- MatchParams — *Uncollapse this block to get the detailed description of `matchParams`.* <br/><br/> If none of `stringHashcodes`, `contentFileUri`, `translationJobUids` are specified, **all strings from the project** will be included in the match. <br/> If `overrideContextOlderThanDays` is not specified, **strings with context will not be bound to this context**.
  - `contentFileUri` string — File URI containing strings to perform matching with the context: <br/> Example: `"contentFileUri": "example.properties"` <br/> Can't be used along with the `stringHashcodes` or `translationJobUids` parameter.
  - `stringHashcodes` string[] — An array of string hashcodes to perform matching with the context: <br/> Example: `"stringHashcodes": ["hashcode1", "hashcode2"]` <br/> Can't be used along with the `contentFileUri` or `translationJobUids` parameter.
  - `translationJobUids` string[] — A translation job UID to perform matching with the context. Only one UID can be specified: <br/> Example: `"translationJobUids": ["translationJobUid"]` <br/> Can't be used along with the `contentFileUri` or `stringHashcodes` parameter.
  - `overrideContextOlderThanDays` integer — Specifies whether to override context for strings that were already bound to other context, and that context is at least as "overrideContextOlderThanDays" old.
  - `videoMatchingMode` 'SUBTITLES' | 'OCR_WITH_SPLITTING' | 'OCR' — Specifies the behavior of string matching for video contexts. | videoMatchingMode | Description | |----------------------|-------------| | `SUBTITLES` | In this mode you should provide the property `contentFileUri` that points to the subtitles content file. Strings will be bound by the subtitle's timestamps. | | `OCR_WITH_SPLITTING` | Detects key frames and checks each frame for text using OCR. If string matches, an image context is created for that frame. Frames without matches and the original video are deleted. | | `OCR` | Detects key frames and checks each frame for text using OCR. If string matches, we bind the string to the original video using the key frame's timestamp and text coordinates. |

## Response `202`

ACCEPTED

- AsyncMatchResponse
  - `response` object
    - `code` 'SUCCESS' — Code of the completed operation.
    - `data` object
      - `processUid` string, uuid — Identifier of the started asynchronous process. Should be specified for getting matching stats.
      - `matchId` string, uuid — Identifier of the started match operation. Should be specified for getting matching stats. Deprecated, use `processUid` property

## Other responses

- `400` — Validation error
- `401` — Provided credentials are not valid.
- `429` — Too many simultaneous API requests.
- `500` — Unexpected error

---

[API](https://skmtc.dev/smartling/apis/smartling-rest-api-reference.md) · [All operations](https://skmtc.dev/smartling/apis/smartling-rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smartling/smartling-rest-api-reference/revisions/2a73d11e9b98/schema)
