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

# Search notes

`POST /api/notes/search`

## Request

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

Read notes: free-form annotations on people and companies, and the stickers on a workflow canvas (object_type workflow). Scope with filter object_sid for one object's notes or one workflow's stickers (read them before changing a workflow), or search team-wide with filter q (FULLTEXT over body); include person and company to cite names. page_size 0 = counts only; counts.groups.object_type rides every response. Not for system facts (sends, replies): the activities timeline.

Contract:
- MCP tool `search_notes`, registry package `mcp.playtables/notes`, mount `playtables.pipeline`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchNotesRequest: Request body of `search_notes`.
  - `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 note bodies (MySQL FULLTEXT over body).
    - `sid` object: Note sid(s), cr_nt_ prefix - also the point-lookup path (no get tool).
      - `eq` string: Note sid (cr_nt_…).
      - `in` string[]
    - `object_type` object: Object kind: person | company | workflow.
      - `eq` 'person' | 'company' | 'workflow'
    - `object_sid` object: The annotated object(s), cr_pp_ / cr_co_ / wf_wf_ - the notes-widget scope, or a workflow's stickers.
      - `eq` string
      - `in` string[]
    - `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 notes).
      - `gte` string
      - `lte` string
      - `is_null` boolean
  - `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', 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.

- SearchNotesResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Note sid (cr_nt_…).
      - `team_sid` string, required: Owning team (ts_tm_…, external - gs.service.id).
      - `object_type` 'person' | 'company' | 'workflow', required: Kind of the annotated object: person | company | workflow (a sticker on its canvas). Fixed at create - a note is never re-homed.
      - `object_sid` string, required: The annotated person (cr_pp_…), company (cr_co_…) or workflow (wf_wf_…); prefix matches object_type.
      - `body` string, required: Plain-text note body, rendered as-is; FULLTEXT-indexed for filter.q. 1..65535 chars on a person or company; a sticker may be empty.
      - `step_id` integer, nullable, required: A sticker only: the workflow step it sits beside; null = the workflow as a whole (and always null on a person or company note).
      - `position` object, nullable, required: A sticker only: where a person dragged it, relative to its step; null = the canvas places it beside its step.
        - `x` integer, required
        - `y` integer, required
      - `created_by` object, required: Actor that authored the note (AccessIdentityValue); shown for accountability.
        - `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: Actor that soft-deleted the note (tool call or parent cascade); 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; bumped by body edits.
      - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live (soft delete).
    - `included` object, required
      - `person` object: Annotated person row (PeopleDomain - entities/people.md). Present on object_type=person rows when requested and found.
      - `company` object: Annotated company row (CompanyDomain - entities/companies.md). Present on object_type=company rows when requested and found.
  - `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: Notes matching the filter (full filter scope, not the page).
    - `groups` object, required
      - `object_type` union, required: Note distribution across the object kinds; absent key = zero.
        - object
          - `person` integer
          - `company` integer
          - `workflow` integer
        - 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-playtables.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/revisions/aa394506515d?raw)
