---
title: "Creates a new Integration Log Drain (deprecated)"
method: POST
path: "/v2/integrations/log-drains"
tags: ["logDrains"]
---

# Creates a new Integration Log Drain (deprecated)

`POST /v2/integrations/log-drains`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v2/integrations/log-drains`
- Auth: HTTP bearer

Creates an Integration log drain. This endpoint must be called with an OAuth2 client (integration), since log drains are tied to integrations. If it is called with a different token type it will produce a 400 error.

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `name` string, required: The name of the log drain
  - `projectIds` string[]
  - `secret` string: A secret to sign log drain notification headers so a consumer can verify their authenticity
  - `deliveryFormat` 'json' | 'ndjson': The delivery log format
  - `url` string, uri, required: The url where you will receive logs. The protocol must be `https://` or `http://` when type is `json` and `ndjson`.
  - `sources` string[]
  - `headers` object: Headers to be sent together with the request
  - `environments` string[]

## Response `200`

The log drain was successfully created

- object
  - `branch` string: The branch regexp of log drain
  - `clientId` string: The oauth2 client application id that created this log drain
  - `configurationId` string: The client configuration this log drain was created with
  - `createdAt` number, required: A timestamp that tells you when the log drain was created
  - `createdFrom` 'integration' | 'self-served': Whether the log drain was created by an integration or by a user
  - `deliveryFormat` 'json' | 'ndjson' | 'protobuf': The delivery log format
  - `environments` string[]: The environment of log drain
  - `headers` object: The headers to send with the request
  - `id` string, required: The unique identifier of the log drain. Always prefixed with `ld_`
  - `name` string, required: The name of the log drain
  - `ownerId` string, required: The identifier of the team or user whose events will trigger the log drain
  - `projectId` string, nullable
  - `projectIds` string[]: The identifier of the projects this log drain is associated with
  - `samplingRate` number: The sampling rate of log drain
  - `source` union, required
    - object
      - `defaultFor` 'eve-tracing': Informational marker for a system-owned default drain.
      - `kind` 'self-served', required
    - object
      - `externalResourceId` string
      - `integrationConfigurationId` string, required
      - `integrationId` string, required
      - `kind` 'integration', required
      - `resourceId` string
  - `sources` string[]: The sources from which logs are currently being delivered to this log drain.
  - `url` string, required: The URL to call when logs are generated

## Other responses

- `400`: One of the provided values in the request body is invalid. The provided token is not from an OAuth2 Client
- `401`: The request is not authorized.
- `403`: You do not have permission to access this resource.
- `404`
- `410`

## Changes

- **2026-09-30** `099fbe1f521c`: 1 info
  - added the non-success response with the status `404`
- **2026-09-22** `0f7ea3d3b39b`: 1 info
  - added the optional property `source/oneOf[subschema #1]/defaultFor` to the response with the `200` status
- **2026-07-21** `2ae10ee9d21c`: 1 info
  - added the non-success response with the status `410`
- **2026-01-22** `c12186034433`: 1 breaking
  - request body became required
- **2025-11-28** `45991e5c8b6d`: 1 warning, 1 info
  - added the new `redirect` enum value to the `sources/items/` response property for the response status `200`
  - removed the `syslog` enum value from the `deliveryFormat` response property for the response status `200`

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v2/integrations/log-drains/post.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
