---
title: "Send events to a REST connection."
method: POST
path: "/connections/{id}/events"
tags: ["Connection Operations"]
---

# Send events to a REST connection.

`POST /connections/{id}/events`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/connections/{id}/events`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://auth.decodable.co/authorize?audience=https://api.decodable.co/`
    - Token URL: `https://auth.decodable.co/oauth/token` scopes: `write:stream`
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/connections/:id/events/post.ts> (a function with typed inputs; its response is checked against the schema)

Given a well-formatted payload, write given events to the output stream attached to this connection.
Note that the `id` specified must correspond to a connection configured with the `rest` connector
type, otherwise an HTTP 409 error will be returned.

Requires permission matching: `stream:write:default.<name>`, where `name` is of this connection's output stream.

## Path parameters

- `id` string, required

## Request body

- RestEvents: Events schema for the REST connector
  - `events` object[], required: The events to be sent, formatted to the connection schema

## Response `202`

A post events response

- object
  - `count` integer: number of written events

## Other responses

- `400`: An invalid request was received.
- `403`: Access denied: requesting user lacks a required permission.
- `404`: The requested resource does not exist.
- `409`: A resource conflict has been detected.
- `429`: Too many requests have been sent in a given amount of time
- `default`: An error has occurred.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
