---
title: "Post an event"
method: POST
path: "/api/v1/events"
tags: ["Events"]
---

# Post an event

`POST /api/v1/events`

This endpoint allows you to post events to the stream.
Tag them, set priority and event aggregate them with other events.

## Request body

- EventCreateRequest — Object representing an event.
  - `aggregation_key` string — An arbitrary string to use for aggregation. Limited to 100 characters. If you specify a key, all events using that key are grouped together in the Event Stream.
  - `alert_type` 'error' | 'warning' | 'info' | 'success' | 'user_update' | 'recommendation' | 'snapshot' — If an alert event is enabled, set its type. For example, `error`, `warning`, `info`, `success`, `user_update`, `recommendation`, and `snapshot`.
  - `date_happened` integer — POSIX timestamp of the event. Must be sent as an integer (that is no quotes). Limited to events no older than 18 hours
  - `device_name` string — A device name.
  - `host` string — Host name to associate with the event. Any tags associated with the host are also applied to this event.
  - `priority` 'normal' | 'low', nullable — The priority of the event. For example, `normal` or `low`.
  - `related_event_id` integer — ID of the parent event. Must be sent as an integer (that is no quotes).
  - `source_type_name` string — The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
  - `tags` string[] — A list of tags to apply to the event.
  - `text` string, required — The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with `%%% \n` and end the text block with `\n %%%`. Use `msg_text` with the Datadog Ruby library.
  - `title` string, required — The event title.

## Response `202`

OK

- EventCreateResponse — Object containing an event response.
  - `event` Event — Object representing an event.
    - `alert_type` 'error' | 'warning' | 'info' | 'success' | 'user_update' | 'recommendation' | 'snapshot' — If an alert event is enabled, set its type. For example, `error`, `warning`, `info`, `success`, `user_update`, `recommendation`, and `snapshot`.
    - `date_happened` integer — POSIX timestamp of the event. Must be sent as an integer (that is no quotes). Limited to events up to 18 hours in the past and two hours in the future.
    - `device_name` string — A device name.
    - `host` string — Host name to associate with the event. Any tags associated with the host are also applied to this event.
    - `id` integer — Integer ID of the event.
    - `id_str` string — Handling IDs as large 64-bit numbers can cause loss of accuracy issues with some programming languages. Instead, use the string representation of the Event ID to avoid losing accuracy.
    - `payload` string — Payload of the event.
    - `priority` 'normal' | 'low', nullable — The priority of the event. For example, `normal` or `low`.
    - `source_type_name` string — The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. The list of standard source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
    - `tags` string[] — A list of tags to apply to the event.
    - `text` string — The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with `%%% \n` and end the text block with `\n %%%`. Use `msg_text` with the Datadog Ruby library.
    - `title` string — The event title.
    - `url` string — URL of the event.
  - `status` string — A status.

## Other responses

- `400` — Bad Request
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v1.md) · [All operations](https://skmtc.net/datadog/apis/api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v1/revisions/ca5871004d26/schema)
