Skip to main content
POST
/
v1
/
experiments
/
{experiment_id_or_slug}
/
events
Send Experiment Event
curl --request POST \
  --url https://api.askmiso.com/v1/experiments/{experiment_id_or_slug}/events \
  --header 'Content-Type: application/json' \
  --data '{
  "user_id": "2179873",
  "anonymous_id": "403fb18e-98ff-434d-8585-726fabf5ed37",
  "variant_name": "Treatment_Group",
  "timestamp": "2022-01-23T12:34:56-08:00"
}'
{
  "took": 50,
  "in_experiment": true,
  "variant": {
    "id": "59769b89-5f1f-46d5-a4fa-a583ebd2f7fd",
    "name": "Treatment_Group",
    "slug": "Treatment_Group",
    "configuration": {
      "model": "A"
    },
    "status": "Active"
  }
}

Authorizations

api_key
string
query
required

Your secret API key is used to access every Miso API endpoint. You should secure this key and only use it on a backend server. Never leave this key in your client-side JavaScript code. If the private key is compromised, you can revoke it in Dojo and get a new one.

Specify your secret key in the api_key query parameter. For example:

POST /v1/users?api_key=039c501ac8dfcac91c6f05601cee876e1cc07e17

Body

application/json
user_id
string

Identifies the signed-in user who performed the interaction.

Example:

"2179873"

anonymous_id
string

A pseudo-unique substitute for the User Id

Example:

"403fb18e-98ff-434d-8585-726fabf5ed37"

variant_name
string

Set the variant_name if you want to assign a user to a specific variant. Most of the time, you don't need to pass this field. Instead, the system will automatically assign a variant for this user.

Example:

"Treatment_Group"

timestamp
string<date-time>

The time the user is assigned to the variant group. If not set, current time will be used.

Example:

"2022-01-23T12:34:56-08:00"

Response

Successful Response

took
integer
required

The amount of time (in milliseconds) Miso took to answer this request.

Example:

50

in_experiment
boolean
required

To show whether the experiment is active or not.

variant
object
required