Weavz

Connections

Manage integration connections and credentials.

Connections

Connections store authentication credentials for third-party integrations. Each connection is tied to a specific integration (e.g., Slack, Gmail) and can be scoped to an organization, workspace, or individual user.

List Connections

GET/api/v1/connections

List all connections in your organization, or fetch a single connection by ID.

Query Parameters

FieldTypeRequiredDescription
idstring (uuid)NoFetch a specific connection by ID
limitintegerNoNumber of connections to return, default 50, max 100
offsetintegerNoNumber of connections to skip for pagination
includeSuspendedbooleanNoInclude suspended connections. Defaults to false

Response (list)

json
{
  "connections": [
    {
      "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab",
      "externalId": "slack-main",
      "displayName": "Slack (Main Workspace)",
      "integrationName": "slack",
      "authMethodKey": "oauth2",
      "type": "PLATFORM_OAUTH2",
      "status": "ACTIVE",
      "scope": "ORGANIZATION",
      "workspaceId": null,
      "endUserId": null,
      "createdAt": "2025-01-15T10:30:00.000Z",
      "updatedAt": "2025-01-15T10:30:00.000Z"
    }
  ],
  "total": 1
}

Response (single, with ?id=...)

json
{
  "connection": {
    "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab",
    "externalId": "slack-main",
    "displayName": "Slack (Main Workspace)",
    "integrationName": "slack",
    "authMethodKey": "oauth2",
    "type": "PLATFORM_OAUTH2",
    "status": "ACTIVE",
    "scope": "ORGANIZATION",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T10:30:00.000Z"
  }
}

Example

bash
curl https://platform.weavz.io/api/v1/connections \
  -H "Authorization: Bearer wvz_your_api_key"

Create Connection

POST/api/v1/connections

Create a new connection with stored credentials.

Request Body

FieldTypeRequiredDescription
typestringYesOne of: SECRET_TEXT, BASIC_AUTH, CUSTOM_AUTH, OAUTH2, PLATFORM_OAUTH2
externalIdstringYesCustomer-defined connection.externalId selector
displayNamestringYesHuman-readable name
integrationNamestringYesIntegration name (e.g., slack, gmail)
authMethodKeystringConditionalAuth method key for this credential. Required when an integration exposes multiple compatible auth methods; defaults from type for single-auth integrations.
workspaceIdstring (uuid)NoAssociate with a workspace
endUserIdstringNoThe end user's externalId for per-user connection resolution
scopestringNoORGANIZATION, WORKSPACE, or USER. Defaults to ORGANIZATION. Use WORKSPACE for shared workspace credentials and USER with workspaceId plus endUserId for per-user credentials.
oauthAppIdstring (uuid)NoTenant-owned custom OAuth app UUID for OAuth-backed connections. Omit to use the Weavz-managed OAuth app.

When endUserId and workspaceId are provided, endUserId is your user's externalId; Weavz creates or resolves the matching end-user record before storing the connection.

authMethodKey is part of the credential identity. The same integrationName and externalId can have separate credentials for different auth methods, such as api_key and oauth2.

Type-Specific Fields

For SECRET_TEXT:

FieldTypeRequiredDescription
secretTextstringYesThe secret value (API key, token, etc.)

For BASIC_AUTH:

FieldTypeRequiredDescription
usernamestringYesUsername
passwordstringYesPassword

For CUSTOM_AUTH:

FieldTypeRequiredDescription
propsobjectYesCustom authentication properties

For OAUTH2 / PLATFORM_OAUTH2:

FieldTypeRequiredDescription
accessTokenstringYesOAuth access token
refreshTokenstringNoOAuth refresh token
tokenTypestringNoToken type (e.g., Bearer)
expiresInintegerNoToken expiry in seconds
scope_oauthstringNoOAuth scopes granted
dataobjectNoAdditional OAuth data. Defaults to {}

For OAuth connection types, tokenType defaults to Bearer when omitted.

Response (201)

json
{
  "connection": {
    "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab",
    "externalId": "openai-prod",
    "displayName": "OpenAI Production",
    "integrationName": "openai",
    "authMethodKey": "api_key",
    "type": "SECRET_TEXT",
    "status": "ACTIVE",
    "scope": "ORGANIZATION",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T10:30:00.000Z"
  }
}

Example

bash
curl -X POST https://platform.weavz.io/api/v1/connections \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "SECRET_TEXT",
    "externalId": "openai-prod",
    "displayName": "OpenAI Production",
    "integrationName": "openai",
    "authMethodKey": "api_key",
    "secretText": "sk-..."
  }'

Errors

StatusCodeDescription
400VALIDATION_ERRORMissing or invalid fields
403QUOTA_EXCEEDEDConnection limit reached
409DUPLICATEConnection with this externalId already exists

Delete Connection

DELETE/api/v1/connections/:id

Delete a connection.

Path Parameters

FieldTypeDescription
idstring (uuid)Connection ID

Response

json
{
  "deleted": true,
  "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
}

Example

bash
curl -X DELETE https://platform.weavz.io/api/v1/connections/c1d2e3f4-5678-90ab-cdef-1234567890ab \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDConnection not found

Resolve Connection

POST/api/v1/connections/resolve

Find a connection by integration name and optional scoping parameters. This is useful when you know the integration and external ID but not the connection's internal UUID.

Request Body

FieldTypeRequiredDescription
integrationNamestringYesIntegration name
externalIdstringNoconnection.externalId to resolve
workspaceIdstring (uuid)YesWorkspace scope
authMethodKeystringNoAuth method key to disambiguate multiple credentials for the same integration and external ID
endUserIdstringNoThe end user's externalId for per-user connection resolution

Response

json
{
  "connection": {
    "id": "c1d2e3f4-5678-90ab-cdef-1234567890ab",
    "externalId": "slack-main",
    "displayName": "Slack (Main Workspace)",
    "integrationName": "slack",
    "type": "PLATFORM_OAUTH2",
    "status": "ACTIVE",
    "scope": "ORGANIZATION",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T10:30:00.000Z"
  }
}

Example

bash
curl -X POST https://platform.weavz.io/api/v1/connections/resolve \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "slack",
    "externalId": "slack-main",
    "workspaceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }'

Errors

StatusCodeDescription
400VALIDATION_ERRORMissing integration name
404CONNECTION_NOT_FOUNDNo matching connection found