---
title: "Advanced search for calls using Atlas Search"
method: POST
path: "/system/advanced-search/call"
tags: ["Calls Search"]
---

# Advanced search for calls using Atlas Search

`POST /system/advanced-search/call`

## Headers

- `Authorization` string, string, required
- `Context` string, string, required
- `Accept` 'application/json', required
- `X-Accept-Timezone` string
- `X-Accept-Result-Count` boolean
- `X-Accept-Result-Count-Limit` integer

## Request body

- AdvancedSearchCallPayloadDef
  - `query` AdvancedSearchCallQueryFields — Query filter using bumblebee operators. Exactly one of 'and' or 'or' must be supplied at the top level — supplying both is rejected at runtime with TOO_MANY_OPERATORS.
    - `and` AdvancedSearchCallQueryFields[]
    - `or` AdvancedSearchCallQueryFields[]
    - `call_start` AdvancedSearchOperationsDateField
      - `equal` string, date-time, nullable
      - `greater_than` string, date-time, nullable
      - `less_than` string, date-time, nullable
      - `greater_than_equal` string, date-time, nullable
      - `less_than_equal` string, date-time, nullable
      - `in` string[]
    - `total_duration` AdvancedSearchOperationsNumberField
      - `equal` number, nullable
      - `greater_than` number, nullable
      - `less_than` number, nullable
      - `greater_than_equal` number, nullable
      - `less_than_equal` number, nullable
      - `in` number[]
      - `nin` number[]
    - `direction` AdvancedSearchOperationsStringField
      - `like` string, nullable
      - `equal` string, nullable
      - `in` string[]
      - `nin` string[]
      - `greater_than` string, nullable
      - `less_than` string, nullable
      - `greater_than_equal` string, nullable
      - `less_than_equal` string, nullable
    - `pabx_meta_identifier_name` AdvancedSearchOperationsStringField
      - `like` string, nullable
      - `equal` string, nullable
      - `in` string[]
      - `nin` string[]
      - `greater_than` string, nullable
      - `less_than` string, nullable
      - `greater_than_equal` string, nullable
      - `less_than_equal` string, nullable
    - `call_part` AdvancedSearchOperationsCallPartField — Filter on call_part entries. Use 'contains' to match documents where at least one call part satisfies the condition.
      - `contains` AdvancedSearchOperationsCallPartEntryField[]
        - `agent_extension` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
      - `contains_any` AdvancedSearchOperationsCallPartEntryField[]
        - `agent_extension` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
    - `parties` AdvancedSearchOperationsPartiesField — Filter on parties entries. Use 'contains' to match documents where at least one party satisfies all conditions; 'contains_any' for at least one matching.
      - `contains` AdvancedSearchOperationsPartiesEntryField[]
        - `phone_number` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_ss_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_type` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_agency_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_agency_group_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `gong_user_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
      - `contains_any` AdvancedSearchOperationsPartiesEntryField[]
        - `phone_number` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_ss_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_type` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_agency_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `party_agency_group_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
        - `gong_user_id` AdvancedSearchOperationsStringField
          - `like` string, nullable
          - `equal` string, nullable
          - `in` string[]
          - `nin` string[]
          - `greater_than` string, nullable
          - `less_than` string, nullable
          - `greater_than_equal` string, nullable
          - `less_than_equal` string, nullable
    - `staffshift_context` AdvancedSearchOperationsStaffshiftContextField — Filter on staffshift_context fields.
      - `id` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
      - `type` AdvancedSearchOperationsStringField
        - `like` string, nullable
        - `equal` string, nullable
        - `in` string[]
        - `nin` string[]
        - `greater_than` string, nullable
        - `less_than` string, nullable
        - `greater_than_equal` string, nullable
        - `less_than_equal` string, nullable
    - `gong_readiness` AdvancedSearchOperationsStringField
      - `like` string, nullable
      - `equal` string, nullable
      - `in` string[]
      - `nin` string[]
      - `greater_than` string, nullable
      - `less_than` string, nullable
      - `greater_than_equal` string, nullable
      - `less_than_equal` string, nullable
    - `gong_call_id` AdvancedSearchOperationsStringField
      - `like` string, nullable
      - `equal` string, nullable
      - `in` string[]
      - `nin` string[]
      - `greater_than` string, nullable
      - `less_than` string, nullable
      - `greater_than_equal` string, nullable
      - `less_than_equal` string, nullable
    - `gong_enrichment_status` AdvancedSearchOperationsStringField
      - `like` string, nullable
      - `equal` string, nullable
      - `in` string[]
      - `nin` string[]
      - `greater_than` string, nullable
      - `less_than` string, nullable
      - `greater_than_equal` string, nullable
      - `less_than_equal` string, nullable
    - `gong_transcript` AdvancedSearchOperationsTranscriptField — Filter on gong_transcript entries. Use 'contains' to match documents where at least one transcript entry satisfies the condition; 'contains_any' for at least one sentence matching.
      - `contains` AdvancedSearchOperationsTranscriptSentencesField[]
        - `sentences` object
          - `contains` AdvancedSearchOperationsTranscriptSentenceTextField[]
            - `text` AdvancedSearchOperationsStringField
              - …
          - `contains_any` AdvancedSearchOperationsTranscriptSentenceTextField[]
            - `text` AdvancedSearchOperationsStringField
              - …
      - `contains_any` AdvancedSearchOperationsTranscriptSentencesField[]
        - `sentences` object
          - `contains` AdvancedSearchOperationsTranscriptSentenceTextField[]
            - `text` AdvancedSearchOperationsStringField
              - …
          - `contains_any` AdvancedSearchOperationsTranscriptSentenceTextField[]
            - `text` AdvancedSearchOperationsStringField
              - …
    - `gong_analysis` AdvancedSearchOperationsGongAnalysisField — Filter on gong_analysis fields. Use 'contains'/'contains_any' for array sub-fields (topics, trackers).
      - `topics` AdvancedSearchOperationsGongAnalysisTopicsField
        - `contains` AdvancedSearchOperationsGongAnalysisNamedEntryField[]
          - `name` AdvancedSearchOperationsStringField
            - `like` string, nullable
            - `equal` string, nullable
            - `in` string[]
            - `nin` string[]
            - `greater_than` string, nullable
            - `less_than` string, nullable
            - `greater_than_equal` string, nullable
            - `less_than_equal` string, nullable
        - `contains_any` AdvancedSearchOperationsGongAnalysisNamedEntryField[]
          - `name` AdvancedSearchOperationsStringField
            - `like` string, nullable
            - `equal` string, nullable
            - `in` string[]
            - `nin` string[]
            - `greater_than` string, nullable
            - `less_than` string, nullable
            - `greater_than_equal` string, nullable
            - `less_than_equal` string, nullable
      - `trackers` AdvancedSearchOperationsGongAnalysisTrackersField
        - `contains` AdvancedSearchOperationsGongAnalysisNamedEntryField[]
          - `name` AdvancedSearchOperationsStringField
            - `like` string, nullable
            - `equal` string, nullable
            - `in` string[]
            - `nin` string[]
            - `greater_than` string, nullable
            - `less_than` string, nullable
            - `greater_than_equal` string, nullable
            - `less_than_equal` string, nullable
        - `contains_any` AdvancedSearchOperationsGongAnalysisNamedEntryField[]
          - `name` AdvancedSearchOperationsStringField
            - `like` string, nullable
            - `equal` string, nullable
            - `in` string[]
            - `nin` string[]
            - `greater_than` string, nullable
            - `less_than` string, nullable
            - `greater_than_equal` string, nullable
            - `less_than_equal` string, nullable
  - `sort` string[] — Sort fields. Each entry is a field name optionally prefixed with '-' for descending order (e.g. '-call_start').
  - `project` object — MongoDB projection. Each key is a field name with value 1 to include it. gong_transcript and gong_analysis are excluded by default.
    - `pabx_call_id` 1
    - `recording` 1
    - `call_start` 1
    - `total_duration` 1
    - `direction` 1
    - `pabx_meta_identifier_name` 1
    - `call_part` 1
    - `parties` 1
    - `gong_workspace_id` 1
    - `gong_call_id` 1
    - `staffshift_context` 1
    - `gong_readiness` 1
    - `gong_enrichment_status` 1
    - `gong_enrichment_status_since` 1
    - `gong_transcript_retrieved_at` 1
    - `gong_analysis_retrieved_at` 1
    - `gong_transcript` 1
    - `gong_analysis` 1
  - `page` integer — Page number (1-based). Defaults to 1 when omitted. Use together with items_per_page to paginate results.
  - `items_per_page` integer — Number of results per page. Defaults to 25 when omitted; maximum 50. Use together with page to paginate results.

## Response `200`

Advanced search results returned successfully. Note: gong_transcript and gong_analysis are excluded by default to keep response payloads small. To include them, send project: {gong_transcript: 1, gong_analysis: 1} in the request body.

- object[]
  - `_id` string — MongoDB document identifier
  - `__v` integer
  - `pabx_call_id` string
  - `recording` string
  - `call_start` string, date-time
  - `total_duration` integer
  - `direction` 'Inbound' | 'Outbound' | 'Conference' | 'Unknown'
  - `pabx_meta_identifier_name` string
  - `call_part` AdvancedSearchCallResponseCallPart[]
    - `call_start` string, date-time, required
    - `duration` integer, required
    - `agent_extension` string, required
    - `pabx_meta_identifier_name` string, required
    - `call_type` 'Inbound' | 'Outbound' | 'Conference' | 'Unknown', required
    - `external_party` string, required
  - `parties` AdvancedSearchCallResponseParty[]
    - `party_id` string, required
    - `party_crm_status` 'not_found' | 'found' | 'pending' | 'not_applicable', required
    - `phone_number` string, required
    - `party_type` 'Client' | 'Candidate' | 'User'
    - `party_ss_id` string
    - `gong_user_id` string
    - `party_agency_id` string
    - `party_agency_group_id` string
    - `generated_crm_object_id` string
  - `gong_workspace_id` string
  - `gong_call_id` string
  - `staffshift_context` AdvancedSearchCallResponseStaffshiftContext
    - `type` 'Candidate' | 'AgencyGroup' | 'Agency' | 'SystemAdmin' | 'Organisation', required
    - `id` string, required
  - `gong_readiness` 'ready' | 'not_ready' | 'awaiting_checks' | 'awaiting_signed_url' | 'success_send' | 'permanent_failure' | 'temporary_failure' | 'wont_send_core_checks'
  - `gong_enrichment_status` 'NOT_STARTED' | 'COMPLETED' | 'ABANDONED' | 'RESYNC_REQUESTED' | 'RETRYING' | 'POSSIBLE_FAILURE'
  - `gong_enrichment_status_since` string, date-time
  - `gong_transcript_retrieved_at` string, date-time
  - `gong_analysis_retrieved_at` string, date-time
  - `gong_transcript` AdvancedSearchCallResponseGongTranscript[] — Excluded by default to keep response payloads small. Opt in via project: {gong_transcript: 1}.
    - `speaker_id` string, required
    - `topic` string
    - `sentences` AdvancedSearchCallResponseGongTranscriptSentence[], required
      - `start_ms` integer, required
      - `end_ms` integer, required
      - `text` string, required
  - `gong_analysis` AdvancedSearchCallResponseGongAnalysis
    - `meta_data` AdvancedSearchCallResponseGongAnalysisMetaData, required
      - `title` string, required
      - `duration` integer, required
      - `workspace_id` string, required
      - `primary_user_id` string, required
    - `topics` AdvancedSearchCallResponseGongAnalysisTopic[], required
      - `name` string, required
      - `duration` integer, required
    - `trackers` AdvancedSearchCallResponseGongAnalysisTracker[], required
      - `name` string, required
      - `count` integer, required
    - `speakers` AdvancedSearchCallResponseGongAnalysisSpeaker[]
      - `speaker_id` string, required
      - `talk_time` number, required
    - `questions` AdvancedSearchCallResponseGongAnalysisQuestions
      - `company_count` integer, required
      - `non_company_count` integer, required
    - `interaction_stats` AdvancedSearchCallResponseGongAnalysisInteractionStat[]
      - `name` string, required
      - `value` number, required
    - `brief` string
    - `outline` AdvancedSearchCallResponseGongAnalysisOutlineSection[]
      - `section` string, required
      - `start_time` number
      - `duration` number
      - `items` AdvancedSearchCallResponseGongAnalysisOutlineItem[], required
        - `text` string, required
        - `start_time` number
    - `highlights` AdvancedSearchCallResponseGongAnalysisHighlight[]
      - `title` string, required
      - `items` AdvancedSearchCallResponseGongAnalysisHighlightItem[], required
        - `text` string, required
        - `start_times` number[]
    - `call_outcome` AdvancedSearchCallResponseGongAnalysisCallOutcome
      - `id` string, required
      - `category` string, required
      - `name` string, required
    - `key_points` AdvancedSearchCallResponseGongAnalysisKeyPoint[]
      - `text` string, required
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `_etags` object
    - `calls_search` integer, required

## Other responses

- `204` — No results found for the given search criteria
- `400` — Validation error. Usually caused by a missing or invalid parameter.
- `401` — Failed to authenticate the incoming request
- `403` — Permission denied error
- `default` — Server error occurred

---

[API](https://skmtc.dev/staffshift/apis/staffshift-api-gateway.md) · [All operations](https://skmtc.dev/staffshift/apis/staffshift-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/staffshift/staffshift-api-gateway/revisions/6e2cb83db3a9/schema)
