Search

Semantic search across received and sent mail

Changed on

Ranked search across both received and sent mail. The mode field selects the ranking strategy:

  • keyword: lexical full-text matching only (no embeddings).
  • semantic: meaning-based matching using vector embeddings.
  • hybrid (default): blends the semantic and keyword signals.

Results are ordered by a relevance score. Every row reports the fields it matched (matched_fields), a match-centered excerpt per field (snippets), and a score_breakdown whose components account for the score. Page through results by passing the prior response's meta.cursor back as cursor.

Requires the Pro plan and the semantic_search_enabled entitlement; callers without them receive 403.

post/semantic-search

Request

  • Base URL: https://api.primitive.dev/v1
  • URL: https://api.primitive.dev/v1/semantic-search
  • Auth: HTTP bearer

Request body

querystring

Free-text query. Required for semantic and hybrid modes; optional for keyword mode.

mode'hybrid' | 'semantic' | 'keyword'

Ranking strategy. keyword is lexical only, semantic is embedding-based, hybrid blends both.

corpusstring[]

Which mail to search. Defaults to both received (inbound) and sent (outbound).

search_inSemanticSearchField[]

Restrict matching to these fields. Defaults to all.

excludeSemanticSearchField[]

Exclude these fields from matching.

date_fromstring date-time

Only include mail at or after this timestamp. An ISO 8601 timestamp with Z or a numeric UTC offset (2026-10-02T00:00:00Z, 2026-10-02T00:00:00-04:00). An offset is read as the instant it names. A time with no zone, or a bare date, is rejected.

date_tostring date-time

Only include mail at or before this timestamp. An ISO 8601 timestamp with Z or a numeric UTC offset (2026-10-02T00:00:00Z, 2026-10-02T00:00:00-04:00). An offset is read as the instant it names. A time with no zone, or a bare date, is rejected.

includestring[]

Opt-in extras. coverage adds an index-coverage snapshot to meta. Matched fields, snippets, and the score breakdown are always returned regardless of this field.

limitinteger

Maximum number of results to return.

cursorstring

Opaque pagination cursor from a prior response's meta.cursor.

Response

Ranked search results

successboolean required

Changes

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • info

      removed the invalid_signup_code enum value from the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new not_a_repeating_send enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_idle_requires_internal_recipient enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_recipient_external enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_stop_not_allowed enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status

    • warning

      added the new repeat_unsupported enum value to the / response property for the response status