Skip to main content
DELETE
/
cancel-all
Cancel all orders
curl --request DELETE \
  --url https://clob.polymarket.com/cancel-all \
  --header 'POLY_ADDRESS: <api-key>' \
  --header 'POLY_API_KEY: <api-key>' \
  --header 'POLY_PASSPHRASE: <api-key>' \
  --header 'POLY_SIGNATURE: <api-key>' \
  --header 'POLY_TIMESTAMP: <api-key>'
import requests

url = "https://clob.polymarket.com/cancel-all"

headers = {
"POLY_API_KEY": "<api-key>",
"POLY_ADDRESS": "<api-key>",
"POLY_SIGNATURE": "<api-key>",
"POLY_PASSPHRASE": "<api-key>",
"POLY_TIMESTAMP": "<api-key>"
}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {
method: 'DELETE',
headers: {
POLY_API_KEY: '<api-key>',
POLY_ADDRESS: '<api-key>',
POLY_SIGNATURE: '<api-key>',
POLY_PASSPHRASE: '<api-key>',
POLY_TIMESTAMP: '<api-key>'
}
};

fetch('https://clob.polymarket.com/cancel-all', 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://clob.polymarket.com/cancel-all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"POLY_ADDRESS: <api-key>",
"POLY_API_KEY: <api-key>",
"POLY_PASSPHRASE: <api-key>",
"POLY_SIGNATURE: <api-key>",
"POLY_TIMESTAMP: <api-key>"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://clob.polymarket.com/cancel-all"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("POLY_API_KEY", "<api-key>")
req.Header.Add("POLY_ADDRESS", "<api-key>")
req.Header.Add("POLY_SIGNATURE", "<api-key>")
req.Header.Add("POLY_PASSPHRASE", "<api-key>")
req.Header.Add("POLY_TIMESTAMP", "<api-key>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://clob.polymarket.com/cancel-all")
.header("POLY_API_KEY", "<api-key>")
.header("POLY_ADDRESS", "<api-key>")
.header("POLY_SIGNATURE", "<api-key>")
.header("POLY_PASSPHRASE", "<api-key>")
.header("POLY_TIMESTAMP", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://clob.polymarket.com/cancel-all")

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

request = Net::HTTP::Delete.new(url)
request["POLY_API_KEY"] = '<api-key>'
request["POLY_ADDRESS"] = '<api-key>'
request["POLY_SIGNATURE"] = '<api-key>'
request["POLY_PASSPHRASE"] = '<api-key>'
request["POLY_TIMESTAMP"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "canceled": [
    "0xabcdef1234567890abcdef1234567890abcdef12",
    "0xfedcba0987654321fedcba0987654321fedcba09"
  ],
  "not_canceled": {}
}

Authorizations

POLY_API_KEY
string
header
required

Your API key

POLY_ADDRESS
string
header
required

Ethereum address associated with the API key

POLY_SIGNATURE
string
header
required

HMAC signature of the request

POLY_PASSPHRASE
string
header
required

API key passphrase

POLY_TIMESTAMP
string
header
required

Unix timestamp of the request

Response

Cancellation results for all orders

canceled
string[]
required

Array of order IDs that were successfully canceled

Example:
[
"0xabcdef1234567890abcdef1234567890abcdef12"
]
not_canceled
object
required

Map of order IDs that could not be canceled with error messages

Example:
{
"0xabcdef1234567890abcdef1234567890abcdef12": "Order not found or already canceled"
}