> ## Documentation Index
> Fetch the complete documentation index at: https://promptlayer-1023-gorgias-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Track Prompt

Associate a prompt template with a request.

## Example Code

```python
import requests
response = requests.post(
  "https://api.promptlayer.com/rest/track-prompt",
  json={
      "api_key": "<YOUR_API_KEY>",
      "prompt_name": "<PROMPT_NAME>",
      "prompt_input_variables": {"variable1": "value1", "variable2": "value2"},
      "request_id": "<REQUEST_ID>",
      "version": "<VERSION>"
  },
)
```

## Request Parameters

<ParamField body="prompt_name" type="string" constraints="min_length=1" />

<ParamField body="prompt_input_variables" type="object" optional="true" />

<ParamField body="api_key" type="string" constraints="min_length=1">
  Your PromptLayer API Key
</ParamField>

<ParamField body="request_id" type="int" />

<ParamField body="version" type="int" optional="true">
  Both version and label cannot be specified. Only one or none.
</ParamField>

<ParamField body="label" type="string" constraints="min_length=1, max_length=512" optional="true">
  Both version and label cannot be specified. Only one or none.
</ParamField>
