---
title: "Search provider connections"
method: POST
path: "/api/provider-connections/search"
tags: ["provider_connections"]
---

# Search provider connections

`POST /api/provider-connections/search`

## Request

- Base URL: `https://beta.getsales.io/integrations/v1`
- URL: `https://beta.getsales.io/integrations/v1/api/provider-connections/search`
- Auth: HTTP bearer and API key in header `Team-SID`

The team's credentials: its own API keys (provider custom) and its HubSpot grants (provider hubspot), with their health. status.eq failed answers why the HubSpot export stopped (auto-disabled after five auth failures); provider.eq hubspot is the reliable axis, q matches the name only; sid.eq is the point lookup (there is no get). The vendors (OpenAI, Hunter...) are never here: the platform runs them on its own keys. page_size 0 returns the counts only.

Contract:
- MCP tool `search_provider_connections`, registry package `mcp.integrations/provider_connections`, mount `integrations.providers`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchProviderConnectionsRequest: Request body of `search_provider_connections`.
  - `filter` object: Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row.
    - `sid` object: Connection sid(s): the point lookup.
      - `eq` string
      - `in` string[]
    - `provider` object: custom | hubspot.
      - `eq` 'openai' | 'anthropic' | 'google' | 'deepseek' | 'xai' | 'voyage' | 'cohere' | 'hunter' | 'findymail' | 'anymailfinder' | 'emaillistverify' | 'custom' | 'hubspot' | 'serper'
      - `in` string[]
    - `auth_type` object: The secret shape.
      - `eq` 'api_key' | 'bearer' | 'basic' | 'header' | 'query' | 'oauth'
      - `in` string[]
    - `status` object: status.eq failed = the auto-disabled ones.
      - `eq` 'on' | 'off' | 'failed'
      - `ne` 'on' | 'off' | 'failed'
      - `in` string[]
    - `q` string: Infix match over the name.
    - `created_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `deleted_at` object: Default scope is { is_null: true }.
      - `gte` string
      - `lte` string
      - `is_null` boolean
    - `deleted` boolean: true = include soft-deleted rows.
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'created_at' | 'updated_at' | 'name' | 'last_failure_at', required: The column to order by.
    - `direction` 'asc' | 'desc': asc or desc; default desc.
  - `page_size` integer: 0..500, default 50; 0 = counts only, 1 = the first row.
  - `cursor` string, nullable: pagination.next_cursor of the previous page.

## Response `200`

`search` success envelope.

- SearchProviderConnectionsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Connection sid (in_cn_...).
      - `team_sid` string, required: The owning workspace (ts_tm_...).
      - `name` string, required: Display name, unique within the team among live rows.
      - `provider` 'openai' | 'anthropic' | 'google' | 'deepseek' | 'xai' | 'voyage' | 'cohere' | 'hunter' | 'findymail' | 'anymailfinder' | 'emaillistverify' | 'custom' | 'hubspot' | 'serper', required: custom (the team's own API) or hubspot (a CRM grant); immutable.
      - `auth_type` 'api_key' | 'bearer' | 'basic' | 'header' | 'query' | 'oauth', required: The shape of the stored secret; oauth on a HubSpot grant.
      - `external_account_id` string, nullable, required: The provider-side account of an OAuth grant (the HubSpot portal id): the reconnect key; null on key auth.
      - `status` 'on' | 'off' | 'failed', required: on; off (paused by hand); failed (auto-disabled after five auth failures in a row, revived by update or a reconnect).
      - `consecutive_failed_attempts` integer, required: Auth-classified failures in a row; any non-cache success or a rotation resets it.
      - `last_failure_at` string, nullable, required: ISO 8601 UTC of the last auth failure.
      - `created_by` object, required: Who stored it.
        - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
        - `actor_sid` string, nullable, required
        - `team_sid` string, required
        - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
        - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
        - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
        - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
        - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
        - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
      - `deleted_by` object, nullable, required: Who deleted it; null while live.
        - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
        - `actor_sid` string, nullable, required
        - `team_sid` string, required
        - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
        - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
        - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
        - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
        - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
        - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
      - `created_at` string, required: ISO 8601 UTC.
      - `updated_at` string, required: ISO 8601 UTC.
      - `deleted_at` string, nullable, required: ISO 8601 UTC; the secret is scrubbed with it.
    - `included` object, required
  - `pagination` object, required
    - `next_cursor` string, nullable, required
    - `has_more` boolean, required
    - `total_count` integer, nullable, required
  - `applied_filters` object, required
  - `includes` string[], required
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
  - `counts` object
    - `total_count` number, required: Connections matching the filter.
    - `groups` object, required: provider and status: the count per value.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-integrations.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-integrations/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-integrations/revisions/2e7105d58335?raw)
