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.

GET /bounties, GET /submissions, and GET /disputes return legacy 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.

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.
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.
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.
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.
  2. Current submission records.
  3. Current dispute records.
  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