---
title: "Search website sites"
method: POST
path: "/api/website-sites/search"
tags: ["website_sites"]
---

# Search website sites

`POST /api/website-sites/search`

## Request

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

The team's registered sites and their state: find a site sid (sg_si_) by domain or q, read status (pending = waiting for the script, verified = receiving, broken = stopped receiving, see broken_reason, disabled = switched off), last_hit_at and hits_count_24h to answer "why does acme.com show no visits". page_size 0 returns the counts per status. The loader to install is on get_website_site; the visits themselves are search_website_sessions.

Contract:
- MCP tool `search_website_sites`, registry package `mcp.signals/website_sites`, mount `signals.website`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchWebsiteSitesRequest: Request body of `search_website_sites`.
  - `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.
    - `q` string: Free text over the host (a LIKE): "acme" finds acme.com and app.acme.com.
    - `sid` object: Site sid(s), sg_si_ prefix.
      - `eq` string: Website site sid (sg_si_...).
      - `in` string[]
    - `domain` object: The host as stored: bare, lowercased, no www.
      - `eq` string
      - `in` string[]
    - `status` object: pending | verified | broken | disabled.
      - `eq` 'pending' | 'verified' | 'broken' | 'disabled'
      - `ne` 'pending' | 'verified' | 'broken' | 'disabled'
      - `in` string[]
      - `nin` string[]
    - `identification` object: companies | people: what a visit to the site may name.
      - `eq` 'companies' | 'people'
      - `in` string[]
    - `link_codes_enabled` object: The per-site switch for codes in links.
      - `eq` boolean
    - `last_hit_at` object: ISO 8601 bounds on the newest hit; is_null true = never received anything.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
      - `is_null` boolean
    - `created_at` object: ISO 8601 range; combine bounds in one object.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `deleted_at` object: Default scope is { is_null: true } (live rows); stating it at all lifts the soft-delete scope.
      - `gte` string
      - `lte` string
      - `is_null` boolean
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'created_at' | 'updated_at' | 'domain' | 'last_hit_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.

- SearchWebsiteSitesResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Website site sid (sg_si_...).
      - `team_sid` string, required: Owning team (ts_tm_..., external: gs.service.id).
      - `domain` string, required: The host as the team typed it, reduced to a bare hostname: lowercased, no scheme, port or path, a leading www. dropped. Immutable: a different host is a different site.
      - `include_subdomains` boolean, required: Hosts under domain belong to the site (default true).
      - `site_key` string, required: The public 20-character key the loader carries (gs.k). It names the site to the collector; not a secret. Changes only through rotate_website_site_key.
      - `status` 'pending' | 'verified' | 'broken' | 'disabled', required: pending = waiting for the script (links to it are not coded yet); verified = receiving; broken = the health rule flagged it (see broken_reason); disabled = switched off by update enabled false.
      - `verified_at` string, nullable, required: ISO 8601 UTC, the last transition into verified; null never.
      - `last_check_at` string, nullable, required: ISO 8601 UTC, the last active check (verify_website_site or the daily job); null never.
      - `last_check_result` object, nullable, required: What the last active check found, page by page; null while no check ran, and cleared by a key rotation.
        - `outcome` 'found' | 'site_key_mismatch' | 'loader_missing' | 'fetch_failed', required: The best outcome over pages: found wins over site_key_mismatch, over loader_missing, over fetch_failed.
        - `pages` object[], required: The home page first, then the checkable key pages (a pattern that names one URL).
          - `url` string, required: The URL requested last for this page.
          - `key_page_sid` string, nullable, required: sg_kp_... the key page this row checked; null for the home page.
          - `outcome` 'found' | 'site_key_mismatch' | 'loader_missing' | 'fetch_failed', required: found: the page carries this site's key. site_key_mismatch: a loader with another key. loader_missing: no loader in the page source (a tag manager installs it outside the source, so such a site is verified by its first hit instead). fetch_failed: no page to read, see failure.
          - `http_status` integer, nullable, required: The final HTTP status; null when no answer arrived.
          - `failure` 'invalid_url' | 'scheme_not_allowed' | 'credentials_in_url' | 'port_not_allowed' | 'ip_literal' | 'host_unresolvable' | 'private_address' | 'redirect_without_location' | 'too_many_redirects' | 'redirected_off_site' | 'connection_failed' | 'http_status', nullable, required: Why the fetch failed, when outcome is fetch_failed: the guard refused the URL (scheme, port, credentials, an IP literal, a private address), the host did not resolve, the redirects ran out or left the site, the connection failed, or the status was outside 2xx. Null otherwise.
      - `broken_reason` 'loader_missing' | 'fetch_failed' | 'site_key_mismatch' | 'no_hits', nullable, required: Set while broken: loader_missing (the source lost the loader and the hits stopped), fetch_failed (two checks in a row could not read the site while it was silent), site_key_mismatch (another key in the loader), no_hits (a tag-manager install whose hits stopped). Null otherwise.
      - `last_hit_at` string, nullable, required: ISO 8601 UTC, the newest hit the collector reported; null while nothing was received.
      - `hits_count_24h` integer, required: Hits in the current UTC hour and the 23 before it, refreshed on every hit batch and every check (a rolling window, not "today").
      - `identification` 'companies' | 'people', required: What a visit to the site may name. companies (default): links carry the recipient's company code and a visit shows the company, never a person. people: visits from the people the team writes to are shown by name.
      - `identification_confirmation` object, nullable, required: The customer's latest confirmation of its duties for a level, by whom and when. Links are coded only while it covers the site's level; null = none yet.
        - `identification` 'companies' | 'people', required: The level confirmed: people covers both levels, companies only itself.
        - `confirmed_at` string, required: ISO 8601 UTC.
        - `confirmed_by` object, required: Who confirmed.
          - `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.
      - `link_codes_enabled` boolean, required: Links to this site get a code (the company's or the person's, by identification) when the site is verified, identification_confirmation covers its level and the team switch (signal_settings.website_link_codes) is on. Default true.
      - `carrier_linkedin` 'fragment' | 'query', required: Where the code rides in a link sent on LinkedIn: fragment (#g_<code>, default) or query (?gs=<code>).
      - `carrier_email` 'fragment' | 'query', required: Where the code rides in a link sent by email: query (default) or fragment.
      - `consent_mode` 'not_required' | 'required', required: not_required (default): the first-party visitor id is stored on the first hit. required: nothing is stored until the site's banner calls gs('consent', true); until then a visit is attributed by the code in the link alone.
      - `fingerprint_mode` 'on' | 'consent' | 'off', required: on (default): the device fingerprint is collected (answered as consent when consent_mode is required); consent: only after consent; off: never.
      - `anonymize_ip` boolean, required: Once a session's network is resolved, keep the address's network part only (the last octet, or the last 80 bits of IPv6, zeroed). Default false.
      - `ignored_ips` string[], required: IPv4 or IPv6 addresses or CIDR ranges whose visits are internal (the office, the VPN egress): shown under their own filter, never a fact, never a signal. At most 50.
      - `live_alerts` 'off' | 'key_pages' | 'all_known', required: When a known person on the site alerts the team now: off, key_pages (default: a key page reached), all_known (any visit).
      - `live_alert_tasks` boolean, required: A live alert also opens a task, due now, on each of the person's open threads. false: only the notice goes. Default true.
      - `live_alert_task_minutes` integer, nullable, required: How long that task lives: still open after this many minutes, the sweep cancels it and it reads as expired. 5 to 43200 (30 days); null = it never expires. Default 30.
      - `inbound_playtable_sid` string, nullable, required: pt_tb_... the table an identified visitor nobody has would be handed to; stored only today, nothing reads it yet.
      - `created_by` object, required: Actor that registered the site.
        - `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; null = live. A deleted site keeps its sessions and visitors.
    - `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` integer, required: Sites matching the filter (full filter scope, not the page).
    - `groups` object, required
      - `status` union, required: Sites per status, the statuses that occur only (pending, verified, broken, disabled); [] when none.
        - object
        - unknown[]
          - unknown

## 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-signals.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-signals/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-signals/revisions/310ca5d2219d?raw)
