---
title: "Send CI job logs"
method: POST
path: "/api/v2/cilogs"
tags: ["CI Visibility Logs"]
---

# Send CI job logs

`POST /api/v2/cilogs`

## Request

- Base URL: `https://http-intake.logs.datadoghq.com`
- URL: `https://http-intake.logs.datadoghq.com/api/v2/cilogs`
- Auth: API key in header `DD-API-KEY`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/cilogs/post.ts> (a function with typed inputs; its response is checked against the schema)

Send log lines for a CI job over HTTP. See the [CI Visibility Pipelines
API](https://docs.datadoghq.com/api/latest/ci-visibility-pipelines/send-pipeline-event/) for submitting the
associated pipeline and job events.

A request can contain one log object or an array of up to 1,000 log objects. The maximum uncompressed request
body size is 5.1 MiB.

You can stream log lines while a CI job runs or send them after it finishes. After you submit the completed job
event, 20 seconds without a new log line marks the job's logs as complete. Lines sent after that may not appear.

A job can have up to 128 additional attributes and 256 tags. Additional attributes are top-level fields with
string, number, Boolean, or null values. Nested objects and arrays are rejected. Additional attributes and
`ddtags` apply to all log lines in the job. If an additional attribute has different values on different lines,
the first value received is used. Tags supplied on different lines are combined. A job can contain up to
2,000,000 log records or 1 GiB of message bytes in total.

To reduce request size, send gzip-compressed JSON with the `Content-Encoding: gzip` header. Retry requests after
a 408, 429, 500, or 503 response.

## Headers

- `Content-Encoding` 'identity' | 'gzip': HTTP header used to compress the JSON request body.

## Request body

- CILogItem[]: A batch of up to 1,000 CI job log lines. Use a one-item array to send one log line.
  - `ddtags` string: Comma-separated `key:value` tags. A job can have up to 256 tags, including repeated keys.
  - `job_id` string, required: The job event's `resource.id`, sent through the CI Visibility pipeline API.
  - `line_number` integer: The line number in the job log. Use 0 or 1 for the first line.
  - `message` string, required: The non-empty log line message.
  - `pipeline_unique_id` string, required: The `resource.unique_id` of the pipeline event, which must also match the job event's `resource.pipeline_unique_id`.
  - `provider_name` string: The provider name sent with the pipeline event. It defaults to `custom` when omitted and, when provided, must be non-empty and cannot contain a comma.
  - `section_name` string: The provider-defined section containing this log line, used to display collapsible groups of lines in the CI job log view.
  - `status` string: The status of this log line. Any string is accepted. Datadog maps non-empty values to a standard log status. See [status mapping](https://docs.datadoghq.com/logs/log_configuration/processors/log_status_remapper/).
  - `timestamp` string, date-time: The log line time in RFC 3339 format with an explicit timezone. If omitted, the intake time is used. It can be at most 18 hours in the past or 12 hours in the future.

## Response `202`

Request accepted for processing

- object

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `408`: Request Timeout
- `413`: Payload Too Large
- `429`: Too Many Requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
