Live Plugins

Operations related to Live Plugins

Create Live Plugin

Creates or updates a Live Plugin for your Source with given code.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

• In order to successfully call this endpoint, the specified Workspace needs to have the Live Plugins feature enabled. Please reach out to your customer success manager for more information.

Securitytoken
Request
path Parameters
sourceId
required
string [ 1 .. 255 ]
Example: qQEHquLrjRDN9j1ByrChyn
Request Body schema: application/vnd.segment.v1alpha+json
required
code
required
string (code)

The Live Plugin code to be uploaded.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

post/sources/{sourceId}/live-plugins/create
Request samples
application/vnd.segment.v1alpha+json
{
  • "code": "console.log('Hello, World!');"
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

Delete Live Plugin Code

Delete the Live Plugin code for a Source. This will not disable Live Plugins for the Source, but will remove any existing code.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

• In order to successfully call this endpoint, the specified Workspace needs to have the Live Plugins feature enabled. Please reach out to your customer success manager for more information.

Securitytoken
Request
path Parameters
sourceId
required
string [ 1 .. 255 ]
Example: qQEHquLrjRDN9j1ByrChyn
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

delete/sources/{sourceId}/live-plugins/delete-code
Request samples
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript'

const api = configureApis('/* Insert your Public API token here */')

try {
  const result = await unwrap(api.livePlugins.deleteLivePluginCode('qQEHquLrjRDN9j1ByrChyn'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

Get Latest from Live Plugins

Get the latest Live Plugins for your Source.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

• In order to successfully call this endpoint, the specified Workspace needs to have the Live Plugins feature enabled. Please reach out to your customer success manager for more information.

Securitytoken
Request
path Parameters
sourceId
required
string [ 1 .. 255 ]
Example: qQEHquLrjRDN9j1ByrChyn
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/sources/{sourceId}/live-plugins/latest
Request samples
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript'

const api = configureApis('/* Insert your Public API token here */')

try {
  const result = await unwrap(api.livePlugins.getLatestFromLivePlugins('qQEHquLrjRDN9j1ByrChyn'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{}