---
title: "Ingest JSON"
method: POST
path: "/datahub/v1/events"
tags: ["DataHub"]
---

# Ingest JSON

`POST /datahub/v1/events`

Sends a batch of events to DataHub.

## Request body

- object
  - `events` object[]
    - `provider` string, required — The identifier of the data provider. Allowed characters: alphanumeric (0-9,a-z,A-Z), underscore (_), space, dash (-).
    - `id` string — The event id. Must be unique within the dataset. If not set, a UUIDv4 will be generated at ingestion time.
    - `dimensions` object[]
      - `key` string — If the type is `fixed`, the key must be a valid fixed value. See the [DataHub API Guide](https://developer.doit.com/docs/datahub-api) for more information.
      - `type` 'fixed' | 'label' | 'project_label' | 'system_label' — The dimension type.
      - `value` union
        - string
        - boolean
    - `time` string, date-time, required — The timestamp of the event in RFC3339 format.
    - `metrics` object[]
      - `value` number, double — The value of the metric.
      - `type` string — The type of the metric. If you choose "cost" or "usage", it will map to the basic "Cost" or "Usage" metric in Cloud Analytics reports. You can also use this field to define custom metric types, such as "working_hours", "ride", etc.

## Response `201`

OK - Ingestion succeeded.

- object
  - `message` string

## Other responses

- `400` — Bad Request - The server cannot process the request, often due to a malformed request.
- `401` — Unauthorized - Invalid API key.
- `403` — Forbidden - The client is not authorized to perform the request.
- `500` — Internal Server Error - Something went wrong with the DoiT API server.

---

[API](https://skmtc.net/doit/apis/doit-cloud-intelligence.md) · [All operations](https://skmtc.net/doit/apis/doit-cloud-intelligence/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/doit/doit-cloud-intelligence/versions/9416402fc119/schema)
