Languages & Environments
Usage Documentation
- Sharing Requests
- Prompt Registry
- Running Requests
- Advanced Logging
- FAQ
Why PromptLayer?
Reference
- REST API Reference
- POSTGet Prompt Template
- POSTPublish Prompt Template
- GETGet Prompt Template Labels
- PATCHMove Prompt Template Labels
- DELDelete a Prompt Template Label
- POSTCreate a Prompt Template Label
- POSTTrack Score
- POSTTrack Prompt
- POSTTrack Group
- POSTTrack Metadata
- GETGet All Prompt Templates
- POSTCreate Dataset from History
- POSTCreate Evaluation Pipeline
- POSTRun Full Evaluation
- GETGet Evaluation
- GETGet Evaluation Score
- DELDelete Reports by Name
- POSTLog Request
- GETGet Agent Version Execution Results
- POSTRun Agent
Reference
Track Metadata
POST
https://api.promptlayer.com
/
rest
/
track-metadata
curl --request POST \
--url https://api.promptlayer.com/rest/track-metadata \
--header 'Content-Type: application/json' \
--data '{
"api_key": "<string>",
"request_id": 123,
"metadata": {}
}'
{
"success": true,
"message": "<string>"
}
Associate a metadata dictionary with a request. This can be used for things like session_ids, user_ids, location, etc.
Example Code
import requests
response = requests.post(
"https://api.promptlayer.com/rest/track-metadata",
json={
"api_key": "<YOUR_API_KEY>",
"request_id": "<REQUEST_ID>",
"metadata": {"session_id": "abc123", "user_id": "user123"}
},
)
Body
application/json
Response
200
application/json
Metadata tracked successfully
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://api.promptlayer.com/rest/track-metadata \
--header 'Content-Type: application/json' \
--data '{
"api_key": "<string>",
"request_id": 123,
"metadata": {}
}'
{
"success": true,
"message": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.