---
title: "Add an event to an instance"
method: POST
path: "/instances/{instance_id}/events"
tags: ["Private"]
---

# Add an event to an instance

`POST /instances/{instance_id}/events`

## Request

- Base URL: `https://api.beta.ons.gov.uk/v1`
- URL: `https://api.beta.ons.gov.uk/v1/instances/{instance_id}/events`
- Auth: API key in header `Authorization`

Add a new event into an instance. Events can be for information or error messages.
Each event must contain a type of event (Info or Error), a message to explain
the event, time of the event and finally the message offset in kafka

## Path parameters

- `instance_id` string, required

## Headers

- `If-Match` string

## Request body

- Event
  - `message` string: A description of the event
  - `message_offset` string: The kafka message offset (Used to locate the kafka message)
  - `time` string: The time of the event in ISO 8601 format
  - `type` string: The type of event, this can be; * Info - for an information event * Error - for an error event

## Response `201`

The event was added to the instance

## Other responses

- `400`: Failed to process the request due to invalid request
- `401`: The token provided is unauthorised to carry out this operation
- `404`: InstanceId does not match any instances
- `409`: Failed to process the request due to a conflict
- `500`: Failed to process the request due to an internal error

## Changes

- **2025-02-18** `f5f36bf68ba9`: 2 info
  - the endpoint scheme security `Authorization` was added to the API
  - the endpoint scheme security `InternalAPIKey` was removed from the API

[Operation history](https://skmtc.dev/office-of-national-statistics/apis/explore-our-data/changes/instances/:instance_id/events/post.md)

---

[API](https://skmtc.dev/office-of-national-statistics/apis/explore-our-data.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/explore-our-data/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/explore-our-data/revisions/c24bb51d5217?raw)
