Update batch metadata
curl --request PUT \
--url https://api.promptloop.com/v0.1/batches/{batch_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"webhook_url": "https://api.example.com/updated-webhook/batch-results"
}
'import requests
url = "https://api.promptloop.com/v0.1/batches/{batch_id}"
payload = { "webhook_url": "https://api.example.com/updated-webhook/batch-results" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({webhook_url: 'https://api.example.com/updated-webhook/batch-results'})
};
fetch('https://api.promptloop.com/v0.1/batches/{batch_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"data": {
"batch_id": "<string>",
"batch_name": "<string>",
"task_id": "<string>",
"task_version": 123,
"created_at": "2023-11-07T05:31:56Z",
"completed": true,
"cancelled": true,
"webhook_url": "<string>"
},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}Batches
Update batch metadata
Updates user-defined metadata fields for the batch with provided id. This includes the webhook_url. Explicitly passing an empty string for webhook_url to the request body will remove/clear any webhook url from the batch.
PUT
/
v0.1
/
batches
/
{batch_id}
Update batch metadata
curl --request PUT \
--url https://api.promptloop.com/v0.1/batches/{batch_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"webhook_url": "https://api.example.com/updated-webhook/batch-results"
}
'import requests
url = "https://api.promptloop.com/v0.1/batches/{batch_id}"
payload = { "webhook_url": "https://api.example.com/updated-webhook/batch-results" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({webhook_url: 'https://api.example.com/updated-webhook/batch-results'})
};
fetch('https://api.promptloop.com/v0.1/batches/{batch_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"data": {
"batch_id": "<string>",
"batch_name": "<string>",
"task_id": "<string>",
"task_version": 123,
"created_at": "2023-11-07T05:31:56Z",
"completed": true,
"cancelled": true,
"webhook_url": "<string>"
},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
},
"request_id": "<string>"
}Authorizations
Path Parameters
Body
application/json
Webhook url to send data to upon batch completion. Provide an empty string to clear any existing webhook url assigned to the batch execution.
Example:
"https://api.example.com/updated-webhook/batch-results"
Response
Successfully updated batch with provided id
