1. Query
temper
  • Temper documentation
  • 2026-07-06-cogmap-telos-differentiation
  • handoffs
  • plans
    • archived
    • evidence
  • reviews
  • specs
  • spikes
  • agents
  • auth
    • Temper auth & security
    • The authorization seam (`temper-services::auth`)
    • Cognitive-map & resource authoring authorization
    • JWT verification
    • The issuer / resource-server boundary & the machine-token contract
    • The internal reconcile channel
  • code-reviews
  • cognitive-maps
  • decisions
  • development
  • guides
    • Building a cognitive map from a large corpus
    • Using temper from Claude Desktop (and claude.ai)
    • Cloud Agent Development Guide
    • Ingesting a corpus into a context
    • Development setup
    • Drain operator queries (TraceQL)
    • Enterprise Install — Ground Up
    • Operator guide: read-only GitHub credential via a BYO App + Vercel Connect
    • Operator guide: provisioning a GitHub connection in temper
    • Installing Temper
    • Delivering L0 Kernel Cogmap Content
    • Machine Credentials
    • OpenTelemetry Setup
    • Operational Memory
    • Bootstrapping a Temper org
    • Releasing Temper
    • Self-Hosting Temper with Okta
    • Self-Hosting Temper with a SAML IdP
    • Self-Hosting Temper
    • The Slack Integration — identity, credentials, and what revocation actually means
    • Operator guide: `@temper` on Slack — end-to-end setup
    • Bootstrapping a team's self-cognition cognitive map
    • Working with Teams
    • Integrating Ruby with temper-rb
    • Deploying an Eve agent to Vercel (the steward and the citation auditor)
    • WS6 Collapsed-Schema Dev Environment
  • research
  • security
  • specs
  • doors
    • Building against Temper
    • Running Temper
    • Using Temper
  • Temper /api/query — the compositional read surface
    • Run a declared composition of situated acts.
    • Schemas
      • Composition
      • OutcomeDeclaration
      • ReturnSpec
      • Intention
      • StageNode
      • ActInvocation
      • CombineNode
      • StageInput
      • StageRelation
      • Disclosure
      • QueryResponse
      • StageResult
      • StageOutput
      • ScoreKind
      • Scoring
      • ResourceHit
      • CompositionTrace
      • StageTrace
      • InputSource
      • NarrowedBy
      • StageName
      • ActName
      • IdKind
      • IdSet
      • BoundTerm
      • Extent
      • StageDisposition
      • ActRefusal
      • PlanRefusal
      • RefusalReason
      • ActQuantity
      • QuantityScale
      • ResourceFilter
      • EdgeFilter
      • PropertyPredicate
      • PropertyOp
      • ResourceSection
      • EdgeKind
      • OrdOp
      • CogmapId
      • ContextId
      • IdProvenance
      • FacetPredicate
      • CombineOp
      • BlockId
      • MatchLocation
      • BodyStorage
      • ResourceId
      • IngestState
      • ManagedMeta
      • ProfileId
      • ResourceView
      • Polarity
      • ViaEntry
      • LensId
      • RegionId
      • CogmapRegionRow
      • RegionHit
      • StageInputTrace
      • Standing
      • ActorAuthority
      • Refusal
      • SystemAccessDetails
      • PlanRefusalDetails
      • ErrorDetails
      • ErrorDetail
      • ErrorBody
  • Temper Cloud API
    • Access
      • POST /api/access/requests — submit a join request for the gating team.
      • GET /api/access/requests/me — check own join request status.
      • DELETE /api/access/requests/me — withdraw a pending join request.
      • POST /api/access/reviews — a revoked principal asks an admin to reconsider (spec D15).
      • GET /api/access/settings — read public system settings.
    • Slack Link
      • Disconnect any principal. Operator path — offboarding and stuck users.
      • Disconnect EVERY Slack principal bound to the caller's own profile.
    • Auditor
      • auditor_dispatch
      • auditor_sweep
      • complete_auditor_job
    • Graph
      • POST /api/cogmaps/{id}/graph/slice — R4 cogmap-scoped neighborhood slice.
      • GET /api/graph/cogmaps/{id}/panorama — enter-a-cogmap Tier-0 interior.
      • GET /api/graph/contexts/composition — Beat E Tier-1: the force-graph composition of a container's (or a residual bucket's) members.
      • GET /api/graph/contexts/panorama — Beat E Tier-0: goal-container territories + residual tray.
      • GET /api/graph/home — the you→teams→cogmaps membership home.
      • GET /api/graph/regions/composition — Beat D region→resources composition drill.
    • Cognitive Maps
      • list_cognitive_maps
      • genesis
      • get_cognitive_map
      • reconcile
      • analytics
      • grant_cogmap_access
      • revoke_cogmap_access
      • materialize
      • materialize_delta
      • region_metrics
      • shape
      • bind_team
      • unbind_team
    • Contexts
      • list_contexts
      • create_context
      • get_context
      • context_materialize
      • reassign
      • context_region_metrics
      • rename
      • context_shape
      • share_team
      • unshare_team
    • Events
      • cursor
      • GET /api/graph/elements/{kind}/{id}/trail — R5 element event-trail. kind ∈ {node, edge}.
    • Facets
      • set_facet
      • Read the live facets of one edge.
      • Set a facet whose owner is an **edge** rather than a resource.
      • Read the live facets of one resource — the confirming read for a write that steers region formation and Atlas grouping.
    • Health
      • health_check
    • Ingest
      • create_ingest
      • update_ingest
      • list_blocks
      • append_block
      • finalize_resource
    • Invitations
      • accept
      • decline
      • list_mine
      • list_team_invitations
      • revoke_team_invitation
      • create_team_invitation
    • Invocations
      • list_invocations
      • open
      • show
      • close
    • Profile
      • get_profile
      • update_profile
      • list_auth_links
    • Query
      • `POST /api/query`.
        POST
    • Relationships
      • assert
      • fold
      • retype
      • reweight
    • Resources
      • `GET /api/resources` — **one response type, unconditionally.**
      • create_resource
      • get_resource
      • delete_resource
      • update_resource
      • List the finding at `{id}`'s citation-audit trail — one row per audit, each naming its auditor.
      • Record an auditor's signed defensibility verdict on one `(block, source)` citation of the finding at `{id}`. CONFORM to `handlers::edges::assert` (the sibling authored-write handler): thin — build the command, dispatch it, map the error. No persistence he
      • get_content
      • list_resource_edges
      • resource_evidence
      • grant_resource_access
      • revoke_resource_access
      • resource_lineage
      • provenance
      • annotate_resource
    • Meta
      • get_meta
      • update_meta
    • Reassign
      • reassign_resource
      • reassign_team
    • Search
      • `POST /api/search`.
    • Steward
      • candidates
      • dispatch
      • sweep
      • delta
      • advance
    • Teams
      • list_teams
      • create_team
      • detail
      • delete_team
      • update_team
      • add_member
      • remove_member
      • change_role
    • Schemas
      • AcceptInvitationResponse
      • ActInput
      • ActInvocation
      • ActName
      • ActQuantity
      • ActRefusal
      • ActorAuthority
      • AddMemberRequest
      • AdvanceWatermarkAck
      • AdvanceWatermarkRequest
      • AgentAuthorship
      • AppendBlockPayload
      • AssertRelationshipRequest
      • AtlasEdge
      • AtlasHome
      • AtlasNode
      • AtlasSubgraph
      • AuditCitation
      • AuditSweepRow
      • AuditorDispatchTickRequest
      • AuditorDispatchTickResponse
      • AuditorJobCompleteAck
      • BindTeamOutcome
      • BindTeamRequest
      • BlockId
      • BlockProvenanceRow
      • BlocksResponse
      • BodyStorage
      • Bridge
      • BulkReassignAck
      • BulkReassignRequest
      • ChangeRoleRequest
      • CharterBlock
      • CharterDisposition
      • CitationAuditRequest
      • CitationAuditRow
      • ClaimedAuditJob
      • ClaimedJob
      • CloseInvocationRequest
      • CogmapAnalyticsRow
      • CogmapDetail
      • CogmapFoundationRow
      • CogmapGrantBody
      • CogmapId
      • CogmapRegionMetricsRow
      • CogmapRegionRow
      • CogmapRegulationRow
      • CogmapRevokeBody
      • CogmapRow
      • CogmapStaleness
      • CombineNode
      • CombineOp
      • Composition
      • CompositionTrace
      • ConfidenceBand
      • ContentResponse
      • ContextCreateRequest
      • ContextId
      • ContextOwnerRef
      • ContextPanorama
      • ContextRow
      • ContextRowWithCounts
      • CorrelationId
      • CreateCogmapOutcome
      • CreateCogmapRequest
      • CreateInvitationRequest
      • CreateRequestBody
      • CreateReviewBody
      • DeleteResponse
      • DeviceOverrides
      • DispatchTickRequest
      • DispatchTickResponse
      • Disposition
      • DriftSweepRow
      • EdgeFacetRow
      • EdgeFacetSetRequest
      • EdgeFacetsResponse
      • EdgeFilter
      • EdgeId
      • EdgeKind
      • ElementEvent
      • ElementKind
      • EmbedDispatchSummary
      • Entitlements
      • ErrorBody
      • ErrorDetail
      • ErrorDetails
      • EventCursorResponse
      • EventTrail
      • ExactArm
      • ExactHit
      • Extent
      • FacetAck
      • FacetPredicate
      • FacetSetRequest
      • FinalizePayload
      • FoldRelationshipRequest
      • GrantOutcome
      • GraphEdgeRow
      • GroupKeyMeta
      • HealthResponse
      • HomeCogmap
      • HomeContext
      • IdKind
      • IdProvenance
      • IdSet
      • IdpRevocation
      • IngestCreateResponse
      • IngestDelta
      • IngestPayload
      • IngestState
      • InheritedReadGrant
      • InheritedShare
      • InputSource
      • Intention
      • InvitationStatus
      • InvitationTokenRequest
      • InviteeInvitation
      • InvocationAck
      • InvocationActRow
      • InvocationCloseAck
      • InvocationId
      • InvocationSummary
      • InvocationView
      • JoinRequest
      • JoinRequestStatus
      • LensId
      • LineageNode
      • ManagedMeta
      • MatchLocation
      • MaterializeAck
      • MaterializeDelta
      • MaterializeRequest
      • MergePolicy
      • MetaUpdatePayload
      • NarrowedBy
      • NodeHome
      • OpenInvocationRequest
      • OrdOp
      • OrphanNode
      • OutcomeDeclaration
      • PlanRefusal
      • PlanRefusalDetails
      • Polarity
      • Profile
      • ProfileAuthLink
      • ProfileId
      • ProfileUpdateRequest
      • ProfileWithEntitlements
      • PropertyOp
      • PropertyPredicate
      • ProvenanceSource
      • PublicSystemSettings
      • QuantityScale
      • QueryResponse
      • ReassignAck
      • ReassignContextOutcome
      • ReassignContextRequest
      • ReassignResourceRequest
      • ReconcileCogmapRequest
      • ReconcileEdge
      • ReconcileEdgeTombstone
      • ReconcileEntry
      • ReconcileOutcome
      • ReconcileTelos
      • ReconcileTelosBlock
      • ReconcileTombstone
      • Refusal
      • RefusalReason
      • RegionHit
      • RegionId
      • RelationshipAck
      • RemoveMemberOutcome
      • RenameContextOutcome
      • RenameContextRequest
      • ResidualBucket
      • ResidualContext
      • ResidualGroups
      • ResidualOwnedReach
      • ResourceAnnotateRequest
      • ResourceCreateRequest
      • ResourceFacetRow
      • ResourceFacets
      • ResourceFacetsResponse
      • ResourceFilter
      • ResourceGrantBody
      • ResourceHit
      • ResourceId
      • ResourceLineage
      • ResourceListResponse
      • ResourceRevokeBody
      • ResourceSection
      • ResourceSortField
      • ResourceUpdateRequest
      • ResourceView
      • ReturnSpec
      • RetypeRelationshipRequest
      • RevokeOutcome
      • ReweightRelationshipRequest
      • ScoreKind
      • Scoring
      • SearchParams
      • SearchReason
      • SearchResponse
      • SearchResultRow
      • SearchScope
      • SearchScopeInfo
      • SegmentInfo
      • SegmentedBegin
      • SegmentedBeginResponse
      • ShareContextOutcome
      • ShareContextRequest
      • SlackDisconnectRequest
      • SlackDisconnectResponse
      • SlackDisconnectedPrincipal
      • SliceRequest
      • SortOrder
      • StageDisposition
      • StageInput
      • StageInputTrace
      • StageName
      • StageNode
      • StageOutput
      • StageRelation
      • StageResult
      • StageTrace
      • Standing
      • StandingShape
      • Subscription
      • SubscriptionOverride
      • SystemAccessDetails
      • TeamCreateRequest
      • TeamDetail
      • TeamInvitation
      • TeamMemberDetail
      • TeamMemberRow
      • TeamMemberSource
      • TeamRole
      • TeamRow
      • TeamUpdateRequest
      • Territory
      • TerritoryKind
      • TerritoryOverview
      • UnbindTeamOutcome
      • UnshareContextOutcome
      • VaultConfig
      • ViaEntry
      • WideArm
      • WideHit
  1. Query

`POST /api/query`.

POST
/api/query
The door onto the composition contract: a caller sends a plan, the server answers it or refuses
it. Everything before this route built a door that nothing could knock on.
The pipeline is not assembled here. [query_read::prepare] owns the order — shape-gate,
then embed, then validate — and is the only constructor of a ValidatedComposition, so this
handler cannot run an unvalidated plan even by mistake. Spelling the order out here would make
this the second place that knows it, and the day the MCP tool and the CLI arrive, the third and
fourth.
The refusal branch is the only thing that differs from [super::search::search], whose
shape this otherwise copies: search_select takes params and answers, while prepare may
refuse first.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200OK
application/json
One entry in returned per outcome.returns — no more, no fewer — keyed by stage name rather than merged into one ordered list, so combining two acts' rows takes a deliberate act by the caller. trace covers EVERY stage, including those whose rows were not returned, because the pipe carries ids rather than rows and an untraced composition is a black box with an answer at the end.
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '/api/query' \
--header 'X-Temper-Surface;' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "outcome": {
        "returns": [
            {
                "stage": "string",
                "with": [
                    "body"
                ]
            }
        ]
    },
    "stages": [
        {
            "act": "find-exact",
            "edge_filter": null,
            "inputs": [
                {
                    "as": "bound",
                    "from": "caller",
                    "ids": {
                        "ids": [
                            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                        ],
                        "kind": "resource",
                        "provenance": null
                    }
                }
            ],
            "intention": null,
            "name": "string",
            "properties": [
                {
                    "key": "string",
                    "op": {
                        "op": "has_key"
                    }
                }
            ],
            "resource_filter": null,
            "terms": {
                "property1": 0,
                "property2": 0
            }
        }
    ]
}'
Response Response Example
200 - Example 1
{
    "returned": {
        "property1": {
            "act": "find-exact",
            "disposition": "answered",
            "extent": {
                "extent": "complete"
            },
            "input_ids": 0,
            "input_unusable": 0,
            "narrowed_by": [
                {
                    "admitted": 0,
                    "excluded": 0,
                    "key": "string",
                    "value": "string"
                }
            ],
            "orders_by": null,
            "produced": {
                "hits": [
                    {
                        "located_at": null,
                        "resource": {
                            "body_hash": "string",
                            "body_storage": null,
                            "cogmap_id": "b2008c45-9f31-4aae-8f49-0cadcb6ad25e",
                            "cogmap_name": "string",
                            "content": "string",
                            "context_name": "string",
                            "context_owner_ref": "string",
                            "context_ref": "string",
                            "context_slug": "string",
                            "created": "2019-08-24T14:15:22.123Z",
                            "doc_type_name": "string",
                            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                            "ingest_state": null,
                            "is_active": true,
                            "kb_context_id": null,
                            "managed_meta": {
                                "temper-branch": "string",
                                "temper-effort": "string",
                                "temper-llm-model": "string",
                                "temper-llm-run": "string",
                                "temper-mode": "string",
                                "temper-pr": "string",
                                "temper-provenance": "string",
                                "temper-seq": 0,
                                "temper-stage": "string",
                                "temper-status": "string"
                            },
                            "open_meta": null,
                            "origin_uri": "string",
                            "originator_profile_id": "20c67e1c-fb7d-4020-a7af-db154cdd188d",
                            "owner_handle": "string",
                            "owner_profile_id": "21e0f360-ea66-4de2-b817-b59c51592556",
                            "ref": "string",
                            "title": "string",
                            "updated": "2019-08-24T14:15:22.123Z"
                        },
                        "scoring": {
                            "score": 0,
                            "score_kind": "fts_norm"
                        },
                        "via": [
                            {
                                "edge_kind": "express",
                                "label": "string",
                                "polarity": "forward",
                                "seed_id": "28b1c536-e0f9-4dd7-9906-e2ce7cf3a870",
                                "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81",
                                "target_id": "d3bcdc92-4191-401b-ad0c-42056c6efab9"
                            }
                        ]
                    }
                ],
                "produced": "resources"
            },
            "refusal": null,
            "terms_applied": {
                "property1": 0,
                "property2": 0
            },
            "total": 0
        },
        "property2": {
            "act": "find-exact",
            "disposition": "answered",
            "extent": {
                "extent": "complete"
            },
            "input_ids": 0,
            "input_unusable": 0,
            "narrowed_by": [
                {
                    "admitted": 0,
                    "excluded": 0,
                    "key": "string",
                    "value": "string"
                }
            ],
            "orders_by": null,
            "produced": {
                "hits": [
                    {
                        "located_at": null,
                        "resource": {
                            "body_hash": "string",
                            "body_storage": null,
                            "cogmap_id": "b2008c45-9f31-4aae-8f49-0cadcb6ad25e",
                            "cogmap_name": "string",
                            "content": "string",
                            "context_name": "string",
                            "context_owner_ref": "string",
                            "context_ref": "string",
                            "context_slug": "string",
                            "created": "2019-08-24T14:15:22.123Z",
                            "doc_type_name": "string",
                            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                            "ingest_state": null,
                            "is_active": true,
                            "kb_context_id": null,
                            "managed_meta": {
                                "temper-branch": "string",
                                "temper-effort": "string",
                                "temper-llm-model": "string",
                                "temper-llm-run": "string",
                                "temper-mode": "string",
                                "temper-pr": "string",
                                "temper-provenance": "string",
                                "temper-seq": 0,
                                "temper-stage": "string",
                                "temper-status": "string"
                            },
                            "open_meta": null,
                            "origin_uri": "string",
                            "originator_profile_id": "20c67e1c-fb7d-4020-a7af-db154cdd188d",
                            "owner_handle": "string",
                            "owner_profile_id": "21e0f360-ea66-4de2-b817-b59c51592556",
                            "ref": "string",
                            "title": "string",
                            "updated": "2019-08-24T14:15:22.123Z"
                        },
                        "scoring": {
                            "score": 0,
                            "score_kind": "fts_norm"
                        },
                        "via": [
                            {
                                "edge_kind": "express",
                                "label": "string",
                                "polarity": "forward",
                                "seed_id": "28b1c536-e0f9-4dd7-9906-e2ce7cf3a870",
                                "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81",
                                "target_id": "d3bcdc92-4191-401b-ad0c-42056c6efab9"
                            }
                        ]
                    }
                ],
                "produced": "resources"
            },
            "refusal": null,
            "terms_applied": {
                "property1": 0,
                "property2": 0
            },
            "total": 0
        }
    },
    "trace": {
        "stages": [
            {
                "act": "find-exact",
                "disposition": "answered",
                "extent": {
                    "extent": "complete"
                },
                "input_ids": 0,
                "input_unusable": 0,
                "inputs": [
                    {
                        "ids": 0,
                        "relation": "bound",
                        "source": {
                            "source": "upstream",
                            "stage": "string"
                        }
                    }
                ],
                "narrowed_by": [
                    {
                        "admitted": 0,
                        "excluded": 0,
                        "key": "string",
                        "value": "string"
                    }
                ],
                "produced_ids": 0,
                "refusal": null,
                "stage": "string",
                "terms_applied": {
                    "property1": 0,
                    "property2": 0
                }
            }
        ]
    }
}
Modified at 2026-08-19 12:26:18
Previous
list_auth_links
Next
assert
Built with