# Events

## Create an event

<mark style="color:green;">`POST`</mark> `https://api.sparkloop.app/v2/subscribers/:identifier/events`

#### Path Parameters

| Name                                         | Type   | Description                        |
| -------------------------------------------- | ------ | ---------------------------------- |
| identifier<mark style="color:red;">\*</mark> | String | Subscriber's UUID or email address |

#### Request Body

| Name                                             | Type   | Description                                                                           |
| ------------------------------------------------ | ------ | ------------------------------------------------------------------------------------- |
| event<mark style="color:red;">\*</mark>          | Object | An object whose fields are campaign\_uuid, value, and description.                    |
| value<mark style="color:red;">\*</mark>          | float  | Monetary value of the event. For example 23.9                                         |
| description                                      | string | Description of the event. For internal use only. Eg: "Purchase of Premium membership" |
| campaign\_uuid<mark style="color:red;">\*</mark> | String | Referral campaign UUID, e.g. MF9a78983d1c.                                            |

{% tabs %}
{% tab title="201: Created " %}

```json
{
    "event": {
        "value": 1490,    
        "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 %}
