---
title: "Search connected apps"
method: POST
path: "/api/oauth-authorizations/search"
tags: ["oauth_authorizations"]
---

# Search connected apps

`POST /api/oauth-authorizations/search`

## Request

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

The caller's connected apps and agents: the standing OAuth consents, their own and never another user's. Filter by status (active vs revoked history), oauth_client_sid or team_scope_mode; include client (name and ceiling), teams (the selected workspaces; [] on an all_my_teams grant) and active_sessions (the live installation tokens). counts is the unfiltered active / revoked split, pagination.total_count the filtered count. page_size 0 returns the counts only.

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

## Request body

- SearchOauthAuthorizationsRequest: Request body of `search_oauth_authorizations`.
  - `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.
    - `oauth_client_sid` object: One connected client.
      - `eq` string
      - `in` string[]
    - `status` object: active, or revoked for history.
      - `eq` 'active' | 'revoked'
      - `in` string[]
    - `team_scope_mode` object: selected | all_my_teams.
      - `eq` 'selected' | 'all_my_teams'
    - `created_at` object: Connected-since window.
      - `gte` string
      - `lte` string
    - `last_used_at` object: is_null true = never used; a range = recently active.
      - `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' | 'last_used_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.

- SearchOauthAuthorizationsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Grant sid (id_oa_...).
      - `user_sid` string, required: The account that consented (us_mb_...).
      - `oauth_client_sid` string, required: The connected app or agent (id_oc_...).
      - `team_scope_mode` 'selected' | 'all_my_teams', required: selected = the listed workspaces; all_my_teams = every workspace the user is in, now and later.
      - `consented_team_sids` string[], required: The workspaces in scope (ts_tm_...); empty under all_my_teams.
      - `permissions` string[], required: What the app may do, inside the client's ceiling.
      - `status` 'active' | 'revoked', required: active = tokens can be minted from it; revoked = disconnected.
      - `last_used_at` string, nullable, required: ISO 8601 UTC of the last token minted from the grant; null = never.
      - `created_at` string, required: ISO 8601 UTC (connected since).
      - `updated_at` string, required: ISO 8601 UTC.
    - `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: All of the caller's grants, unfiltered; the filtered count is pagination.total_count.
    - `groups` object, required: status: active and revoked over all of the caller's grants, unfiltered.

## 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)
