curl --request POST \
--url https://www.closient.com/epcis/api/2.0/queries \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "myQuery",
"query": {
"EQ_bizStep": [
"shipping",
"receiving"
],
"eventType": [
"ObjectEvent"
]
}
}
'import requests
url = "https://www.closient.com/epcis/api/2.0/queries"
payload = {
"name": "myQuery",
"query": {
"EQ_bizStep": ["shipping", "receiving"],
"eventType": ["ObjectEvent"]
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'myQuery',
query: {EQ_bizStep: ['shipping', 'receiving'], eventType: ['ObjectEvent']}
})
};
fetch('https://www.closient.com/epcis/api/2.0/queries', 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://www.closient.com/epcis/api/2.0/queries",
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([
'name' => 'myQuery',
'query' => [
'EQ_bizStep' => [
'shipping',
'receiving'
],
'eventType' => [
'ObjectEvent'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/epcis/api/2.0/queries"
payload := strings.NewReader("{\n \"name\": \"myQuery\",\n \"query\": {\n \"EQ_bizStep\": [\n \"shipping\",\n \"receiving\"\n ],\n \"eventType\": [\n \"ObjectEvent\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://www.closient.com/epcis/api/2.0/queries")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"myQuery\",\n \"query\": {\n \"EQ_bizStep\": [\n \"shipping\",\n \"receiving\"\n ],\n \"eventType\": [\n \"ObjectEvent\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/epcis/api/2.0/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"myQuery\",\n \"query\": {\n \"EQ_bizStep\": [\n \"shipping\",\n \"receiving\"\n ],\n \"eventType\": [\n \"ObjectEvent\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Create a named query
Create a named query — a view on your organization’s events — per the GS1 EPCIS 2.0 REST binding (POST /queries). Answers 201 with a Location header naming the query; its results are at Location + /events. 409 if your organization already has a query of that name. The query object uses the EPCIS 2.0 query language; a query naming a parameter Closient does not execute is refused with 400 naming it, rather than stored and later run without that filter (a dropped filter returns more events than asked for). Caller must hold OWNER or MANAGER on an organization.
curl --request POST \
--url https://www.closient.com/epcis/api/2.0/queries \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "myQuery",
"query": {
"EQ_bizStep": [
"shipping",
"receiving"
],
"eventType": [
"ObjectEvent"
]
}
}
'import requests
url = "https://www.closient.com/epcis/api/2.0/queries"
payload = {
"name": "myQuery",
"query": {
"EQ_bizStep": ["shipping", "receiving"],
"eventType": ["ObjectEvent"]
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'myQuery',
query: {EQ_bizStep: ['shipping', 'receiving'], eventType: ['ObjectEvent']}
})
};
fetch('https://www.closient.com/epcis/api/2.0/queries', 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://www.closient.com/epcis/api/2.0/queries",
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([
'name' => 'myQuery',
'query' => [
'EQ_bizStep' => [
'shipping',
'receiving'
],
'eventType' => [
'ObjectEvent'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/epcis/api/2.0/queries"
payload := strings.NewReader("{\n \"name\": \"myQuery\",\n \"query\": {\n \"EQ_bizStep\": [\n \"shipping\",\n \"receiving\"\n ],\n \"eventType\": [\n \"ObjectEvent\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://www.closient.com/epcis/api/2.0/queries")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"myQuery\",\n \"query\": {\n \"EQ_bizStep\": [\n \"shipping\",\n \"receiving\"\n ],\n \"eventType\": [\n \"ObjectEvent\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/epcis/api/2.0/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"myQuery\",\n \"query\": {\n \"EQ_bizStep\": [\n \"shipping\",\n \"receiving\"\n ],\n \"eventType\": [\n \"ObjectEvent\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Authorizations
Body
A named query: the standard's QueryDefinition (POST /queries body, GET /queries items).
Unique name of the query in your organization; its URL is /queries/{name}. 1-255 characters from A-Z, a-z, 0-9 and . _ ~ -, not starting with ..
1 - 255^[A-Za-z0-9_~-][A-Za-z0-9._~-]{0,254}$An EPCIS 2.0 query object (https://ref.gs1.org/standards/epcis/2.0.0/query-schema.json). Supported parameters: eventType, GE_eventTime, LT_eventTime, EQ_action, EQ_bizStep, EQ_disposition, EQ_readPoint, EQ_bizLocation, MATCH_epc and MATCH_anyEPC; a query naming any other parameter is refused with 400 rather than run without it. Every parameter except the two times is an array, matching any of its values.
Show child attributes
Show child attributes
Response
Created