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):
Created
Resource not found
Validation failure
Too many requests
{- "name": "Production Snowflake",
- "settings": {
- "type": "Snowflake",
- "username": "prod_user",
- "account": "xy12345.us-east-1",
- "warehouse": "COMPUTE_WH",
- "database": "ANALYTICS_DB",
- "authentication": {
- "type": "keypair",
- "privateKey": "<privateKey>",
- "privateKeyPassphrase": "<privateKeyPassphrase>"
}
}
}{- "data": {
- "credential": {
- "id": "cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl",
- "workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
- "name": "Production Snowflake",
- "settings": {
- "type": "Snowflake",
- "username": "prod_user",
- "account": "xy12345.us-east-1",
- "warehouse": "COMPUTE_WH",
- "database": "ANALYTICS_DB",
- "authentication": {
- "type": "keypair",
- "privateKey": "<redacted>",
- "privateKeyPassphrase": "<redacted>"
}
}, - "createdAt": "2006-01-02T15:04:05.000Z",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}
}
}Returns a list of Credentials.
This endpoint requires the user to have at least the following permission(s):
object (PaginationInput) Defines the pagination parameters. This parameter exists in v1. Example: pagination=pagination.count=2 |
OK
Resource not found
Validation failure
Too many requests
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) }
{- "data": {
- "credentials": [
- {
- "id": "cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl",
- "workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
- "name": "Production Snowflake",
- "settings": {
- "type": "Snowflake",
- "username": "prod_user",
- "account": "xy12345.us-east-1",
- "warehouse": "COMPUTE_WH",
- "database": "ANALYTICS_DB",
- "authentication": {
- "type": "keypair",
- "privateKey": "<redacted>",
- "privateKeyPassphrase": "<redacted>"
}
}, - "createdAt": "2006-01-02T15:04:05.000Z",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}
], - "pagination": {
- "current": "MA==",
- "totalEntries": 1
}
}
}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):
OK
Resource not found
Validation failure
Too many requests
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) }
{- "data": {
- "status": "SUCCESS"
}
}Returns a Credential by its id.
This endpoint requires the user to have at least the following permission(s):
OK
Resource not found
Validation failure
Too many requests
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) }
{- "data": {
- "credential": {
- "id": "cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl",
- "workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
- "name": "Production Snowflake",
- "settings": {
- "type": "Snowflake",
- "username": "prod_user",
- "account": "xy12345.us-east-1",
- "warehouse": "COMPUTE_WH",
- "database": "ANALYTICS_DB",
- "authentication": {
- "type": "keypair",
- "privateKey": "<redacted>",
- "privateKeyPassphrase": "<redacted>"
}
}, - "createdAt": "2006-01-02T15:04:05.000Z",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}
}
}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):
OK
Resource not found
Validation failure
Too many requests
{- "name": "Updated Snowflake Prod",
- "settings": {
- "username": "new_prod_user",
- "authentication": {
- "type": "keypair",
- "privateKey": "<newPrivateKey>",
- "privateKeyPassphrase": "<newPrivateKeyPassphrase>"
}
}
}{- "data": {
- "credential": {
- "id": "cred_2JzKWb8FGhGVYZ3xVqQGc7NkYPl",
- "workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
- "name": "Updated Snowflake Prod",
- "settings": {
- "type": "Snowflake",
- "username": "new_prod_user",
- "account": "xy12345.us-east-1",
- "warehouse": "COMPUTE_WH",
- "database": "ANALYTICS_DB",
- "authentication": {
- "type": "keypair",
- "privateKey": "<redacted>",
- "privateKeyPassphrase": "<redacted>"
}
}, - "createdAt": "2006-01-02T15:04:05.000Z",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}
}
}Returns the Warehouses and Sources that use a Credential.
This endpoint requires the user to have at least the following permission(s):
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. |
OK
Resource not found
Validation failure
Too many requests
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) }
{- "data": {
- "warehouses": [ ],
- "warehousesPagination": {
- "current": "MA==",
- "totalEntries": 0
}, - "sources": [ ],
- "sourcesPagination": {
- "current": "MA==",
- "totalEntries": 0
}
}
}