---
title: "Upload new context and run automatic context matching"
method: POST
path: "/context-api/v2/projects/{projectId}/contexts/upload-and-match-async"
tags: ["Context"]
---

# Upload new context and run automatic context matching

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

Combines two endpoints:
- [Upload new context](/#operation/uploadNewVisualContext)
- [Run automatic context matching](/#operation/runAutomaticContextMatching)

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

Strings to match are retrieved from the project specified by the `projectId` and
can be filtered further by the optional `matchParams` parameter.

If the uploaded file doesn't match any string, the context may not be created.

Example of the raw request accepted by this API:
```
Content-Type: multipart/form-data; boundary
----------------------------293641908835402749402839
Content-Disposition: form-data; name="content"; filename="example.html"
Content-Type: text/html
<html>
  <body>
    <div> bla</div>
  </body>
</html>
----------------------------293641908835402749402839
Content-Disposition: form-data; name="name"
https://your.domain.com/path/example.html
----------------------------293641908835402749402839
Content-Disposition: form-data; name="matchParams"
Content-Type: application/json
{
  "contentFileUri":"example.properties",
  "stringHashcodes": [],
  "overrideContextOlderThanDays": 1
}
```

## Path parameters

- `projectId` string, uuid, required

## 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.net/smartling/apis/smartling-rest-api-reference.md) · [All operations](https://skmtc.net/smartling/apis/smartling-rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smartling/smartling-rest-api-reference/versions/2a73d11e9b98/schema)
