# GS1 Queries API

**Canonical:** https://apis.io/apis/gs1/gs1-queries-api/  
**Provider:** GS1 — https://apis.io/providers/gs1/  
**Base URL:** https://id.gs1.org  
**Documentation:** https://ref.gs1.org/standards/epcis/

GS1 Queries API is one of 7 APIs that [GS1](https://apis.io/providers/gs1/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. This API exposes 2 JSON Schema definitions. Tagged areas include Query. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, and 2 JSON Schemas.

Endpoints to create large named or anonymous queries using the EPCIS Query Language. Named queries have a custom name and are stored until deleted by the user. Anonymous queries are not persisted and only available to the caller. EPCIS events queries also support query subscription.

## Operations (10)

| Method | Path | Summary |
|---|---|---|
| GET | `/queries` | Returns a list of queries available. |
| POST | `/queries` | Creates a named EPCIS events query. |
| GET | `/queries/{queryName}` | Returns the query definition. |
| DELETE | `/queries/{queryName}` | Removes a named query and forcibly unsubscribes all active subscriptions, whether by WebSockets or Webhooks |
| GET | `/queries/{queryName}/subscriptions` | Returns active subscriptions with the option to use pagination if needed. |
| POST | `/queries/{queryName}/subscriptions` | Creates a query subscription. |
| GET | `/queries/{queryName}/subscriptions/{subscriptionID}` | Returns the details of a subscription. This method is useful to verify if a subscription is still active. |
| DELETE | `/queries/{queryName}/subscriptions/{subscriptionID}` | Unsubscribes a client by deleting the query subscription. |
| GET | `/queries/{queryName}/events` | Returns EPCIS events with the option to use pagination if needed. This endpoint supports query subscriptions using WebSockets. |
| DELETE | `/nextPageToken/{token}` | Optional endpoint that allows on-demand release of any resources associated with `nextPageToken`. |

## Machine-readable artifacts (8)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/gs1/refs/heads/main/openapi/gs1-queries-api-openapi.yml
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/gs1/refs/heads/main/json-schema/gs1-epcis-json-schema.json
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/gs1/refs/heads/main/json-schema/gs1-epcis-query-schema.json
- **Specification** — https://ref.gs1.org/standards/epcis/2.0.1/
- **Documentation** — https://www.gs1.org/standards/epcis
- **Artefacts** — https://ref.gs1.org/standards/epcis/artefacts
- **Vocabulary** — https://ref.gs1.org/cbv/
- **SourceCode** — https://github.com/gs1/EPCIS

## Other GS1 APIs (6)

- [GS1 Digital Link Resolver (id.gs1.org)](https://apis.io/apis/gs1/gs1-digital-link-resolver/)
- [GS1 Capture API](https://apis.io/apis/gs1/gs1-capture-api/)
- [GS1 Discovery API](https://apis.io/apis/gs1/gs1-discovery-api/)
- [GS1 Events API](https://apis.io/apis/gs1/gs1-events-api/)
- [GS1 Subscriptions API](https://apis.io/apis/gs1/gs1-subscriptions-api/)
- [GS1 Top Level API](https://apis.io/apis/gs1/gs1-top-level-api/)

## Tags

Query

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/gs1/gs1-queries-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/gs1/.
