---
title: "Search provider calls"
method: POST
path: "/api/provider-calls/search"
tags: ["provider_calls"]
---

# Search provider calls

`POST /api/provider-calls/search`

## Request

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

The execution log of the integration platform, for a drill-down: by connection (provider_connection_sid with error_code.eq auth_error: is this key working), by caller (tool_type and tool_sid: one cell's attempts), by object, by failure class. Rows carry coordinates, status, error, money and tokens, the snapshots nulled (get_provider_call has them). The scan must be bounded: one of the sid filters, or a created_at lower bound (422 bounded_scan_required). page_size 0 returns the counts only.

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

## Request body

- SearchProviderCallsRequest: Request body of `search_provider_calls`.
  - `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: Call sid(s).
      - `eq` string
      - `in` string[]
    - `operation` object: llm.generate, email.find, http.request, crm.*...
      - `eq` 'llm.generate' | 'llm.embed' | 'email.find' | 'email.verify' | 'http.request' | 'crm.contact_upsert' | 'crm.company_upsert' | 'crm.associate' | 'crm.properties_list' | 'serp.search' | 'audio.transcribe'
      - `in` string[]
    - `provider` object: The adapter.
      - `eq` 'openai' | 'anthropic' | 'google' | 'deepseek' | 'xai' | 'voyage' | 'cohere' | 'hunter' | 'findymail' | 'anymailfinder' | 'emaillistverify' | 'custom' | 'hubspot' | 'serper'
      - `in` string[]
    - `model` object: The model of llm and audio calls.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `provider_connection_sid` object: Calls through one connection (is this key working); is_null true = platform-key calls.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `custom_tool_sid` object: One custom tool's calls.
      - `eq` string
      - `in` string[]
    - `source_service` object: playtables | unibox | agents | api | app.
      - `eq` string
      - `in` string[]
    - `tool_type` object: playtable_field, workflow_task, agent_run, custom_tool, dictation.
      - `eq` string
      - `in` string[]
    - `tool_sid` object: One cell's or one run's attempts (with object_sid: one cell).
      - `eq` string
      - `in` string[]
    - `object_sid` object: What was called about one person or company.
      - `eq` string
      - `in` string[]
    - `status` object: success | failed | pending.
      - `eq` 'pending' | 'in_progress' | 'success' | 'failed' | 'retrying' | 'cancelled'
      - `ne` 'pending' | 'in_progress' | 'success' | 'failed' | 'retrying' | 'cancelled'
      - `in` string[]
    - `error_code` object: auth_error is the evidence behind a failed connection.
      - `eq` 'auth_error' | 'rate_limited' | 'timeout' | 'network_error' | 'invalid_input' | 'provider_error' | 'not_found'
      - `in` string[]
      - `is_null` boolean
    - `cache_hit` object: true = served from the cache.
      - `eq` boolean
    - `idempotency_key` object: The call behind one exact charge.
      - `eq` string
    - `credits_charged` object: gt 0 = the paid subset.
      - `eq` number
      - `gte` number
      - `lte` number
      - `gt` number
      - `lt` number
    - `created_at` object: ISO 8601 bounds; a lower bound makes the scan bounded.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
  - `include` string[]: Relations to attach to every item; omit for the bare rows.
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'created_at' | 'duration_ms' | 'credits_charged', 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.

- SearchProviderCallsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Call sid (in_pc_...).
      - `team_sid` string, required: The workspace (ts_tm_...).
      - `source_service` string, required: Who asked: playtables, unibox, agents, api, app.
      - `tool_type` string, nullable, required: The caller's tool kind: playtable_field (a cell), playtable_action, workflow_task, agent_run, custom_tool, dictation.
      - `tool_sid` string, nullable, required: The invoking row (a field pt_fd_, a run...); opaque, may dangle.
      - `object_type` string, nullable, required: The row the call was about: people, company, conversation.
      - `object_sid` string, nullable, required: Its sid; opaque, may dangle.
      - `operation` 'llm.generate' | 'llm.embed' | 'email.find' | 'email.verify' | 'http.request' | 'crm.contact_upsert' | 'crm.company_upsert' | 'crm.associate' | 'crm.properties_list' | 'serp.search' | 'audio.transcribe', required: What was called.
      - `provider` 'openai' | 'anthropic' | 'google' | 'deepseek' | 'xai' | 'voyage' | 'cohere' | 'hunter' | 'findymail' | 'anymailfinder' | 'emaillistverify' | 'custom' | 'hubspot' | 'serper', required: The adapter that ran it.
      - `model` string, nullable, required: The model on an llm or audio call: the price axis; null elsewhere.
      - `custom_tool_sid` string, nullable, required: The custom tool of an http.request (in_tl_...); null elsewhere.
      - `provider_connection_sid` string, nullable, required: The team grant of a crm call or the tool's connection; null = the platform key.
      - `status` 'pending' | 'in_progress' | 'success' | 'failed' | 'retrying' | 'cancelled', required: success | failed for a finished call; pending = an http.request claimed and never finalized (outcome unknown).
      - `http_code` integer, nullable, required: The provider's answer; null on a network error or timeout.
      - `duration_ms` integer, nullable, required: Wall clock of the attempt.
      - `error_code` 'auth_error' | 'rate_limited' | 'timeout' | 'network_error' | 'invalid_input' | 'provider_error' | 'not_found', nullable, required: The classified failure; not_found = an operation-level miss (no email exists); null on success.
      - `error_message` string, nullable, required: A tenant-readable rendering; the raw body is in response.
      - `request` object, nullable, required: The sanitized provider request (no auth material); capped at 64 KB; null on search rows.
      - `response` object, nullable, required: The raw provider body, truncated to 16 KB; null on search rows.
      - `output` object, nullable, required: The normalized result the caller received; null on search rows.
      - `prompt_tokens` integer, nullable, required: llm calls only.
      - `completion_tokens` integer, nullable, required: llm calls only.
      - `total_tokens` integer, nullable, required: llm calls only.
      - `cache_hit` boolean, required: true = answered from the cross-team result cache, no round-trip, 0 credits.
      - `credits_charged` union, required: Credits priced at call time (a decimal); 0 on a failure, a cache hit, a bundled call.
        - number
        - string
      - `billing` 'standard' | 'bundled' | 'caller', nullable, required: standard = the catalog rate, held and settled on the team wallet by the platform (the billing bus, 2026-10-22); bundled = folded into a charge the caller already made (0); caller = the caller meters it against the wallet itself under the same key (the email finder and verifier of a waterfall); null on rows before the column.
      - `idempotency_key` string, required: The caller's end-to-end dedup key; a replay returns the stored outcome.
      - `created_at` string, required: ISO 8601 UTC: the metrics period column.
      - `updated_at` string, required: ISO 8601 UTC.
    - `included` object, required
      - `provider_connection` object, nullable: The connection the call ran through (ProviderConnectionDomain); null for platform-key calls and dangling refs.
  - `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: Calls matching the filter (the bounded scope).
    - `groups` object, required: operation, provider, model, status, error_code, source_service, cache_hit, created_date: 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)
