Skip to content

Developers

API reference

Munja shows 2 or 3 approved partner offers on a business's confirmation page, confirmation email or exit popup. A host (the business) calls POST /v1/offers with its publishable key, renders the offers, and calls the accept endpoint when the customer says yes. Partners pay per yes. This spec lists only endpoints that exist today. Test-mode keys (pk_test_, sk_test_) touch test data only.

Generated from /openapi.json, OpenAPI 3.1, version 0.1.0.

Conventions

  • Base URL https://getmunja.com/v1. JSON in and out, snake_case keys, money as integer cents, times as Unix seconds.
  • Browser endpoints take a publishable key (pk_test_...) in the body or query. Server endpoints take a secret key as Authorization: Bearer sk_test_....
  • Errors: { error: { type, code, message, param, doc_url } } with a matching HTTP status.
  • Server POST calls honor an Idempotency-Key header for 24 hours. Responses carry Request-Id.
  • Ignore fields you do not know. New ones can appear.

Offers

Browser-safe endpoints that use a publishable key (pk_test_...).

Get the offers for one order

POST/v1/offersPublishable key or none

Returns the offers to show for one order at one moment, with an impression token on each offer. The same order and shop returns the same offers (replayed: true) with no new impression. customer.phone is accepted and discarded. If an order signature is sent and does not match, the call fails with invalid_signature. Accounts that require signed orders also fail with signature_required when it is missing.

Body

FieldTypeDescription
key requiredstringPublishable key. Safe in a browser.
orderobject
order.idstring
order.signaturestringHex HMAC-SHA256 of order_id.lowercased_email with your signing secret (mss_test_...). Compute it on your server.
momentstring
surfaceSurface
contextobjectOrder facts that decide relevance, such as zip, newCustomer, orderTotal. Up to 4000 characters of JSON.
customer requiredobject
customer.emailstring
customer.namestring
customer.phonestringAccepted and discarded.
seconds_on_pagenumber
page_urlstring

Responses

200The offers, possibly an empty list. Check empty_reason when it is empty.
400A parameter is invalid.
401Unknown publishable key, bad signature or signature required.
429Rate limited.

Get the offers for one order (query string form)

GET/v1/offersPublishable key or none

Same as POST, with the fields as query parameters. Context fields go in context[name]=value, and zip is a shortcut for context[zip].

Parameters

FieldTypeDescription
key (query) requiredstring
order_id (query)string
signature (query)string
moment (query)string
surface (query)Surface
email (query)string
name (query)string
zip (query)string
page_url (query)string

Responses

200The offers.
400A parameter is invalid.
401Unknown publishable key, bad signature or signature required.
429Rate limited.

Count an offer as seen

POST/v1/offers/{token}/viewPublishable key or none

Only needed for the Featured layout, where offers after the first count as shown when the customer actually sees them.

Parameters

FieldTypeDescription
token (path) requiredstringThe impression token from the impression field of an offer.

Responses

200Counted.
429Rate limited.

Record the customer's yes

POST/v1/offers/{token}/acceptPublishable key or none

Call when the customer presses the offer button. Creates the lead and the consent record, charges the partner and delivers the signed webhooks. Safe to retry: the same lead comes back. Offers with yes_tier of call or quote need phone, and quote also needs zip and details, plus consent: true only when the customer ticked the call-consent box.

Parameters

FieldTypeDescription
token (path) requiredstringThe impression token from the impression field of an offer.

Body

FieldTypeDescription
emailstring
namestring
phonestring
zipstring
detailsstring
consentboolean

Responses

201Accepted.
400Invalid input, for example phone_invalid, phone_required, zip_invalid, details_invalid or consent_required. Nothing is shared or charged.
404No such offer.
429Rate limited.

Customer said no thanks

POST/v1/offers/{token}/dismissPublishable key or none

Parameters

FieldTypeDescription
token (path) requiredstringThe impression token from the impression field of an offer.

Body

FieldTypeDescription
allbooleanDismiss the whole unit.

Responses

200Dismissed.
429Rate limited.

Report an offer or opt out of a partner

POST/v1/offers/{token}/reportPublishable key or none

Nothing is charged.

Parameters

FieldTypeDescription
token (path) requiredstringThe impression token from the impression field of an offer.

Body

FieldTypeDescription
kind"complaint" | "opt_out"
reasonstring

Responses

200Recorded.
404No such offer.
429Rate limited.

Send the customer on to the partner

GET/v1/offers/{token}/continuePublishable key or none

Open this URL in the customer's browser after a yes. It counts the first visit (never billed) and redirects to the partner's page. It returns 404 before a yes.

Parameters

FieldTypeDescription
token (path) requiredstringThe impression token from the impression field of an offer.

Responses

302Redirect to the partner's landing page.
404Not available. Nothing was shared.
429Rate limited.

List configured offers

GET/v1/offers_catalogSecret key

Partner keys list their offers. Host keys list offers placed on their account. A yes still charges the partner price_cents through the normal billing path.

Parameters

FieldTypeDescription
limit (query)integer
starting_after (query)string

Responses

200A list.
401Missing or invalid secret key.

Create a partner offer

POST/v1/partner_offersSecret key

Writes the offer. price_cents is what a later yes charges. The host share is not a parameter. Sandbox offers in test mode can be shown at once. Other offers stay in review. Live mode requires a person to approve the account.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
headline requiredstring
body requiredstring
price_cents requiredinteger
ctastring
categorystring

Responses

201Created.
400Invalid copy or price.
403Not a partner key, or live mode is not approved.

List a partner's offers

GET/v1/partner_offersSecret key

Responses

200A list.
403Not a partner key.

Update a partner offer

POST/v1/partner_offers/{id}Secret key

Can change copy, price or pause state. Cannot refund a yes or change the host share.

Parameters

FieldTypeDescription
id (path) requiredstring

Body

FieldTypeDescription
headlinestring
bodystring
ctastring
price_centsinteger
status"live" | "paused"

Responses

200Updated.
404No such offer.

Get one partner offer

GET/v1/partner_offers/{id}Secret key

Parameters

FieldTypeDescription
id (path) requiredstring

Responses

200The offer.
404No such offer.

Place an offer on a host

POST/v1/placementsSecret key

Approves an offer for this host. Does not charge anyone.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
offer requiredstring

Responses

201Placed.
403Not a host key, or live mode is not approved.
404No such offer.

List offers a host has placed

GET/v1/placementsSecret key

Responses

200A list.
403Not a host key.

Agents

Accepting an offer for a customer who consented, from an AI shopping agent.

Accept an offer for a customer who consented

POST/v1/agent/acceptPublishable key or none

For an AI shopping agent. Needs an offer_id and key from the offer catalog on the confirmation page, and an attestation of the customer's explicit consent. See also /openapi-agent.json.

Body

FieldTypeDescription
key requiredstring
offer_id requiredstring
consumer requiredobject
consumer.name requiredstring
consumer.email requiredstring
order requiredobject
order.id requiredstring
order.date requiredstring
order.zip requiredstring
attestation requiredobject
attestation.consumer_authorized requiredtrue
attestation.agent_name requiredstring
attestation.statement requiredstring
attestation.consent_token requiredstring
attestation.consented_at requiredstringWithin the last 24 hours.

Responses

200Duplicate: this customer already said yes to this partner in the last 30 days. Not charged.
201Accepted.
400A field is missing or invalid, or consent is missing or stale.
403The host or partner does not accept agent opt-ins.
409The offer is not available for this order.
429Rate limited.

Find local businesses

GET/v1/businessesSecret key

Secret key. Returns unclaimed listings and hosts who turned on assistant discovery. An unclaimed listing includes a public phone and website, is marked unclaimed, and is not bookable. No offer, payment, or partner placement is created. A customer's name, email, or phone is rejected.

Parameters

FieldTypeDescription
category (query) requiredstringTrade: plumber, hvac, cleaner, or mover.
zip (query)string
area (query)string
limit (query)integer

Responses

200Matches.
400Missing trade, or a customer field was sent.
401Missing or invalid secret key.

Ask to book a local business

POST/v1/businesses/{id}/bookSecret key

With AI lead billing off, an unclaimed listing records demand and returns unclaimed_not_bookable, and a claimed business is not booked. With AI_LEAD_BILLING_ENABLED=true, a claimed business that turned on Receive AI requests returns a request id and status. The key cannot set the price, mark the job kept, or consent for the customer. An unclaimed listing is still not booked or charged.

Parameters

FieldTypeDescription
id (path) requiredstring
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
categorystring
zipstring
areastring

Responses

201Request opened.
400A customer field was sent, or the assistant tried to consent for the customer.
404No such listing.
409Unclaimed listings are not bookable (unclaimed_not_bookable). A claimed business that has not opted in returns booking_not_offered. An agent cannot set the price (agent_cannot_set_price) or mark kept (agent_cannot_mark_kept).

Read an AI request

GET/v1/ai_requests/{id}Secret key

Status for the platform key that opened the request. Does not include customer contact details.

Parameters

FieldTypeDescription
id (path) requiredstring

Responses

200The request.
404No such request.

Report what the assistant observed

POST/v1/ai_requests/{id}/reportSecret key

Stores kept, seated, or no_show as a report. It does not mark the job kept, set a price, or charge anyone.

Parameters

FieldTypeDescription
id (path) requiredstring
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
outcome required"kept" | "seated" | "no_show"

Responses

200Report stored. Status is unchanged unless the business or the customer already confirmed.
403The key tried to set a price or mark the job kept.
404No such request.

Create a test-mode account

POST/v1/sandbox/accountsPublishable key or none

No API key. Returns test keys once. Rate limited. Live keys are not created. Partners pay per yes in test mode through the normal charge. A person must add a payment method and approve the account before live traffic.

Body

FieldTypeDescription
name requiredstring
role"host" | "partner" | "pair"
agentstring
owner_emailstring

Responses

201Created.
429Too many sandbox accounts.

Add test-mode funds

POST/v1/sandbox/balanceSecret key

Same test-mode top-up as the dashboard. Cannot credit a live balance and does not change the price of a yes.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
amount_cents requiredintegerCents. The dashboard minimum applies.

Responses

201Funded in test mode.
403Not a sandbox partner, or the key is live.

Leads

Server endpoints that use a secret key (sk_test_...).

Record a customer's yes from your server

POST/v1/leadsSecret key

Merchant secret key. For hosts that render offers themselves and record the yes server side. Same email and partner within 30 days is recorded as duplicate and not charged. Send the exact disclosure text the customer saw.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
offer_id requiredstring
email requiredstring
disclosure_text requiredstring
contactobject
surfacestring

Responses

201Recorded.
400Invalid input, or the email domain cannot receive mail.
401Missing or invalid secret key.
403Not a merchant key, or offers are turned off.
404No such live offer.

List the latest 100 leads

GET/v1/leadsSecret key

Contact details are never listed. Partners receive them in the signed lead.created webhook. Use limit (1 to 100, default 100) and starting_after (an id from the previous page).

Parameters

FieldTypeDescription
limit (query)integer
starting_after (query)stringId of the last object on the previous page.

Responses

200A list.
401Missing or invalid secret key.

Ask for a refund on a lead

POST/v1/refund_requestsSecret key

Partner secret key. One request per lead, within 14 days.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
lead requiredstring
reason required"duplicate" | "wrong_contact" | "out_of_area" | "test" | "fraud" | "other"
notestring

Responses

201Requested.
400Invalid reason, or the lead cannot be refunded.
404No such lead.

Get one yes

GET/v1/leads/{id}Secret key

No customer contact. mj_id is the attribution id.

Parameters

FieldTypeDescription
id (path) requiredstring

Responses

200The yes.
404No such lead.

List attribution events

GET/v1/attribution_eventsSecret key

Yes, consent, delivery, conversion and revocation events for this account. Includes mj_id.

Parameters

FieldTypeDescription
limit (query)integer
starting_after (query)string

Responses

200A list.
401Missing or invalid secret key.

Get one attribution event

GET/v1/attribution_events/{id}Secret key

Parameters

FieldTypeDescription
id (path) requiredstring

Responses

200The event.
404No such event.

Webhook endpoints

Where Munja sends signed events.

Create a webhook endpoint

POST/v1/webhook_endpointsSecret key

The signing secret (whsec_...) is returned once, in this response. The URL must be https, unless it is a Munja sandbox inbox. If you omit events, a host endpoint listens for offer.accepted and a partner endpoint listens for lead.created.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
url requiredstring
descriptionstring
eventsEventType[]

Responses

201Created. Store the secret now.
400The URL is invalid or not https.
401Missing or invalid secret key.

List webhook endpoints

GET/v1/webhook_endpointsSecret key

Responses

200A list.
401Missing or invalid secret key.

Send a test event

POST/v1/webhook_endpoints/{id}/testSecret key

Sends webhook.test through the normal signed delivery. It does not create a yes.

Parameters

FieldTypeDescription
id (path) requiredstring

Responses

200Sent.
404No such endpoint.

Create a test webhook inbox

POST/v1/sandbox/listenersSecret key

Munja delivers test events, including offer.accepted, into this inbox. The signing secret is returned once.

Responses

201Created.
403Live keys cannot create an inbox.

Read the test webhook inbox

GET/v1/sandbox/inboxSecret key

Responses

200Events received.

Events

Event history.

List events

GET/v1/eventsSecret key

Newest first. Use limit and starting_after to page.

Parameters

FieldTypeDescription
limit (query)integer
starting_after (query)string

Responses

200A list.
401Missing or invalid secret key.

Get one event

GET/v1/events/{id}Secret key

Merchant events never include a name, email, phone or ZIP.

Parameters

FieldTypeDescription
id (path) requiredstring

Responses

200The event.
404No such event.

Conversions

Partner postbacks for what happened after a yes.

Report a conversion for a lead

POST/v1/conversionsSecret key

Partner secret key. Send mj_click_id (from the lead.created webhook) or lead. Idempotent on external_id.

Parameters

FieldTypeDescription
Idempotency-Key (header)stringSafe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422.

Body

FieldTypeDescription
mj_click_idstring
leadstring
type"quote" | "application" | "booking" | "purchase" | "custom"
external_id requiredstring
valueintegerCents.
currencystring
occurred_atinteger | stringUnix seconds or an ISO 8601 time.

Responses

200Already recorded.
201Recorded.
403Not a partner key.
404No matching lead.

Zapier host channel

Test-mode host endpoints used by the private Zapier app.

Check a test secret key

GET/v1/host/meSecret key

Returns the host name and whether follow-up email is on. Test-mode keys only.

Responses

200The host.
401Missing or invalid secret key.
503The host channel is switched off on this server (host_api_disabled).

List new yeses (ids only)

GET/v1/host/yesesSecret key

The latest 100 test-mode yeses. No customer contact details. Test-mode keys only.

Responses

200A list.
401Missing or invalid secret key.
503The host channel is switched off on this server (host_api_disabled).

Webhooks

A customer said yes on your page (host)

WEBHOOKoffer.accepted

Sent to host (merchant) endpoints. Never has a name, email, phone or ZIP. Verify X-Munja-Signature and de-duplicate on the event id.

Parameters

FieldTypeDescription
X-Munja-Signature (header) requiredstringt=<unix seconds>,v1=<hex HMAC-SHA256 of "t.body" with the endpoint secret>. Reject timestamps more than 5 minutes old.
X-Munja-Event-Id (header)string
X-Munja-Delivery-Attempt (header)string

Body

FieldTypeDescription
id requiredstring
object required"event"
type requiredEventType
livemode requiredboolean
created requiredintegerUnix seconds.
data requiredobject
data.objectobjectFor offer.accepted: id, offer, partner, price_cents, merchant_share_cents, surface, yes_tier, source, status, created.

Responses

200Return any 2xx within 10 seconds. Anything else retries after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours.

Objects

Offer

FieldTypeDescription
impression requiredstringThe token for view, accept, dismiss and report.
position requiredinteger
partner requiredstring
category requiredstring
headline requiredstring
body requiredstring
pricestring
perkstring
cta requiredstringThe button text.
consent requiredstringThe exact consent wording to show next to the button. Do not edit it.
consent_version requiredstring
yes_tier required"contact" | "call" | "quote"What the yes collects.
call_consentstringFor call and quote offers: the exact text next to the unchecked box.
logostring
terms_urlstring
link_outboolean
offer_idstring
acceptedboolean

OfferList

FieldTypeDescription
object required"offer_list"
decisionstring | null
livemode requiredboolean
data requiredOffer[]
momentMoment
empty_reasonstringWhy the list is empty. For your developer, never for shoppers.
drop_reasonsobject[]
replayedboolean
agentboolean

Acceptance

FieldTypeDescription
object required"acceptance"
lead requiredstring
status requiredstringaccepted, or duplicate for an agent accept.
partnerstring
messagestring
livemodeboolean
offer_codestring
landingUrlstring
continueUrlstring
sourcestring
chargedboolean

WebhookEvent

FieldTypeDescription
id requiredstring
object required"event"
type requiredEventType
livemode requiredboolean
created requiredintegerUnix seconds.
data requiredobject
data.objectobjectFor offer.accepted: id, offer, partner, price_cents, merchant_share_cents, surface, yes_tier, source, status, created.

Error

FieldTypeDescription
error requiredobject
error.type required"invalid_request_error" | "authentication_error" | "permission_error" | "rate_limit_error" | "idempotency_error" | "api_error"
error.code requiredstring
error.message requiredstring
error.paramstring | null
error.doc_urlstring