---
title: event - GraphQL Admin
description: Get a single event by its id.
api_version: 2025-01
api_name: admin
type: query
api_type: graphql
source_url:
html: 'https://shopify.dev/docs/api/admin-graphql/2025-01/queries/event'
md: 'https://shopify.dev/docs/api/admin-graphql/2025-01/queries/event.md'
---
# event
query
Get a single event by its id.
## Arguments
* id
[ID!](https://shopify.dev/docs/api/admin-graphql/2025-01/scalars/ID)
required
The ID of the event.
***
## Possible returns
* Event
[Event](https://shopify.dev/docs/api/admin-graphql/2025-01/interfaces/Event)
Events chronicle resource activities such as the creation of an article, the fulfillment of an order, or the addition of a product.
***
## Examples
* ### Retrieve the first basic-event
#### Description
Retrieve an event by its id.
#### Query
```graphql
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}
```
#### cURL
```bash
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { event(id: \"gid://shopify/BasicEvent/422690323\") { id message ... on BasicEvent { action subjectType subject { __typename } } } }"
}'
```
#### React Router
```javascript
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}`,
);
const json = await response.json();
return json.data;
}
```
#### Ruby
```ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}
QUERY
response = client.query(query: query)
```
#### Node.js
```javascript
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}`,
});
```
#### Response
```json
{
"event": {
"id": "gid://shopify/BasicEvent/422690323",
"message": "bob bobsen included a product on Online Store: IPod Nano - 8GB.",
"action": "published",
"subjectType": "PRODUCT",
"subject": {
"__typename": "Product"
}
}
}
```
* ### Retrieves a single event
#### Query
```graphql
query EventShow($id: ID!) {
event(id: $id) {
id
action
createdAt
message
... on BasicEvent {
arguments
subjectId
subjectType
additionalContent
}
}
}
```
#### Variables
```json
{
"id": "gid://shopify/BasicEvent/267851118"
}
```
#### cURL
```bash
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }",
"variables": {
"id": "gid://shopify/BasicEvent/267851118"
}
}'
```
#### React Router
```javascript
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query EventShow($id: ID!) {
event(id: $id) {
id
action
createdAt
message
... on BasicEvent {
arguments
subjectId
subjectType
additionalContent
}
}
}`,
{
variables: {
"id": "gid://shopify/BasicEvent/267851118"
},
},
);
const json = await response.json();
return json.data;
}
```
#### Ruby
```ruby
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query EventShow($id: ID!) {
event(id: $id) {
id
action
createdAt
message
... on BasicEvent {
arguments
subjectId
subjectType
additionalContent
}
}
}
QUERY
variables = {
"id": "gid://shopify/BasicEvent/267851118"
}
response = client.query(query: query, variables: variables)
```
#### Node.js
```javascript
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `query EventShow($id: ID!) {
event(id: $id) {
id
action
createdAt
message
... on BasicEvent {
arguments
subjectId
subjectType
additionalContent
}
}
}`,
"variables": {
"id": "gid://shopify/BasicEvent/267851118"
},
},
});
```
#### Response
```json
{
"event": {
"id": "gid://shopify/BasicEvent/267851118",
"action": "unpublished",
"createdAt": "2006-06-09T12:00:00Z",
"message": "",
"arguments": [],
"subjectId": "gid://shopify/Product/630255015",
"subjectType": "PRODUCT",
"additionalContent": "null"
}
}
```
[Open in GraphiQL](http://localhost:3457/graphiql?query=query%20%7B%0A%20%20event\(id%3A%20%22gid%3A%2F%2Fshopify%2FBasicEvent%2F422690323%22\)%20%7B%0A%20%20%20%20id%0A%20%20%20%20message%0A%20%20%20%20...%20on%20BasicEvent%20%7B%0A%20%20%20%20%20%20action%0A%20%20%20%20%20%20subjectType%0A%20%20%20%20%20%20subject%20%7B%0A%20%20%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D)
```javascript
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}`,
);
const json = await response.json();
return json.data;
}
```
##### GQL
```
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}
```
##### cURL
```
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { event(id: \"gid://shopify/BasicEvent/422690323\") { id message ... on BasicEvent { action subjectType subject { __typename } } } }"
}'
```
##### React Router
```
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}`,
);
const json = await response.json();
return json.data;
}
```
##### Node.js
```
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}`,
});
```
##### Ruby
```
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
event(id: "gid://shopify/BasicEvent/422690323") {
id
message
... on BasicEvent {
action
subjectType
subject {
__typename
}
}
}
}
QUERY
response = client.query(query: query)
```
## Response
JSON
```json
{
"event": {
"id": "gid://shopify/BasicEvent/422690323",
"message": "bob bobsen included a product on Online Store: IPod Nano - 8GB.",
"action": "published",
"subjectType": "PRODUCT",
"subject": {
"__typename": "Product"
}
}
}
```