# Events

## Create an event

<mark style="color:green;">`POST`</mark> `https://api.sparkloop.app/v1/campaigns/:campaign_uuid/subscribers/:subscriber_uuid/events`

#### Path Parameters

| Name                                               | Type   | Description                               |
| -------------------------------------------------- | ------ | ----------------------------------------- |
| campaign\_uuid<mark style="color:red;">\*</mark>   | string | Campaign's UUID, for example MF9a78983d1c |
| subscriber\_uuid<mark style="color:red;">\*</mark> | String | Subscriber's UUID or email address        |

#### Headers

| Name                                        | Type   | Description  |
| ------------------------------------------- | ------ | ------------ |
| X-Api-Key<mark style="color:red;">\*</mark> | string | Your API key |

#### Request Body

| Name                                    | Type   | Description                                                                           |
| --------------------------------------- | ------ | ------------------------------------------------------------------------------------- |
| value<mark style="color:red;">\*</mark> | float  | Monetary value of the event. For example 23.9                                         |
| descripton                              | string | Description of the event. For internal use only. Eg: "Purchase of Premium membership" |

{% tabs %}
{% tab title="200 " %}

```json
{
    "event": {
        "value": 1490,
        "campaign_uuid": "MFeeb4c28df0",
        "subscriber_uuid": "sub_3138d33419",
        "created_at": "2021-11-29T10:14:20.955Z"
    }
}
```

{% endtab %}

{% tab title="400 " %}
{% tabs %}
{% tab title="Subscriber UUID missing" %}

```
{
    "error": "Subscriber uuid or email blank!"
}
```

{% endtab %}

{% tab title="Value missing" %}

```
{
    "error": "You have to provide a value"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "error": "Subscriber john.doe@email.com not found!"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sparkloop.app/api-1/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
