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
| Field | Type | Description |
|---|
key required | string | Publishable key. Safe in a browser. |
order | object | |
order.id | string | |
order.signature | string | Hex HMAC-SHA256 of order_id.lowercased_email with your signing secret (mss_test_...). Compute it on your server. |
moment | string | |
surface | Surface | |
context | object | Order facts that decide relevance, such as zip, newCustomer, orderTotal. Up to 4000 characters of JSON. |
customer required | object | |
customer.email | string | |
customer.name | string | |
customer.phone | string | Accepted and discarded. |
seconds_on_page | number | |
page_url | string | |
Responses
200 | The offers, possibly an empty list. Check empty_reason when it is empty. |
400 | A parameter is invalid. |
401 | Unknown publishable key, bad signature or signature required. |
429 | Rate 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
| Field | Type | Description |
|---|
key (query) required | string | |
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
200 | The offers. |
400 | A parameter is invalid. |
401 | Unknown publishable key, bad signature or signature required. |
429 | Rate 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
| Field | Type | Description |
|---|
token (path) required | string | The impression token from the impression field of an offer. |
Responses
200 | Counted. |
429 | Rate 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
| Field | Type | Description |
|---|
token (path) required | string | The impression token from the impression field of an offer. |
Body
| Field | Type | Description |
|---|
email | string | |
name | string | |
phone | string | |
zip | string | |
details | string | |
consent | boolean | |
Responses
201 | Accepted. |
400 | Invalid input, for example phone_invalid, phone_required, zip_invalid, details_invalid or consent_required. Nothing is shared or charged. |
404 | No such offer. |
429 | Rate limited. |
Customer said no thanks
POST/v1/offers/{token}/dismissPublishable key or none
Parameters
| Field | Type | Description |
|---|
token (path) required | string | The impression token from the impression field of an offer. |
Body
| Field | Type | Description |
|---|
all | boolean | Dismiss the whole unit. |
Responses
200 | Dismissed. |
429 | Rate limited. |
Report an offer or opt out of a partner
POST/v1/offers/{token}/reportPublishable key or none
Nothing is charged.
Parameters
| Field | Type | Description |
|---|
token (path) required | string | The impression token from the impression field of an offer. |
Body
| Field | Type | Description |
|---|
kind | "complaint" | "opt_out" | |
reason | string | |
Responses
200 | Recorded. |
404 | No such offer. |
429 | Rate 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
| Field | Type | Description |
|---|
token (path) required | string | The impression token from the impression field of an offer. |
Responses
302 | Redirect to the partner's landing page. |
404 | Not available. Nothing was shared. |
429 | Rate 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
| Field | Type | Description |
|---|
limit (query) | integer | |
starting_after (query) | string | |
Responses
200 | A list. |
401 | Missing 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
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
headline required | string | |
body required | string | |
price_cents required | integer | |
cta | string | |
category | string | |
Responses
201 | Created. |
400 | Invalid copy or price. |
403 | Not a partner key, or live mode is not approved. |
List a partner's offers
GET/v1/partner_offersSecret key
Responses
200 | A list. |
403 | Not 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
| Field | Type | Description |
|---|
id (path) required | string | |
Body
| Field | Type | Description |
|---|
headline | string | |
body | string | |
cta | string | |
price_cents | integer | |
status | "live" | "paused" | |
Responses
200 | Updated. |
404 | No such offer. |
Get one partner offer
GET/v1/partner_offers/{id}Secret key
Parameters
| Field | Type | Description |
|---|
id (path) required | string | |
Responses
200 | The offer. |
404 | No such offer. |
Place an offer on a host
POST/v1/placementsSecret key
Approves an offer for this host. Does not charge anyone.
Parameters
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
offer required | string | |
Responses
201 | Placed. |
403 | Not a host key, or live mode is not approved. |
404 | No such offer. |
List offers a host has placed
GET/v1/placementsSecret key
Responses
200 | A list. |
403 | Not 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
| Field | Type | Description |
|---|
key required | string | |
offer_id required | string | |
consumer required | object | |
consumer.name required | string | |
consumer.email required | string | |
order required | object | |
order.id required | string | |
order.date required | string | |
order.zip required | string | |
attestation required | object | |
attestation.consumer_authorized required | true | |
attestation.agent_name required | string | |
attestation.statement required | string | |
attestation.consent_token required | string | |
attestation.consented_at required | string | Within the last 24 hours. |
Responses
200 | Duplicate: this customer already said yes to this partner in the last 30 days. Not charged. |
201 | Accepted. |
400 | A field is missing or invalid, or consent is missing or stale. |
403 | The host or partner does not accept agent opt-ins. |
409 | The offer is not available for this order. |
429 | Rate 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
| Field | Type | Description |
|---|
category (query) required | string | Trade: plumber, hvac, cleaner, or mover. |
zip (query) | string | |
area (query) | string | |
limit (query) | integer | |
Responses
200 | Matches. |
400 | Missing trade, or a customer field was sent. |
401 | Missing 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
| Field | Type | Description |
|---|
id (path) required | string | |
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
category | string | |
zip | string | |
area | string | |
Responses
201 | Request opened. |
400 | A customer field was sent, or the assistant tried to consent for the customer. |
404 | No such listing. |
409 | Unclaimed 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
| Field | Type | Description |
|---|
id (path) required | string | |
Responses
200 | The request. |
404 | No 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
| Field | Type | Description |
|---|
id (path) required | string | |
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
outcome required | "kept" | "seated" | "no_show" | |
Responses
200 | Report stored. Status is unchanged unless the business or the customer already confirmed. |
403 | The key tried to set a price or mark the job kept. |
404 | No 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
| Field | Type | Description |
|---|
name required | string | |
role | "host" | "partner" | "pair" | |
agent | string | |
owner_email | string | |
Responses
201 | Created. |
429 | Too 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
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
amount_cents required | integer | Cents. The dashboard minimum applies. |
Responses
201 | Funded in test mode. |
403 | Not 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
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
offer_id required | string | |
email required | string | |
disclosure_text required | string | |
contact | object | |
surface | string | |
Responses
201 | Recorded. |
400 | Invalid input, or the email domain cannot receive mail. |
401 | Missing or invalid secret key. |
403 | Not a merchant key, or offers are turned off. |
404 | No 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
| Field | Type | Description |
|---|
limit (query) | integer | |
starting_after (query) | string | Id of the last object on the previous page. |
Responses
200 | A list. |
401 | Missing 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
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
lead required | string | |
reason required | "duplicate" | "wrong_contact" | "out_of_area" | "test" | "fraud" | "other" | |
note | string | |
Responses
201 | Requested. |
400 | Invalid reason, or the lead cannot be refunded. |
404 | No such lead. |
Get one yes
GET/v1/leads/{id}Secret key
No customer contact. mj_id is the attribution id.
Parameters
| Field | Type | Description |
|---|
id (path) required | string | |
Responses
200 | The yes. |
404 | No such lead. |
List attribution events
GET/v1/attribution_eventsSecret key
Yes, consent, delivery, conversion and revocation events for this account. Includes mj_id.
Parameters
| Field | Type | Description |
|---|
limit (query) | integer | |
starting_after (query) | string | |
Responses
200 | A list. |
401 | Missing or invalid secret key. |
Get one attribution event
GET/v1/attribution_events/{id}Secret key
Parameters
| Field | Type | Description |
|---|
id (path) required | string | |
Responses
200 | The event. |
404 | No 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
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
url required | string | |
description | string | |
events | EventType[] | |
Responses
201 | Created. Store the secret now. |
400 | The URL is invalid or not https. |
401 | Missing or invalid secret key. |
List webhook endpoints
GET/v1/webhook_endpointsSecret key
Responses
200 | A list. |
401 | Missing 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
| Field | Type | Description |
|---|
id (path) required | string | |
Responses
200 | Sent. |
404 | No 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
201 | Created. |
403 | Live keys cannot create an inbox. |
Read the test webhook inbox
GET/v1/sandbox/inboxSecret key
Responses
Events
Event history.
List events
GET/v1/eventsSecret key
Newest first. Use limit and starting_after to page.
Parameters
| Field | Type | Description |
|---|
limit (query) | integer | |
starting_after (query) | string | |
Responses
200 | A list. |
401 | Missing or invalid secret key. |
Get one event
GET/v1/events/{id}Secret key
Merchant events never include a name, email, phone or ZIP.
Parameters
| Field | Type | Description |
|---|
id (path) required | string | |
Responses
200 | The event. |
404 | No 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
| Field | Type | Description |
|---|
Idempotency-Key (header) | string | Safe retries. The response is kept for 24 hours. Reusing a key with a different body returns 422. |
Body
| Field | Type | Description |
|---|
mj_click_id | string | |
lead | string | |
type | "quote" | "application" | "booking" | "purchase" | "custom" | |
external_id required | string | |
value | integer | Cents. |
currency | string | |
occurred_at | integer | string | Unix seconds or an ISO 8601 time. |
Responses
200 | Already recorded. |
201 | Recorded. |
403 | Not a partner key. |
404 | No 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
200 | The host. |
401 | Missing or invalid secret key. |
503 | The 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
200 | A list. |
401 | Missing or invalid secret key. |
503 | The 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
| Field | Type | Description |
|---|
X-Munja-Signature (header) required | string | t=<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
| Field | Type | Description |
|---|
id required | string | |
object required | "event" | |
type required | EventType | |
livemode required | boolean | |
created required | integer | Unix seconds. |
data required | object | |
data.object | object | For offer.accepted: id, offer, partner, price_cents, merchant_share_cents, surface, yes_tier, source, status, created. |
Responses
200 | Return any 2xx within 10 seconds. Anything else retries after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours. |
Objects
Offer
| Field | Type | Description |
|---|
impression required | string | The token for view, accept, dismiss and report. |
position required | integer | |
partner required | string | |
category required | string | |
headline required | string | |
body required | string | |
price | string | |
perk | string | |
cta required | string | The button text. |
consent required | string | The exact consent wording to show next to the button. Do not edit it. |
consent_version required | string | |
yes_tier required | "contact" | "call" | "quote" | What the yes collects. |
call_consent | string | For call and quote offers: the exact text next to the unchecked box. |
logo | string | |
terms_url | string | |
link_out | boolean | |
offer_id | string | |
accepted | boolean | |
OfferList
| Field | Type | Description |
|---|
object required | "offer_list" | |
decision | string | null | |
livemode required | boolean | |
data required | Offer[] | |
moment | Moment | |
empty_reason | string | Why the list is empty. For your developer, never for shoppers. |
drop_reasons | object[] | |
replayed | boolean | |
agent | boolean | |
Acceptance
| Field | Type | Description |
|---|
object required | "acceptance" | |
lead required | string | |
status required | string | accepted, or duplicate for an agent accept. |
partner | string | |
message | string | |
livemode | boolean | |
offer_code | string | |
landingUrl | string | |
continueUrl | string | |
source | string | |
charged | boolean | |
WebhookEvent
| Field | Type | Description |
|---|
id required | string | |
object required | "event" | |
type required | EventType | |
livemode required | boolean | |
created required | integer | Unix seconds. |
data required | object | |
data.object | object | For offer.accepted: id, offer, partner, price_cents, merchant_share_cents, surface, yes_tier, source, status, created. |
Error
| Field | Type | Description |
|---|
error required | object | |
error.type required | "invalid_request_error" | "authentication_error" | "permission_error" | "rate_limit_error" | "idempotency_error" | "api_error" | |
error.code required | string | |
error.message required | string | |
error.param | string | null | |
error.doc_url | string | |