The Offline Event Webhook lets you record an event for a specific visitor in Mida from your own backend or systems — useful when something happens outside the browser that you want to track against a visitor (for example, a server-confirmed signup, a CRM stage change, or an offline action). Recorded events are available as goals or secondary goals in your experiments.
Endpoint
POST https://api-{{region}}.mida.so/abtest/event/webhookUse the host that matches where your data is hosted:
US:
https://api-us.mida.so/abtest/event/webhookEU:
https://api-eu.mida.so/abtest/event/webhook
Requests must be sent with Content-Type: application/json.
User identification
You must provide at least one of the following identifiers so Mida can match the event to a visitor. If mida_uuid is provided, it is used as the sole identifier; email and id are only used when mida_uuid is absent.
Parameter | Type | Required | Description |
| String | Optional* | The unique identifier generated by Mida. Retrieve it in the browser with |
| String | Optional* | The visitor's email address, set via the Mida client-side user attribution API. |
| String | Optional* | Your system's user ID, set via the Mida client-side user attribution API. |
*At least one of these three must be provided.
Request parameters
Parameter | Type | Required | Description |
| String | Yes | Your Mida project (public/widget) key. Alias: |
| String | Yes | The name of the event being recorded (this is how it appears as a goal / secondary goal). |
| Object | No | Additional custom metadata to store with the event. |
Request example
{
"project_key": "YOUR_PROJECT_KEY",
"event_name": "signup_completed",
"mida_uuid": "f8cb2ebe-XXXX-4a4f-a967-85a35aca4df9",
"email": "[email protected]",
"id": "internal_user_id",
"properties": {
"plan": "pro",
"source": "backend"
}
}
Response codes
Responses are returned as a plain-text message with the corresponding HTTP status code.
Status code | Response body | Meaning |
200 |
| The event was recorded for the visitor. |
400 |
| A required field is missing. |
400 |
| The |
400 |
| No visitor matched the identifier(s) provided. |
500 |
| An unexpected error occurred. |
Usage notes
Make sure the Mida script is installed on your site before using this webhook — the visitor must already exist in Mida for the event to be matched.
Get the Mida visitor UUID in the browser with
mida.uuid(), for example:const mida_uuid = await mida.uuid();Find your project key in your Mida dashboard settings.
User identification (
email/id) can be set up through the Mida client-side user attribution API.The
propertiesobject is optional and lets you attach additional metadata to the event.Recorded events can be selected as goals or secondary goals in your experiments.
Example cURL request
curl -X POST https://api-us.mida.so/abtest/event/webhook \
-H "Content-Type: application/json" \
-d '{"project_key": "YOUR_PROJECT_KEY", "event_name": "signup_completed", "mida_uuid": "f8cb2ebe-XXXX-4a4f-a967-85a35aca4df9", "properties": {"plan": "pro", "source": "backend"}}'
