v13

OpenAPI 3.0.32026-07-31359869.4 MB
logDrains

Creates a new Integration Log Drain (deprecated)

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.

post/v2/integrations/log-drains

Query parameters

teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l

The Team identifier to perform the request on behalf of.

slugstring
Example:my-team-url-slug

The Team slug to perform the request on behalf of.

Request body

namestring required

The name of the log drain

projectIdsstring[]
secretstring

A secret to sign log drain notification headers so a consumer can verify their authenticity

deliveryFormat'json' | 'ndjson'

The delivery log format

urlstring uri required

The url where you will receive logs. The protocol must be https:// or http:// when type is json and ndjson.

sourcesstring[]
headersobject

Headers to be sent together with the request

environmentsstring[]

Example request

{
  "name": "My first log drain",
  "secret": "a1Xsfd325fXcs",
  "deliveryFormat": "json",
  "url": "https://example.com/log-drain"
}

Response

The log drain was successfully created

clientIdstring

The oauth2 client application id that created this log drain

configurationIdstring

The client configuration this log drain was created with

createdAtnumber required

A timestamp that tells you when the log drain was created

idstring required

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

deliveryFormat'json' | 'ndjson' | 'protobuf'

The delivery log format

namestring required

The name of the log drain

ownerIdstring required

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

projectIdstring nullable
projectIdsstring[]

The identifier of the projects this log drain is associated with

urlstring required

The URL to call when logs are generated

sourcesstring[]

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

createdFrom'integration' | 'self-served'

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

headersobject

The headers to send with the request

environmentsstring[]

The environment of log drain

branchstring

The branch regexp of log drain

samplingRatenumber

The sampling rate of log drain

Example response

{
  "clientId": "oac_xRhY4LAB7yLhUADD69EvV7ct",
  "configurationId": "icfg_3bwCLgxL8qt5kjRLcv2Dit7F",
  "createdAt": 1558531915505,
  "id": "ld_nBuA7zCID8g4QZ8g",
  "deliveryFormat": "json",
  "name": "My first log drain",
  "ownerId": "kr1PsOIzqEL5Xg6M4VZcZosf",
  "projectId": "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
  "url": "https://example.com/log-drain",
  "sources": [
    "build",
    "edge"
  ],
  "createdFrom": "integration",
  "environments": [
    "production"
  ],
  "branch": "feature/*",
  "samplingRate": 0.5
}