Documentation

Mortar API

HTTP and websocket read API exposed by mortar.

Mortar serves Mosaic bounty data over HTTP and websocket. Contract state remains settlement authority.

HTTP Routes

MethodRouteReturn
GET/healthService status and indexer flags.
GET/bountiesBounty records or a paged bounty response.
GET/bounties/{bounty_id}One bounty record.
GET/bounties/{bounty_id}/overviewOne bounty, its submissions, and their disputes.
GET/submissionsSubmission records or a paged submission response.
GET/submissions?bounty_id={id}Submission records for one bounty.
GET/submissions/{submission_id}One submission record.
GET/submissions/{submission_id}/overviewOne submission, its bounty, and its disputes.
GET/disputesDispute records or a paged dispute response.
GET/disputes?bounty_id={id}Paged dispute records for one bounty.
GET/disputes?submission_id={id}Dispute records for one submission.
GET/disputes/{dispute_id}One dispute record.
GET/disputes/{dispute_id}/overviewOne dispute, its submission, its bounty, and sibling disputes.

Single-record and overview routes return 404 when the target record is unavailable.

List Query Params

List routes accept:

ParamMeaning
limitPage size from 1 to 100. Defaults to 50 for paged responses.
cursorOffset cursor returned by a prior page. Invalid cursors read from 0.
qText search across IDs, status, actors, metadata, transaction hash, and route-specific text fields.
sortSort key. Unknown values use id.
dirasc or desc. Unknown values use desc.
chain_idDeployment chain filter. The active GIWA Sepolia chain ID is 91342.
contract_addressDeployment contract filter. Use with chain_id for collision-safe reads.

GET /bounties, GET /submissions, and GET /disputes return unpaged arrays when no paging or search params are supplied. Supplying limit, cursor, or q returns a page object. GET /disputes?bounty_id=... also returns a page object.

Page object:

{
  "items": [],
  "total": 0,
  "limit": 50,
  "cursor": null,
  "next_cursor": null
}

Bounty page rows include submission_count. Submission page rows and submission overview records include dispute_count.

Every bounty, submission, and dispute record includes chain_id and contract_address. IDs are only unique within a deployment. Always send both fields on single-record and overview routes. Parent filters using bounty_id or submission_id also require both deployment fields.

Sort keys:

  • Bounties: id, created_at, deadline, reward, bounty_amount, bond, bond_amount, status, poster, prompt, submissions, submission_count.
  • Submissions: id, created_at, submitted, bounty, bounty_id, bond, bond_amount, status, claimant, content, review, review_deadline, disputes, dispute_count.
  • Disputes: id, created_at, submitted, bounty, bounty_id, submission, submission_id, bond, bond_amount, status, challenger, reason.

Bounty Fields

FieldMeaning
idBounty ID.
chain_idDeployment chain ID.
contract_addressMosaic deployment address.
promptStored prompt field. Current indexer mirrors metadata_uri here.
bounty_amountReward amount in USDC base units.
fee_amountPost fee amount in USDC base units.
bond_amountSubmission bond in USDC base units.
durationBounty duration in seconds.
statusopen, resolved, or refunded.
posterPoster address.
deadlineBounty deadline timestamp.
challenge_windowReview window in seconds.
metadata_uriBounty metadata URI.
metadata_hashBounty metadata hash.
tx_hashSource transaction hash.
block_numberSource block number.
log_indexSource log index.
created_atMortar row creation timestamp.
submission_countIncluded on paged and overview bounty records.

Submission Fields

FieldMeaning
idSubmission ID.
chain_idDeployment chain ID.
contract_addressMosaic deployment address.
bounty_idParent bounty ID.
tile_idSubmitter address field.
contentStored content field. Current indexer mirrors metadata_uri here.
bond_amountSubmission bond in USDC base units.
review_deadlineSubmission review deadline timestamp.
statussubmitted, disputed, accepted, rejected, or refunded.
claimantSubmitter address.
metadata_uriSubmission metadata URI.
metadata_hashSubmission metadata hash.
tx_hashSource transaction hash.
block_numberSource block number.
log_indexSource log index.
created_atMortar row creation timestamp.
dispute_countIncluded on paged and overview submission records.

Dispute Fields

FieldMeaning
idDispute ID.
chain_idDeployment chain ID.
contract_addressMosaic deployment address.
bounty_idParent bounty ID.
submission_idDisputed submission ID.
challenger_idGrout address.
reasonStored reason field. Current indexer mirrors metadata_uri here.
bond_amountDispute bond in USDC base units.
statuspending_human_review, upheld, rejected, or cancelled.
metadata_uriDispute metadata URI.
metadata_hashDispute metadata hash.
tx_hashSource transaction hash.
block_numberSource block number.
log_indexSource log index.
created_atMortar row creation timestamp.

HTTP Caching and Limits

Read responses include Cache-Control and weak ETag headers. Supplying a matching If-None-Match returns 304.

HTTP rate limits apply to every route except /health. Rate-limited responses return 429 with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

Websocket

WS /ws/events

Connection sequence:

  1. Current bounty records for the configured active deployment.
  2. Current submission records for the configured active deployment.
  3. Current dispute records for the configured active deployment.
  4. Live updates.

Websocket connection and message limits close the socket with code 1008 when exceeded.

Websocket Payloads

TypePayload
bounty.createdBounty record.
submission.createdSubmission record.
dispute.createdDispute record.
dispute.resolvedDispute record.
dispute.cancelledDispute record.
bounty.finalizedBounty record.
bounty.refundedBounty record.
submission.refundedSubmission record.

On this page