Skip to main content
POST
/
v1
/
log-drains
createConfigurableLogDrain
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.logDrains.createConfigurableLogDrain({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {
      deliveryFormat: "json",
      url: "https://wavy-meander.net",
      sources: [],
    },
  });

  console.log(result);
}

run();
{}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Body

application/json
deliveryFormat
enum<string>
required

The delivery log format

Available options:
json,
ndjson
Example:

"json"

url
string<uri>
required

The log drain url

sources
enum<string>[]
required
Minimum length: 1
headers
object

Headers to be sent together with the request

projectIds
string[]
Required array length: 1 - 50 elements
environments
enum<string>[]
Minimum length: 1
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

Required range: 0.01 <= x <= 1Must be a multiple of 0.01
name
string

The custom name of this log drain.

Response

The response is of type object.

I