Credentials

Operations related to Credentials

Create Credential

Creates a new Credential.

• When called, this endpoint may generate the Warehouse Credential Created event in the audit trail.

This endpoint requires the user to have at least the following permission(s):

  • Workspace Owner
  • Warehouse Admin
  • Source Admin
  • Entities Admin
  • Unify and Engage Admin
Securitytoken
Request
Request Body schema:
required
name
required
string (name)

A human-readable name for this Credential.

required
object (settings)

A key-value object that contains type-specific settings for this Credential.

settings.type is required and determines the Credential type (for example Snowflake or Redshift). Different types require different settings; see the settings.type discriminator in the OpenAPI spec for the full set of required and optional fields per type.

Responses
201

Created

404

Resource not found

422

Validation failure

429

Too many requests

post/credentials
Request samples
{
  • "name": "Production Snowflake",
  • "settings": {
    }
}
Response samples
{
  • "data": {
    }
}

List Credentials

Returns a list of Credentials.

This endpoint requires the user to have at least the following permission(s):

  • Workspace Owner
  • Warehouse Admin
  • Source Admin
  • Entities Admin
  • Unify and Engage Admin
Securitytoken
Request
query Parameters
object (PaginationInput)

Defines the pagination parameters.

This parameter exists in v1.

Example: pagination=pagination.count=2
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/credentials
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.credentials.listCredentials())
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}

Delete Credential

Deletes an existing Credential. Fails with a 409 Conflict if the Credential is still in use by a Warehouse or Source (including a disabled one). This check isn't atomic with the delete — a Warehouse or Source that attaches to this Credential in between would be orphaned rather than blocking the delete.

• When called, this endpoint may generate the Warehouse Credential Deleted event in the audit trail.

This endpoint requires the user to have at least the following permission(s):

  • Workspace Owner
Securitytoken
Request
path Parameters
credentialId
required
string [ 1 .. 255 ]
Example: cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

delete/credentials/{credentialId}
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.credentials.deleteCredential('cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}

Get Credential

Returns a Credential by its id.

This endpoint requires the user to have at least the following permission(s):

  • Workspace Owner
  • Warehouse Admin
  • Source Admin
  • Entities Admin
  • Unify and Engage Admin
Securitytoken
Request
path Parameters
credentialId
required
string [ 1 .. 255 ]
Example: cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/credentials/{credentialId}
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.credentials.getCredential('cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}

Update Credential

Updates an existing Credential. All Warehouses using this Credential are affected immediately.

• When called, this endpoint may generate the Warehouse Credential Modified event in the audit trail.

This endpoint requires the user to have at least the following permission(s):

  • Workspace Owner
Securitytoken
Request
path Parameters
credentialId
required
string [ 1 .. 255 ]
Example: cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl
Request Body schema:
required
name
string (name)

An optional human-readable name to associate with this Credential.

object (settings)

A key-value object that contains type-specific settings for this Credential.

Supports partial updates — only the fields you want to change need to be provided. settings.type cannot be changed.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

patch/credentials/{credentialId}
Request samples
{
  • "name": "Updated Snowflake Prod",
  • "settings": {
    }
}
Response samples
{
  • "data": {
    }
}

List Credential Consumers

Returns the Warehouses and Sources that use a Credential.

This endpoint requires the user to have at least the following permission(s):

  • Workspace Owner
  • Warehouse Admin
  • Source Admin
  • Entities Admin
  • Unify and Engage Admin
Securitytoken
Request
path Parameters
credentialId
required
string [ 1 .. 255 ]
Example: cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl
query Parameters
object (PaginationInput)

Defines the pagination parameters for the list of Warehouses.

This parameter exists in v1.

object (PaginationInput)

Defines the pagination parameters for the list of Sources.

This parameter exists in v1.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/credentials/{credentialId}/consumers
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.credentials.listCredentialConsumers('cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}