---
title: creates-a-configurable-log-drain-deprecated
product: vercel
url: /docs/rest-api/logdrains/creates-a-configurable-log-drain-deprecated
canonical_url: "https://vercel.com/docs/rest-api/logdrains/creates-a-configurable-log-drain-deprecated"
last_updated: 2026-08-18
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about creates-a-configurable-log-drain-deprecated on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Creates a Configurable Log Drain (deprecated)

```http
POST /v1/log-drains
```

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

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Request body

Required: Yes

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "deliveryFormat",
    "url",
    "sources"
  ],
  "properties": {
    "deliveryFormat": {
      "description": "The delivery log format",
      "enum": [
        "json",
        "ndjson"
      ]
    },
    "url": {
      "type": "string",
      "description": "The log drain url",
      "format": "uri",
      "pattern": "^(http|https)?://"
    },
    "headers": {
      "type": "object",
      "description": "Headers to be sent together with the request",
      "additionalProperties": {
        "type": "string"
      }
    },
    "projectIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-zA-z0-9_]+$"
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "static",
          "lambda",
          "build",
          "edge",
          "external",
          "firewall"
        ]
      }
    },
    "environments": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "preview",
          "production"
        ]
      }
    },
    "secret": {
      "type": "string",
      "description": "Custom secret of log drain"
    },
    "samplingRate": {
      "type": "number",
      "description": "The sampling rate for this log drain. It should be a percentage rate between 0 and 100. With max 2 decimal points",
      "minimum": 0.01,
      "maximum": 1
    },
    "name": {
      "type": "string",
      "description": "The custom name of this log drain."
    }
  }
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object"
}
```

### 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.

### 410: No description

---

## Related

- [logDrains endpoints](/docs/rest-api#logdrains)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://openapi.vercel.sh/) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)
