---
title: "Search subscription allocations"
method: POST
path: "/api/subscription-allocations/search"
tags: ["subscription_allocations"]
---

# Search subscription allocations

`POST /api/subscription-allocations/search`

## Request

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

How a subscription's pool is split across workspaces, or what one workspace draws from: subscription_sid.eq for the split of one pool, team_sid.eq for a workspace's share (its capacity: sender profiles, credits per period, the White label). Scope: the pools the caller bought, plus the current workspace's own share. include team hydrates the workspace with its derived status. Oldest share first by default. page_size 0 returns the count only.

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

## Request body

- SearchSubscriptionAllocationsRequest: Request body of `search_subscription_allocations`.
  - `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: Allocation sid(s).
      - `eq` string
      - `in` string[]
    - `subscription_sid` object: How one pool is split.
      - `eq` string
      - `in` string[]
    - `team_sid` object: What one workspace draws from.
      - `eq` string
      - `in` string[]
    - `created_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `deleted_at` object: Default scope is { is_null: true } (live shares); state it to see superseded ones.
      - `gte` string
      - `lte` string
      - `is_null` boolean
  - `include` string[]: Relations to attach to every item; omit for the bare rows.
  - `sort` object: One sort column with its direction. Omit for created_at ascending, the oldest share first.
    - `field` 'created_at' | 'updated_at', required: created_at or updated_at.
    - `direction` 'asc' | 'desc': asc or desc; default asc on this entity.
  - `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.

- SearchSubscriptionAllocationsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Allocation sid (bl_al_...).
      - `subscription_sid` string, required: The pool (bl_sb_...).
      - `team_sid` string, required: The workspace holding the share (ts_tm_...); one live share per workspace.
      - `created_by` object, required: Who handed the share out: the buyer, or system for the checkout and the trial.
        - `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.
      - `linkedin_sender_profiles` integer, required: LinkedIn sender profiles (accounts) the workspace may run.
      - `email_inboxes` integer, required: Inboxes the workspace may connect.
      - `credits_per_month` integer, required: Platform credits granted to the workspace every month of the paid period (one lot per grant, kept while the plan runs and burnt when the workspace leaves it).
      - `whitelabel` integer, required: 1 = the workspace may register white label brands; 0 = not.
      - `created_at` string, required: ISO 8601 UTC.
      - `updated_at` string, required: ISO 8601 UTC.
      - `deleted_at` string, nullable, required: ISO 8601 UTC; a superseded or taken-back share keeps its history.
    - `included` object, required
      - `team` object: The workspace row (TeamDomain) with the derived status and limits.
  - `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: Allocations matching the filter.

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