{"openapi":"3.1.0","info":{"title":"MIHWAR API","version":"1.0.0","description":"Push orders, bookings, deals and subscriptions into MIHWAR, and read the contacts they belong to."},"servers":[{"url":"https:\/\/api-mihwar.tarawud.com\/api\/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key, from Settings \u2192 Integrations \u2192 Developer API."}}},"paths":{"\/bookings":{"get":{"summary":"List Bookings","tags":["bookings"],"security":[{"bearerAuth":["bookings.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Create a record in Bookings, or update the one this source already sent","description":"Send `external_id` and `source` together: they identify the record, so a retry updates rather than duplicates. Include a `contact` object and the customer is resolved against your existing contacts \u2014 add `contact.country` (ISO-3166 alpha-2) so a local number like `0501112233` is stored as the full international number instead of guessed at. Omit `currency` and the workspace's own is used.","tags":["bookings"],"security":[{"bearerAuth":["bookings.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/bookings\/statuses":{"get":{"summary":"The workspace's own status names for Bookings","tags":["bookings"],"security":[{"bearerAuth":["bookings.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/bookings\/{id}":{"delete":{"summary":"Delete a record from Bookings","tags":["bookings"],"security":[{"bearerAuth":["bookings.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"get":{"summary":"One record from Bookings","tags":["bookings"],"security":[{"bearerAuth":["bookings.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"patch":{"summary":"Update a record in Bookings","tags":["bookings"],"security":[{"bearerAuth":["bookings.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/contacts":{"get":{"summary":"List or search contacts","tags":["contacts"],"security":[{"bearerAuth":["contacts.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Create a contact, or merge into the one that already holds this number or address","description":"Returns 201 when a contact was created and 200 when an existing one was merged into. `merged_fields` lists what changed.","tags":["contacts"],"security":[{"bearerAuth":["contacts.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/contacts\/{id}":{"get":{"summary":"One contact","tags":["contacts"],"security":[{"bearerAuth":["contacts.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"patch":{"summary":"Update a contact","tags":["contacts"],"security":[{"bearerAuth":["contacts.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/deals":{"get":{"summary":"List Deals","tags":["deals"],"security":[{"bearerAuth":["deals.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Create a record in Deals, or update the one this source already sent","description":"Send `external_id` and `source` together: they identify the record, so a retry updates rather than duplicates. Include a `contact` object and the customer is resolved against your existing contacts \u2014 add `contact.country` (ISO-3166 alpha-2) so a local number like `0501112233` is stored as the full international number instead of guessed at. Omit `currency` and the workspace's own is used.","tags":["deals"],"security":[{"bearerAuth":["deals.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/deals\/statuses":{"get":{"summary":"The workspace's own status names for Deals","tags":["deals"],"security":[{"bearerAuth":["deals.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/deals\/{id}":{"delete":{"summary":"Delete a record from Deals","tags":["deals"],"security":[{"bearerAuth":["deals.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"get":{"summary":"One record from Deals","tags":["deals"],"security":[{"bearerAuth":["deals.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"patch":{"summary":"Update a record in Deals","tags":["deals"],"security":[{"bearerAuth":["deals.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/channels":{"get":{"summary":"List the workspace channels (use a WhatsApp channel id when sending templates)","tags":["messaging"],"security":[{"bearerAuth":["conversations.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/conversations":{"get":{"summary":"List conversations with customer and channel identity","tags":["messaging"],"security":[{"bearerAuth":["conversations.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/conversations\/{id}":{"get":{"summary":"Read conversation, customer and channel","tags":["messaging"],"security":[{"bearerAuth":["conversations.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/conversations\/{id}\/messages":{"get":{"summary":"Read messages and provider delivery status","tags":["messaging"],"security":[{"bearerAuth":["conversations.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Reply to a customer through the original channel","description":"Requires messages.send and an Idempotency-Key header unique per reply. Repeating the same key returns the same message (200); changing the request returns 409. A 201 response means accepted for processing, not delivered. Read message status through GET. Provider messaging windows and blocked contacts still apply.","tags":["messaging"],"security":[{"bearerAuth":["messages.send"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/whatsapp\/templates":{"get":{"summary":"List WhatsApp templates with their variables","tags":["messaging"],"security":[{"bearerAuth":["templates.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Create a WhatsApp template draft","description":"Requires templates.write. Creates a local draft by default. Set submit=true or call \/{id}\/submit to request Meta review. A 201 confirms draft creation; inspect data.submitted and data.submit_error when submitting. Meta owns approval. Do not retry a timed-out creation blindly: list templates by channel and inspect the result first.","tags":["messaging"],"security":[{"bearerAuth":["templates.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/whatsapp\/templates\/send":{"post":{"summary":"Send an approved WhatsApp template to any phone number","description":"Requires messages.send. Creates the contact and conversation when the number is new and records the opt-in as given through the API. Send an Idempotency-Key header to make retries safe: the same key returns the first message (200). A 201 means queued, not delivered \u2014 follow delivery through GET \/conversations\/{id}\/messages.","tags":["messaging"],"security":[{"bearerAuth":["messages.send"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/whatsapp\/templates\/sync":{"post":{"summary":"Sync all template statuses and components from Meta","tags":["messaging"],"security":[{"bearerAuth":["templates.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/whatsapp\/templates\/{id}":{"delete":{"summary":"Delete a local template draft","description":"Meta-linked templates are protected. Delete those in Meta, then sync the catalogue.","tags":["messaging"],"security":[{"bearerAuth":["templates.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"get":{"summary":"Read template content, buttons and review status","tags":["messaging"],"security":[{"bearerAuth":["templates.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"patch":{"summary":"Update an editable template draft","description":"Only local drafts can change. Send only changed top-level fields; definition replaces the complete definition object. Use \/duplicate to create an editable copy of a Meta-linked template. PATCH does not submit to Meta.","tags":["messaging"],"security":[{"bearerAuth":["templates.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/whatsapp\/templates\/{id}\/duplicate":{"post":{"summary":"Copy a template into an editable draft","tags":["messaging"],"security":[{"bearerAuth":["templates.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/whatsapp\/templates\/{id}\/submit":{"post":{"summary":"Submit a template draft for Meta review","description":"Uses the selected channel\u2019s WABA. The body must have fixed text before the first variable and after the last; punctuation alone is insufficient (except Meta-generated authentication bodies). Invalid drafts stay editable. A successful submission is not approval. Sync and read the status before sending.","tags":["messaging"],"security":[{"bearerAuth":["templates.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/orders":{"get":{"summary":"List Orders","tags":["orders"],"security":[{"bearerAuth":["orders.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Create a record in Orders, or update the one this source already sent","description":"Send `external_id` and `source` together: they identify the record, so a retry updates rather than duplicates. Include a `contact` object and the customer is resolved against your existing contacts \u2014 add `contact.country` (ISO-3166 alpha-2) so a local number like `0501112233` is stored as the full international number instead of guessed at. Omit `currency` and the workspace's own is used.","tags":["orders"],"security":[{"bearerAuth":["orders.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/orders\/statuses":{"get":{"summary":"The workspace's own status names for Orders","tags":["orders"],"security":[{"bearerAuth":["orders.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/orders\/{id}":{"delete":{"summary":"Delete a record from Orders","tags":["orders"],"security":[{"bearerAuth":["orders.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"get":{"summary":"One record from Orders","tags":["orders"],"security":[{"bearerAuth":["orders.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"patch":{"summary":"Update a record in Orders","tags":["orders"],"security":[{"bearerAuth":["orders.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/subscriptions":{"get":{"summary":"List Customer subscriptions","tags":["subscriptions"],"security":[{"bearerAuth":["subscriptions.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"post":{"summary":"Create a record in Customer subscriptions, or update the one this source already sent","description":"Send `external_id` and `source` together: they identify the record, so a retry updates rather than duplicates. Include a `contact` object and the customer is resolved against your existing contacts \u2014 add `contact.country` (ISO-3166 alpha-2) so a local number like `0501112233` is stored as the full international number instead of guessed at. Omit `currency` and the workspace's own is used.","tags":["subscriptions"],"security":[{"bearerAuth":["subscriptions.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/subscriptions\/statuses":{"get":{"summary":"The workspace's own status names for Customer subscriptions","tags":["subscriptions"],"security":[{"bearerAuth":["subscriptions.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/subscriptions\/{id}":{"delete":{"summary":"Delete a record from Customer subscriptions","tags":["subscriptions"],"security":[{"bearerAuth":["subscriptions.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"get":{"summary":"One record from Customer subscriptions","tags":["subscriptions"],"security":[{"bearerAuth":["subscriptions.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}},"patch":{"summary":"Update a record in Customer subscriptions","tags":["subscriptions"],"security":[{"bearerAuth":["subscriptions.write"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/mcp":{"post":{"summary":"Model Context Protocol endpoint for AI clients","tags":["workspace"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/openapi.json":{"get":{"summary":"This API as an OpenAPI 3.1 document","description":"Public \u2014 no API key required. Import it into Postman, Insomnia or an SDK generator.","tags":["workspace"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/reference":{"get":{"summary":"Everything the documentation page renders, in one call","description":"Public \u2014 no API key required.","tags":["workspace"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/subscription":{"get":{"summary":"The workspace's MIHWAR plan, limits and remaining credits","tags":["workspace"],"security":[{"bearerAuth":["billing.read"]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}},"\/workspace":{"get":{"summary":"The workspace this key belongs to","tags":["workspace"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing, invalid, revoked or expired API key"},"403":{"description":"The key lacks the required scope"},"422":{"description":"The payload failed validation"},"429":{"description":"Rate limit exceeded for this key"}}}}}}