---
title: "getVariableContext"
method: POST
path: "/v1/template-variables:context"
tags: ["Templates"]
---

# getVariableContext

`POST /v1/template-variables:context`

Get full variable context

Calls Entity API, User API, Brand API and others to construct full context object used for template variable replace

## Request body

- object
  - `parameters` VariableParameters
    - `template_type` 'email' | 'document', required
    - `language` string — 2-letter language code (ISO 639-1)
    - `main_entity_id` string, uuid — The main entity ID. Use main entity in order to use the variable without schema slug prefix - or just pass directly to other object ID.
    - `brand_id` number, nullable — Brand ID
    - `user_id` string, nullable — User ID
    - `user_org_id` string, nullable — Organization ID of the user
    - `custom_variables` ExternalCustomVariable[] — Custom variables with specified values form other services.
      - `variable` string
      - `value` string
    - `context_data` object — If context data is available, this data will be used for variable replace.
    - `template_name` string — The name of email template
    - `template_tags` string[] — The tags of email template
    - `template_id` string — The Id of email template
    - `variables_version` string — The version of the variables syntax supported. Default is 1.0

## Response `200`

ok

- VariableContext
  - `unsubscribe_url` string
  - `main` object
  - `contact` object
  - `brand` object

---

[API](https://skmtc.dev/epilot/apis/template-variables-api.md) · [All operations](https://skmtc.dev/epilot/apis/template-variables-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/epilot/template-variables-api/revisions/ff0c1e3dc198/schema)
