---
title: "Creates a Configurable Log Drain (deprecated)"
method: POST
path: "/v1/log-drains"
tags: ["logDrains"]
---

# Creates a Configurable Log Drain (deprecated)

`POST /v1/log-drains`

## Request

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

Creates a configurable log drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed)

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `deliveryFormat` 'json' | 'ndjson', required: The delivery log format
  - `url` string, uri, required: The log drain url
  - `headers` object: Headers to be sent together with the request
  - `projectIds` string[]
  - `sources` string[], required
  - `environments` string[]
  - `secret` string: Custom secret of log drain
  - `samplingRate` number: The sampling rate for this log drain. It should be a percentage rate between 0 and 100. With max 2 decimal points
  - `name` string: The custom name of this log drain.

## Response `200`

- object

## Other responses

- `400`: One of the provided values in the request body is invalid.
- `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-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 info
  - endpoint added
- **2025-04-22** `661a2f6357c1`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v1/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)
