---
title: "Search notifications"
method: POST
path: "/api/notifications/search"
tags: ["notifications"]
---

# Search notifications

`POST /api/notifications/search`

## Request

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

The notifications of the workspace: the bell feed (channel.eq in_app, read_at.is_null true for the unread), the email audit (what the system mailed whom), or failure triage (status.eq failed). Rows carry no body; get_notification does. page_size 0 returns the counts (status, event_name, channel).

Contract:
- MCP tool `search_notifications`, registry package `mcp.id/notifications`, mount `id.notifications`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchNotificationsRequest: Request body of `search_notifications`.
  - `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: Notification sid(s).
      - `eq` string
      - `in` string[]
    - `team_sid` object: Scoped by the token; an explicit value only for support.
      - `eq` string
      - `in` string[]
    - `user_sid` object: The recipient.
      - `eq` string
      - `in` string[]
    - `event_name` object: The producing event, e.g. website-sites.broken.
      - `eq` string
      - `in` string[]
    - `read_at` object: is_null true = unread.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
      - `is_null` boolean
    - `entity_sid` object: The row the notice is about.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `status` object: pending | delivered | failed.
      - `eq` 'pending' | 'delivered' | 'failed'
      - `in` string[]
    - `channel` object: email | in_app.
      - `eq` 'email' | 'in_app'
    - `scheduled_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `delivered_at` object: is_null true = not delivered yet.
      - `gte` string
      - `lte` string
      - `is_null` boolean
    - `failed_at` object: ISO 8601 bounds; is_null true = never failed.
      - `gte` string
      - `lte` string
      - `is_null` boolean
    - `created_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `deleted_at` object: Default scope is { is_null: true } (undismissed rows).
      - `gte` string
      - `lte` string
      - `is_null` boolean
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'created_at' | 'scheduled_at' | 'delivered_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.

- SearchNotificationsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Notification sid (id_nt_...).
      - `team_sid` string, required: The workspace the notice is about (ts_tm_...).
      - `user_sid` string, nullable, required: The recipient (us_mb_...); null for a cold address (an invite).
      - `event_name` string, required: The domain event that produced it (team-members.invited, ssl-certificates.expiring, ...).
      - `event_sid` string, required: The event instance; two channels of one event share it.
      - `entity_sid` string, nullable, required: The row the notice is about (a site, a person, a certificate); null when none.
      - `channel` 'email' | 'in_app', required: email = sent through SendGrid; in_app = a line of the bell feed.
      - `status` 'pending' | 'delivered' | 'failed', required: pending = not sent yet; delivered; failed (see failure_reason). An in_app row is delivered at insert.
      - `subject` string, required: The subject, or the feed line.
      - `body_html` string: The rendered HTML body (get only).
      - `body_text` string: The rendered text body (get only).
      - `rate_limit_bucket` string, required: The dedup bucket: event, entity, hour and channel.
      - `scheduled_at` string, required: ISO 8601 UTC when the delivery was due.
      - `delivered_at` string, nullable, required: ISO 8601 UTC; null until delivered.
      - `read_at` string, nullable, required: ISO 8601 UTC when the recipient read an in_app row; null = unread, and always null on an email.
      - `failed_at` string, nullable, required: ISO 8601 UTC; null unless failed.
      - `failure_reason` string, nullable, required: Why the delivery failed (delivery_not_configured, a provider error); null otherwise.
      - `retry_count` integer, required: Delivery attempts so far (up to 5).
      - `created_by` object, required: The actor behind the event, usually system.
        - `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 when the recipient dismissed it; null = in the feed.
    - `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: Rows matching the filter.
    - `groups` object, required: status, event_name and channel: 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-id.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id/revisions/95e48541fe85?raw)
