---
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

---

[API](https://skmtc.dev/office-of-national-statistics/apis/dataset-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/dataset-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/dataset-api/revisions/a2947a13d675?raw)
