Skip to main content
PUT
/
v0.1
/
batches
/
{id}
Update batch metadata
curl --request PUT \
  --url https://api.promptloop.com/v0.1/batches/{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/{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/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "status": "success",
  "data": {
    "batch_id": "<string>",
    "task_id": "<string>",
    "task_version": "<string>",
    "batch_name": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "completed": true,
    "cancelled": true,
    "jobs_submitted": 123,
    "jobs_completed": 123,
    "job_status": "<string>"
  },
  "message": "<string>",
  "error": {
    "code": 123,
    "details": "<string>"
  }
}
{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}
{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}
{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}
{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}

Authorizations

x-api-key
string
header
required

Path Parameters

id
string
required

Body

application/json
webhook_url
string

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

status
enum<string>
required
Available options:
success,
error
Example:

"success"

data
object
required
message
string
required
error
object