---
title: "Create a custom event type."
method: POST
path: "/event_types"
tags: ["AI Assistants"]
---

# Create a custom event type.

`POST /event_types`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/event_types`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/event_types/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new custom event type that assistants can subscribe to and emit.

## Request body

- EventTypeCreateRequest
  - `name` string, required: Name of the custom event type (max 200 chars).
  - `description` string: Optional description (max 5000 chars).
  - `payload_schema` object: Optional JSON schema for event payloads.

## Response `201`

Successful operation

- EventType
  - `id` string, uuid
  - `name` string
  - `description` string
  - `payload_schema` object
  - `user_id` string, uuid
  - `subscriber_count` integer
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
