post/v1/log-drains

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

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v1/log-drains?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"deliveryFormat": "json",
4
"sources": "SOME_ARRAY OF STRING_VALUE",
5
"url": "SOME_STRING_VALUE",
6
"environments": "SOME_ARRAY OF STRING_VALUE",
7
"headers": "SOME_OBJECT_VALUE",
8
"name": "SOME_STRING_VALUE",
9
"projectIds": "SOME_ARRAY OF STRING_VALUE",
10
"samplingRate": "SOME_NUMBER_VALUE",
11
"secret": "SOME_STRING_VALUE"
12
},
13
"headers": {
14
"Authorization": "Bearer <TOKEN>"
15
},
16
"method": "post"
17
})
Query Params
Body Params
Query ParameterDescription

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • clientIdstring
  • configurationIdstring
  • createdAtnumberRequired
  • createdFromstring
    One of: self-served
  • deletedAtnumber or nullRequired
  • deliveryFormatstringRequired
    One of: json | ndjson | syslog
  • disabledAtnumber
  • disabledBystring
  • disabledReasonstring
    One of: disabled-by-owner | feature-not-available | account-plan-downgrade | disabled-by-admin
  • environmentsarrayRequired
  • firstErrorTimestampnumber
  • headersobject
  • hideIpAddressesboolean
  • idstringRequired
  • namestringRequired
  • ownerIdstringRequired
  • projectIdsarray
  • samplingRatenumber
  • secretstring
    The secret to validate the log-drain payload
  • sourcesarray
  • statusstring
    One of: enabled | disabled | errored
  • teamIdstring or null
  • updatedAtnumberRequired
  • urlstringRequired
CodeDescription
200
400One of the provided values in the request body is invalid.
401
403You do not have permission to access this resource.
post/v2/integrations/log-drains

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.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/integrations/log-drains?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"name": "My first log drain",
4
"url": "https://example.com/log-drain",
5
"deliveryFormat": "json",
6
"environments": "SOME_ARRAY OF STRING_VALUE",
7
"headers": "SOME_OBJECT_VALUE",
8
"projectIds": "SOME_ARRAY OF STRING_VALUE",
9
"secret": "a1Xsfd325fXcs",
10
"sources": "SOME_ARRAY OF STRING_VALUE"
11
},
12
"headers": {
13
"Authorization": "Bearer <TOKEN>"
14
},
15
"method": "post"
16
})
Query Params
Body Params
Query ParameterDescription

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • branchstring
    The branch regexp of log drain

    Example: feature/*

  • clientIdstring
    The oauth2 client application id that created this log drain

    Example: oac_xRhY4LAB7yLhUADD69EvV7ct

  • configurationIdstring
    The client configuration this log drain was created with

    Example: icfg_cuwj0AdCdH3BwWT4LPijCC7t

  • createdAtnumberRequired
    A timestamp that tells you when the log drain was created

    Example: 1558531915505

  • createdFromstring
    One of: self-served | integration
    Whether the log drain was created by an integration or by a user

    Example: integration

  • deliveryFormatstring
    One of: json | ndjson | syslog
    The delivery log format

    Example: json

  • environmentsarrayRequired
    The environment of log drain

    Example: ["production"]

  • headersobject
    The headers to send with the request

    Example: {"Authorization": "Bearer 123"}

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

    Example: ld_nBuA7zCID8g4QZ8g

  • namestringRequired
    The name of the log drain

    Example: My first log drain

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

    Example: kr1PsOIzqEL5Xg6M4VZcZosf

  • projectIdstring or null

    Example: AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb

  • projectIdsarray
    The identifier of the projects this log drain is associated with

    Example: AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb

  • samplingRatenumber
    The sampling rate of log drain

    Example: 0.5

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

    Example: ["build","edge"]

  • urlstringRequired
    The URL to call when logs are generated

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

CodeDescription
200The log drain was successfully created
400
  • One of the provided values in the request body is invalid.

  • The provided token is not from an OAuth2 Client

401
403You do not have permission to access this resource.
delete/v1/log-drains/{id}

Deletes a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be deleted.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v1/log-drains/SOME_STRING_VALUE?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "delete"
6
})
Path Params
Query Params
Path ParameterDescription

id

string

required
N/A
CodeDescription
204
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
delete/v1/integrations/log-drains/{id}

Deletes the Integration log drain with the provided id. When using an OAuth2 Token, the log drain can be deleted only if the integration owns it.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v1/integrations/log-drains/SOME_STRING_VALUE?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "delete"
6
})
Path Params
Query Params
Path ParameterDescription

id

string

required
ID of the log drain to be deleted
The log drain was successfully deleted
CodeDescription
204The log drain was successfully deleted
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404The log drain was not found
get/v1/log-drains

Retrieves a list of all the Log Drains owned by the account. This endpoint must be called with an account AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated account can be accessed.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v1/log-drains?projectId=SOME_STRING_VALUE&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Query Params
Query ParameterDescription

projectId

string

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • array
  • Array
CodeDescription
200
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
get/v1/log-drains/{id}

Retrieves a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be accessed.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v1/log-drains/SOME_STRING_VALUE?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

id

string

required
  • clientIdstring
  • configurationIdstring
  • createdAtnumberRequired
  • createdFromstring
    One of: self-served
  • deletedAtnumber or nullRequired
  • deliveryFormatstringRequired
    One of: json | ndjson | syslog
  • disabledAtnumber
  • disabledBystring
  • disabledReasonstring
    One of: disabled-by-owner | feature-not-available | account-plan-downgrade | disabled-by-admin
  • environmentsarrayRequired
  • firstErrorTimestampnumber
  • headersobject
  • hideIpAddressesboolean
  • idstringRequired
  • namestringRequired
  • ownerIdstringRequired
  • projectIdsarray
  • samplingRatenumber
  • secretstringRequired
  • sourcesarray
  • statusstring
    One of: enabled | disabled | errored
  • teamIdstring or null
  • updatedAtnumberRequired
  • urlstringRequired
CodeDescription
200
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
get/v2/integrations/log-drains

Retrieves a list of all Integration log drains that are defined for the authenticated user or team. When using an OAuth2 token, the list is limited to log drains created by the authenticated integration.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/integrations/log-drains?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Query Params
Query ParameterDescription

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • array
  • Array
CodeDescription
200A list of log drains
400
401
403You do not have permission to access this resource.
Last updated on October 30, 2024