@contio/partner-sdk - v1.7.1
    Preparing search index...

    Class PartnerAdminClient

    Partner Admin API client for API key-authenticated admin endpoints.

    Provides access to partner app configuration, automations, webhook deliveries, user connections, credential management, and IdP configuration. Requires an API key for authentication.

    const { admin } = ContioPartnerSDK.forAdmin({
    apiKey: 'your-api-key'
    });

    const app = await admin.getApp();
    const automations = await admin.getAutomations();

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    axiosInstance: AxiosInstance
    config: ClientConfig

    Methods

    • Abstract method to add authentication headers. Can be async to support token refresh before requests.

      Parameters

      • config: InternalAxiosRequestConfig

      Returns InternalAxiosRequestConfig<any> | Promise<InternalAxiosRequestConfig<any>>

    • Create a new automation.

      Automations define automated actions triggered by events in Contio.

      Parameters

      • data: CreateAutomationRequest

        Automation creation data

        Request to create a new automation

        Example:

        const automation = await adminClient.createAutomation({
        name: 'Create CRM Contact',
        description: 'Create contacts from meeting action items',
        trigger_type: 'action_item_match',
        actions: [
        {
        type: 'phrase_match',
        config: {
        phrases: ['create contact', 'add contact', 'new contact']
        }
        }
        ]
        });
        • actions: AutomationAction[]

          Array of automation actions

        • Optionaldescription?: string
        • name: string
        • trigger_type: string

          Use 'action_item_match' for phrase-based matching

      Returns Promise<Automation>

      The newly created automation

      If validation fails

    • Create IdP configuration for this partner app.

      Configures SAML/OIDC identity provider settings for SSO.

      Parameters

      Returns Promise<PartnerIdPConfig>

      The created IdP configuration

      If configuration already exists or validation fails

      const config = await admin.createIdPConfig({
      provider_type: 'saml',
      metadata_url: 'https://idp.example.com/metadata',
      entity_id: 'https://idp.example.com'
      });
    • Delete a automation.

      Parameters

      • automationId: string

        The unique automation ID to delete

      Returns Promise<void>

      If the automation is not found

    • Delete the IdP configuration.

      Removes the SAML/OIDC configuration. Users will no longer be able to SSO through this partner's identity provider.

      Returns Promise<void>

      If no IdP configuration exists

    • Delete a template.

      Parameters

      • templateId: string

        The unique template ID to delete

      Returns Promise<void>

      If the template is not found

    • Delete a toolkit.

      Parameters

      • toolkitId: string

        The unique toolkit ID to delete

      Returns Promise<void>

      If the toolkit is not found

    • Discard a draft toolkit version.

      Permanently deletes a DRAFT version. Only draft versions can be discarded. This action is irreversible.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      • versionId: string

        The unique version ID (must be in DRAFT status)

      Returns Promise<void>

      400 if the version is not in DRAFT status

    • Export a portable manifest from selected entity IDs (assembly-mode).

      Builds a portable toolkit manifest from the given entity IDs. Dependencies (e.g. action buttons referenced by next steps) are auto-discovered.

      Parameters

      Returns Promise<ExportResponse>

      The portable manifest with metadata, summary, and optional warnings

      If no entities are specified or entities are not found

      const exported = await admin.exportEntities({
      template_ids: ['template-uuid'],
      name: 'My Exported Bundle',
      });
      console.log(exported.manifest);
    • Export an existing toolkit as a portable manifest.

      Resolves the toolkit's manifest into a portable format with $id/$ref identifiers, suitable for re-import into a different toolkit.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      Returns Promise<ExportResponse>

      The portable manifest with metadata, summary, and optional warnings

      If the toolkit is not found

      const exported = await admin.exportToolkit('toolkit-uuid');

      // Re-import into a new toolkit
      const newToolkit = await admin.createToolkit({
      name: 'Cloned Toolkit',
      slug: 'cloned-toolkit',
      version: '1.0.0',
      manifest: exported.manifest,
      });
    • Get partner app information.

      Returns the current configuration and status of your partner app.

      Returns Promise<PartnerApp>

      The partner app details including name, status, and configuration

      If the request fails

    • Get a specific automation by ID.

      Parameters

      • automationId: string

        The unique automation ID

      Returns Promise<Automation>

      The automation with full details

      If the automation is not found

    • Get audit history for credential operations

      Returns a log of all credential operations including rotations, access, and rollbacks. Useful for security monitoring and compliance.

      Parameters

      Returns Promise<CredentialAuditHistoryResponse>

      Audit events with pagination info

      // Get recent credential operations
      const history = await admin.getCredentialHistory({
      limit: 20,
      credential_type: 'api_key'
      });

      history.events.forEach(event => {
      console.log(`${event.created_at}: ${event.action} by ${event.initiated_by}`);
      if (event.reason) {
      console.log(` Reason: ${event.reason}`);
      }
      });

      // Check for rotations in the last 24 hours
      const recentRotations = history.events.filter(e =>
      e.action === 'rotated' &&
      new Date(e.created_at) > new Date(Date.now() - 24 * 60 * 60 * 1000)
      );
      console.log(`Rotations in last 24h: ${recentRotations.length}/3`);
    • Get status of all credentials (API key, webhook secret, client secret)

      Returns health information including age, last rotation, and recommended actions

      Returns Promise<CredentialStatusResponse>

      const status = await admin.getCredentialStatus();
      console.log('API key age:', status.api_key.age_days, 'days');
      console.log('Recommended action:', status.api_key.recommended_action);
    • Make a GET request that returns the full AxiosResponse, including headers and raw data.

      Use this for endpoints that return binary content (e.g. file downloads) where the caller needs access to response headers such as Content-Disposition or Content-Type.

      Parameters

      • path: string

        Request path relative to the client's base URL

      • Optionalparams: object

        Optional query parameters

      • Optionaloptions: RequestOptions

        Optional per-request options (e.g. timezone override)

      • responseType: "arraybuffer" | "blob" | "stream" = 'arraybuffer'

        Axios response type (default: 'arraybuffer')

      Returns Promise<AxiosResponse<any, any, {}>>

      The full axios response

    • Get a specific template by ID.

      Parameters

      • templateId: string

        The unique template ID

      Returns Promise<Template>

      The template with full details

      If the template is not found

    • Get a specific toolkit by ID.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      Returns Promise<Toolkit>

      The toolkit with full details including manifest

      If the toolkit is not found

    • Get a specific toolkit version by ID.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      • versionId: string

        The unique version ID

      Returns Promise<ToolkitVersion>

      The toolkit version with full details

      If the version is not found

    • Get a specific user connection.

      Parameters

      • connectionId: string

        The unique connection ID

      Returns Promise<UserConnection>

      The user connection with full details

      If the connection is not found

    • Get a paginated list of webhook deliveries.

      Use this to monitor webhook delivery status and troubleshoot failures.

      Parameters

      • Optionalparams: WebhookDeliveryListParams

        Optional filter and pagination parameters

        • Optionalevent_type?: string

          Filter by event type (e.g., meeting.created, automation.assignment.created)

        • Optionallimit?: number
        • Optionaloffset?: number
        • Optionalstatus?: string

          Filter by delivery status (pending, delivered, failed, abandoned)

      Returns Promise<WebhookDeliveryListResponse>

      Paginated list of webhook deliveries

      If the request fails

      // Get all failed deliveries for meeting.created events
      const deliveries = await admin.getWebhookDeliveries({
      status: 'failed',
      event_type: 'meeting.created',
      limit: 20
      });
    • Get a specific webhook delivery.

      Returns full details including request/response payloads for debugging.

      Parameters

      • deliveryId: string

        The unique delivery ID

      Returns Promise<WebhookDelivery>

      The webhook delivery with full details

      If the delivery is not found

    • List all versions for a toolkit.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      Returns Promise<ToolkitVersion[]>

      Array of all versions ordered by version number

      If the toolkit is not found

    Protectedpost

    • Make a POST request with multipart/form-data.

      Overrides the default application/json content type so that axios sets the correct multipart/form-data boundary automatically.

      Type Parameters

      • T

      Parameters

      • path: string

        Request path relative to the client's base URL

      • formData: FormData

        A FormData instance containing the fields and files to upload

      • Optionaloptions: RequestOptions

        Optional per-request options (e.g. timezone override)

      Returns Promise<T>

      Parsed response body

    • Publish a draft toolkit version.

      Transitions the version from DRAFT to PUBLISHED. Any previously published version is automatically deprecated. Optionally propagate to connected workspaces.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      • versionId: string

        The unique version ID (must be in DRAFT status)

      • Optionaldata: PublishToolkitVersionRequest

        Optional propagation settings

      Returns Promise<void>

      400 if the version is not in DRAFT status

    • Remove a next step from a template.

      Parameters

      • templateId: string

        The unique template ID

      • nextStepId: string

        The unique next step ID to remove

      Returns Promise<void>

      If the association is not found

    • Remove the webhook event filter for your partner app.

      After removing the filter, all supported webhook events will be eligible for delivery again.

      Returns Promise<PartnerApp>

      The updated partner app configuration

      If the request fails

      const app = await admin.removeWebhookFilter();
      console.log(app.webhook_filter); // null
    • Republish a deprecated toolkit version.

      Transitions the version from DEPRECATED back to PUBLISHED. Any currently published version is automatically deprecated.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      • versionId: string

        The unique version ID (must be in DEPRECATED status)

      Returns Promise<void>

      400 if the version is not in DEPRECATED status

    • Retry a failed webhook delivery.

      Schedules an immediate retry of a failed webhook delivery.

      Parameters

      • deliveryId: string

        The unique delivery ID to retry

      Returns Promise<{ message: string; retry_scheduled: boolean }>

      Confirmation that retry was scheduled

      If the delivery is not found or cannot be retried

      const result = await admin.retryWebhookDelivery('delivery-id');
      if (result.retry_scheduled) {
      console.log('Retry scheduled successfully');
      }
    • Revoke a user connection.

      This invalidates all tokens for the user and removes their authorization. The user will need to re-authorize to use your partner app again.

      Parameters

      • connectionId: string

        The unique connection ID to revoke

      Returns Promise<void>

      If the connection is not found

    • Rollback a credential rotation (emergency use only)

      Reverts a credential rotation using the rollback token. Rollback tokens are valid for 1 hour and are single-use only.

      NOTE: Webhook secrets do not support rollback. Only API keys and client secrets can be rolled back.

      Parameters

      • credentialType: "api-key" | "client-secret"

        Type of credential to rollback ('api-key' or 'client-secret')

      • request: CredentialRollbackRequest

        Rollback request with the rollback token

      Returns Promise<void>

      // If rotation caused issues, rollback within 1 hour
      await admin.rollbackCredential('api-key', {
      rollback_token: 'rb_xyz789'
      });

      console.log('Credential rolled back to previous value');
    • Rotate the API key with a grace period

      During the grace period, both old and new API keys are valid. After the grace period expires, only the new key works.

      Parameters

      Returns Promise<CredentialRotationResponse>

      Response containing the new API key and rollback token

      const result = await admin.rotateAPIKey({
      confirmation_token: 'confirm_rotation_12345',
      reason: 'Monthly security rotation',
      grace_period_hours: 48
      });

      // IMPORTANT: Save these values securely!
      console.log('New API key:', result.new_credential);
      console.log('Rollback token:', result.rollback_token);
      console.log('Grace period ends:', result.grace_period_ends_at);

      // Update your configuration with the new API key
      // Both old and new keys work until grace_period_ends_at
    • Rotate the OAuth client secret with a grace period

      During the grace period, both old and new client secrets work for token exchange. After the grace period expires, only the new secret works.

      Parameters

      Returns Promise<CredentialRotationResponse>

      Response containing the new client secret and rollback token

      const result = await admin.rotateClientSecret({
      confirmation_token: 'confirm_rotation_12345',
      reason: 'Annual security rotation',
      grace_period_hours: 168 // 7 days
      });

      // IMPORTANT: Save these values securely!
      console.log('New client secret:', result.new_credential);
      console.log('Rollback token:', result.rollback_token);
      console.log('Grace period ends:', result.grace_period_ends_at);

      // Update your OAuth configuration with the new client secret
      // Both old and new secrets work until grace_period_ends_at
    • Rotate the webhook secret (immediate rotation, no grace period)

      IMPORTANT: Webhook secrets do not support grace periods because Contio signs outgoing webhooks with the current secret immediately after rotation.

      Best practices:

      • Rotate during low-traffic periods to minimize failed deliveries
      • Implement dual-secret verification on your webhook endpoint during rotation
      • Use webhook redelivery if any deliveries fail during rotation
      • The grace_period_hours parameter is ignored for webhook secrets

      Parameters

      Returns Promise<CredentialRotationResponse>

      Response containing the new webhook secret (no rollback token or grace period)

      const result = await admin.rotateWebhookSecret({
      confirmation_token: 'confirm_rotation_12345',
      reason: 'Quarterly security rotation'
      });

      // IMPORTANT: Save the new secret securely and update your webhook verification immediately!
      console.log('New webhook secret:', result.new_credential);

      // Implement dual-secret verification during rotation:
      // Try verifying with new secret first, then fall back to old secret
    • Configure event filtering for webhook delivery.

      Use include filters to allow only specific events, or exclude filters to suppress selected events from being delivered.

      Parameters

      Returns Promise<PartnerApp>

      The updated partner app configuration

      If the request is invalid or includes unsupported event types

      const app = await admin.setWebhookFilter({
      type: 'include',
      events: ['meeting.created', 'meeting.completed']
      });

      console.log(app.webhook_filter);
      await admin.setWebhookFilter({
      type: 'exclude',
      events: ['participant.added']
      });
    • Update a draft toolkit version.

      Only DRAFT versions can be updated. Use this to revise the manifest, label, or changelog before publishing.

      Parameters

      • toolkitId: string

        The unique toolkit ID

      • versionId: string

        The unique version ID (must be in DRAFT status)

      • data: UpdateToolkitVersionRequest

        Fields to update (all optional)

      Returns Promise<ToolkitVersion>

      The updated draft version

      400 if the version is not in DRAFT status

    • Enable or disable webhook delivery for your partner app.

      Use this to temporarily pause webhook delivery or re-enable delivery after resolving endpoint issues.

      Parameters

      Returns Promise<PartnerApp>

      The updated partner app configuration

      If the request is invalid or the status change is not allowed

      await admin.updateWebhookStatus({
      enabled: false
      });
      const app = await admin.updateWebhookStatus({
      enabled: true,
      pending_disposition: 'abandon'
      });

      console.log('Webhook enabled:', app.webhook_enabled);