GET
/
v2
/
integrations
/
log-drains
import { Vercel } from "@vercel/sdk";

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

async function run() {
  const result = await vercel.logDrains.getIntegrationLogDrains({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  // Handle the result
  console.log(result);
}

run();
[
  {
    "clientId": "oac_xRhY4LAB7yLhUADD69EvV7ct",
    "configurationId": "icfg_cuwj0AdCdH3BwWT4LPijCC7t",
    "createdAt": 1558531915505,
    "id": "ld_nBuA7zCID8g4QZ8g",
    "deliveryFormat": "json",
    "name": "My first log drain",
    "ownerId": "kr1PsOIzqEL5Xg6M4VZcZosf",
    "projectId": "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
    "projectIds": "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
    "url": "https://example.com/log-drain",
    "sources": [
      "build",
      "edge"
    ],
    "createdFrom": "integration",
    "headers": "{\"Authorization\": \"Bearer 123\"}",
    "environments": [
      "production"
    ],
    "branch": "feature/*",
    "samplingRate": 0.5
  }
]

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"

Response

200
application/json
A list of log drains
createdAt
number
required

A timestamp that tells you when the log drain was created

Example:

1558531915505

id
string
required

The unique identifier of the log drain. Always prefixed with ld_

Example:

"ld_nBuA7zCID8g4QZ8g"

name
string
required

The name of the log drain

Example:

"My first log drain"

ownerId
string
required

The identifier of the team or user whose events will trigger the log drain

Example:

"kr1PsOIzqEL5Xg6M4VZcZosf"

url
string
required

The URL to call when logs are generated

Example:

"https://example.com/log-drain"

environments
enum<string>[]
required

The environment of log drain

The environment of log drain

Available options:
production,
preview
Example:
["production"]
clientId
string

The oauth2 client application id that created this log drain

Example:

"oac_xRhY4LAB7yLhUADD69EvV7ct"

configurationId
string

The client configuration this log drain was created with

Example:

"icfg_cuwj0AdCdH3BwWT4LPijCC7t"

deliveryFormat
enum<string>

The delivery log format

Available options:
json,
ndjson,
syslog,
protobuf
Example:

"json"

projectId
string | null
Example:

"AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb"

projectIds
string[]

The identifier of the projects this log drain is associated with

Example:

"AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb"

sources
enum<string>[]

The sources from which logs are currently being delivered to this log drain.

The sources from which logs are currently being delivered to this log drain.

Available options:
build,
edge,
lambda,
static,
external,
firewall
Example:
["build", "edge"]
createdFrom
enum<string>

Whether the log drain was created by an integration or by a user

Available options:
self-served,
integration
Example:

"integration"

headers
object

The headers to send with the request

Example:

"{\"Authorization\": \"Bearer 123\"}"

branch
string

The branch regexp of log drain

Example:

"feature/*"

samplingRate
number

The sampling rate of log drain

Example:

0.5