Skip to main content
PATCH
/
v1
/
batches
/
{batch_id}
Update batch metadata
curl --request PATCH \
  --url https://api.olostep.com/v1/batches/{batch_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metadata": {
    "status": "reviewed",
    "reviewer": "jane@example.com"
  }
}
'
import requests

url = "https://api.olostep.com/v1/batches/{batch_id}"

payload = { "metadata": {
        "status": "reviewed",
        "reviewer": "jane@example.com"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({metadata: {status: 'reviewed', reviewer: 'jane@example.com'}})
};

fetch('https://api.olostep.com/v1/batches/{batch_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.olostep.com/v1/batches/{batch_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'metadata' => [
        'status' => 'reviewed',
        'reviewer' => 'jane@example.com'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.olostep.com/v1/batches/{batch_id}"

	payload := strings.NewReader("{\n  \"metadata\": {\n    \"status\": \"reviewed\",\n    \"reviewer\": \"jane@example.com\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.olostep.com/v1/batches/{batch_id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"metadata\": {\n    \"status\": \"reviewed\",\n    \"reviewer\": \"jane@example.com\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.olostep.com/v1/batches/{batch_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"metadata\": {\n    \"status\": \"reviewed\",\n    \"reviewer\": \"jane@example.com\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "batch_abc123def456",
  "object": "batch",
  "status": "completed",
  "created": 1704067200,
  "total_urls": 10,
  "completed_urls": 10,
  "metadata": {
    "batch_name": "Q1 Product Sync",
    "status": "reviewed",
    "reviewer": "jane@example.com"
  }
}
{
  "id": "error_abc123",
  "object": "error",
  "code": "invalid_metadata",
  "type": "https://docs.olostep.com/api-reference/errors/bad_request",
  "status": 400,
  "title": "Bad Request",
  "detail": "No metadata field provided. Only metadata can be updated.",
  "created": 1704067200,
  "metadata": {}
}
{
  "id": "error_abc123",
  "object": "error",
  "code": "invalid_api_key",
  "type": "https://docs.olostep.com/api-reference/errors/unauthorized",
  "status": 401,
  "title": "Unauthorized",
  "detail": "Your API key is invalid",
  "created": 1704067200,
  "metadata": {}
}
{
  "id": "error_abc123",
  "object": "error",
  "code": "batch_not_found",
  "type": "https://docs.olostep.com/api-reference/errors/not_found",
  "status": 404,
  "title": "Not Found",
  "detail": "Batch not found",
  "created": 1704067200,
  "metadata": {}
}
{
  "id": "error_abc123",
  "object": "error",
  "code": "internal_server_error",
  "type": "https://docs.olostep.com/api-reference/errors/internal_error",
  "status": 500,
  "title": "Internal Server Error",
  "detail": "An unexpected error occurred",
  "created": 1704067200,
  "metadata": {}
}
Merge semantics: Metadata updates follow Stripe’s approach — new keys are added, existing keys are updated, and keys set to empty string "" are deleted.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer , where is your auth token.

Path Parameters

batch_id
string
required

The ID of the batch to update.

Body

application/json
metadata
object
required

Set of key-value pairs for storing additional information about an object. Follows Stripe's approach with validation rules: max 50 keys, key max 40 characters (no square brackets), value max 500 characters, all values stored as strings.

Example:
{
  "order_id": "12345",
  "customer_name": "John Doe",
  "priority": "high",
  "processed": "true"
}

Response

Batch metadata updated successfully.

id
string

Batch ID

object
string

The kind of object. "batch" for this endpoint.

status
string

in_progress or completed

created
number

Created epoch

total_urls
number

Count of URLs in the batch

completed_urls
number

Count of completed URLs

metadata
object

Set of key-value pairs for storing additional information about an object. Follows Stripe's approach with validation rules: max 50 keys, key max 40 characters (no square brackets), value max 500 characters, all values stored as strings.

Example:
{
  "order_id": "12345",
  "customer_name": "John Doe",
  "priority": "high",
  "processed": "true"
}