Skip to main content
POST
/
team
/
{team}
/
booking-batches
Create a new batch
curl --request POST \
  --url https://app.smartsend.io/api/v2/team/{team}/booking-batches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reference": "<string>",
  "identifier": "<string>"
}
'
import requests

url = "https://app.smartsend.io/api/v2/team/{team}/booking-batches"

payload = {
"reference": "<string>",
"identifier": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: '<string>', identifier: '<string>'})
};

fetch('https://app.smartsend.io/api/v2/team/{team}/booking-batches', 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://app.smartsend.io/api/v2/team/{team}/booking-batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reference' => '<string>',
'identifier' => '<string>'
]),
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://app.smartsend.io/api/v2/team/{team}/booking-batches"

payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"identifier\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://app.smartsend.io/api/v2/team/{team}/booking-batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"identifier\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.smartsend.io/api/v2/team/{team}/booking-batches")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"<string>\",\n \"identifier\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "reference": "<string>",
    "identifier": "<string>",
    "total_count": 123,
    "completed_count": 123,
    "failed_count": 123,
    "progress": 50,
    "created_at": "2023-11-07T05:31:56Z",
    "started_at": "2023-11-07T05:31:56Z",
    "finished_at": "2023-11-07T05:31:56Z"
  }
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>",
"errors": {}
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

Authorizations

Authorization
string
header
required

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

Headers

Accept-Language
string
default:en

Preferred language(s) for translatable content using BCP 47 language tags. Supports quality values (q-factors) for priority ordering. The API negotiates the best available language based on this header, the team's configured language, and available translations. If omitted, the team's default language is used.

Example:

"da-DK, da;q=0.9, en;q=0.8"

Request-ID
string

Any value passed in this request will be returned in the same header. This can be used to correlate requests between client and server.

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9._-]{1,128}$
Idempotency-Key
string

Optional key that makes a write request idempotent so it can be safely retried. Reusing the key with an identical payload within 24 hours returns the original response without re-executing the operation (with an Idempotency-Replayed: true response header); reusing it with a different payload returns 422, and retrying while the original is still processing returns 409 with a Retry-After header. Use a client-generated, case-sensitive string of 16–128 characters (letters, digits, ., _, -). Deriving it deterministically from the request — for example the order ID combined with a hash of the payload — lets retries reuse the same key without storing it. See https://docs.smartsend.io/api-reference/idempotency.

Required string length: 16 - 128
Pattern: ^[A-Za-z0-9._-]{16,128}$

Path Parameters

team
string
required

Team identifier. All resources are scoped to this team.

Minimum string length: 1
Example:

"ad9546c1-393e-49a5-9a72-5cc146c9bec5"

Body

application/json
reference
null | string
required

Human-readable reference visible to users

identifier
null | string
required

System identifier for internal integrations

Response

Batch created successfully

data
object
required

A batch of shipments for bulk booking