Search shared pull requests, guides and review discussion in one authorized workspace
Search shared pull requests, guides and review discussion in one authorized workspace
POST /api/v1/search
Read-only hybrid search. Results use current canonical content and guide-specific navigation. Review comments retain their actual author; decision rationale is historical text, never evidence of current approval. Cursors expire after five minutes and are bound to the credential, scope, query, filters, limit and active index. Changed rankings invalidate a cursor with conflict; start a new search. Search never starts ingestion or repairs an index. Pending authorization returns search_authorization_pending; a disabled or unavailable provider returns search_unavailable. Missing or lagging index coverage returns an incomplete page.
Example request
Link to this section# Replace workspace_id with the workspace ID from GET /me.
# Set your token and resource IDs first.
API_BASE_URL="https://app.theseus.dev/api/v1"
curl --fail-with-body --request POST \
-H "Authorization: Bearer ${THESEUS_API_TOKEN:?}" \
-H "Content-Type: application/json" \
--data '{"query":"notifications after reconnect","workspace_id":"wsp_YOUR_ID","limit":10}' \
"${API_BASE_URL}/search"Request body
Link to this sectionContent type application/json
querystring requiredMinimum length
1· Maximum length1024workspace_idstring requiredPattern
^[A-Za-z0-9_-]{1,128}$repository_idsarray of string or nullDefault
null· Maximum items1000· Each item: Pattern^rep_[0-9A-Z]{26}$limitintegerDefault
20· Minimum1· Maximum50cursorstringMaximum length
2048· Pattern^sr1_[0-9a-f]{24}\.(?:[0-9a-f]{2})+$filtersobjectfilters fields
kindsarray of stringMinimum items
1· Maximum items5· Each item: One ofpull-request,summary,claim,comment,decision-rationalepathsarray of stringMinimum items
1· Maximum items20· Each item: Minimum length1· Each item: Maximum length1024
Responses
Link to this sectionBounded, grouped canonical search results
Response fields
Content type application/json
dataarray of SearchHit requiredMaximum items
50data fields
kindstring requiredOne of
pull-request,summary,claim,comment,decision-rationalesource_idstring requiredrepositoryobject requiredrepository fields
idstring requirednamestring required
changeset_idstring or null requiredguide_idstring or null requiredclaim_keystring or null requiredpull_request_numberinteger or null requiredreview_idstring or null requiredauthorone of requiredauthor variants
One of:
kind: user
kindstring requiredAlways
useruser_idstring requireddisplay_namestring required
kind: github
kindstring requiredAlways
githubgithub_user_idinteger requiredgithub_loginstring requireddisplay_namestring required
Option 3
nullhistoricalboolean requiredtitlestring requiredMaximum length
1024snippetstring requiredMaximum length
512pathsarray of string requiredMaximum items
20· Each item: Maximum length1024urlstring (uri) required
next_cursorstring or null requiredhas_moreboolean requiredincompleteboolean requiredSome authorized repositories lack a current index, or canonical candidates were discarded. An empty incomplete page is not evidence of no matches.
truncatedboolean requiredThe fixed 128-candidate / 32-source ranking window was exhausted. Narrow the query or repository scope to search further.
Example responses
Link to this sectionMatching claim
Illustrative response · complete
{
"data": [
{
"kind": "claim",
"source_id": "chg_EXAMPLE",
"repository": {
"id": "rep_EXAMPLE",
"name": "example/project"
},
"changeset_id": "set_EXAMPLE",
"guide_id": "ver_EXAMPLE",
"review_id": null,
"author": null,
"historical": false,
"claim_key": "notification-preferences",
"pull_request_number": null,
"title": "Notifications survive a reconnect",
"snippet": "Reconnecting keeps the existing notification preference.",
"paths": [
"src/notifications.ts"
],
"url": "https://example-team.theseus.dev/example/project/pr/42/notification-preferences?version=ver_EXAMPLE"
}
],
"next_cursor": null,
"has_more": false,
"incomplete": false,
"truncated": false
}Errors
Link to this section400 · The request is not valid
401 · A valid bearer token is required
403 · The credential's scopes do not allow this
404 · Not found
409 · The request conflicts with the resource as it is
426 · Upgrade the CLI: run theseus update
429 · Too many requests
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
503 · Theseus is unavailable; retry the same request
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
Error response fields
Content type application/problem+json
typestring (uri) requiredIdentifies the problem type; branch on
codeinsteadtitlestring requiredstatusinteger requireddetailstringcodestring requiredWhy the request failed. New codes may be added: treat an unknown one by its status
One of
invalid_request,unauthenticated,not_in_plan,insufficient_scope,admission_required,not_found,ambiguous,conflict,rate_limited,internal_error,unavailable,search_authorization_pending,search_unavailable,cli_upgrade_requiredrequest_idstring requiredQuote this when reporting the problem
errorsarray of FieldErrorWith
invalid_request: what is wrong with each fielderrors fields
pathstring requiredWhere in the request, as dotted segments
messagestring required
required_scopestringWith
insufficient_scope: the scope the operation needsnextstringRecovery action, such as theseus update
candidatesarray of CandidateWith
ambiguous: what the request could mean; ask whichcandidates fields
idstring requiredpathstring requiredkindstring requiredtitlestring requiredurlstring (uri) required