> For the complete documentation index, see [llms.txt](https://docs.amitysolutions.com/ekoai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amitysolutions.com/ekoai/api-reference/botv2/botv2-api/user-event.md).

# User Event

Triggered when a user is created, updated, or deleted.

## Database Config

| Name          | Type     | Description                                                                                                                                                                                                                |
| ------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key`         | `string` | \* `user` - Event Key                                                                                                                                                                                                      |
| `actions`     | `string` | <p>The action performed. Can be one of:<br>\* <code>created</code> - A new user was created.<br>\* <code>updated</code> - The status of the user is changed.<br>\* <code>deleted</code> - A user was removed from Eko.</p> |
| `title`       | `string` | Event Title                                                                                                                                                                                                                |
| `description` | `string` | Event Description                                                                                                                                                                                                          |

### Example Config

```
{
    "key" : "user",
    "actions" : [ 
        "created", 
        "updated", 
        "deleted"
    ],
    "title" : "User Event",
    "description" : "Triggered when a user is created, updated or deleted."
}
```

## Delivery headers

HTTP POST payloads that are delivered to your webhook's configured URL endpoint will contain several special headers:

| Header              | Description                                                                                                                                                                                                            |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **X-Eko-Event**     | \* `user` - Name of the event type that triggered the delivery.                                                                                                                                                        |
| **X-Eko-Signature** | The HMAC hex digest of the response body. This header will be sent if the webhook is configured with a `secret`. The HMAC hex digest is generated using the `sha256` hash function and the `secret` as the HMAC `key`. |

### Example delivery

#### headers

```
accept: application/json, text/plain, */*
content-length: 721
content-type: application/json;charset=utf-8
host: enefl77qn8s1omr.m.pipedream.net
user-agent: axios/0.19.0
x-amzn-trace-id: Root=1-5e08bfc1-b22bb8e2dcc076840831d1e0
x-eko-event: user
x-eko-signature: yfS4+byRYYVAbkEpGVq4IF0/SbreYRqPvvWSQEhWOfA=
```

#### body

```
{
  "action": "created",
  "user": {
    "_id": "5e08bfc087096951ec3ebd4c",
    "admin_panel_access": false,
    "avatar": "",
    "contacts": [],
    "coverPhoto": "",
    "deleted": false,
    "email": "support1@ekoapp.com",
    "extras": {},
    "firstname": "Support1",
    "firstname_first_character": "S",
    "invited": false,
    "is_licensed": true,
    "isBot": false,
    "isVerifiedEmail": false,
    "lastname": "Real",
    "loginCount": 0,
    "network_admin": false,
    "nid": "5dea133b76dcd3da24837353",
    "position": "",
    "redeemedPoints": 0,
    "roleIDs": [],
    "settings": {
      "workHours": {
        "enabled": false,
        "lastUpdate": "2019-12-29T14:58:09.609Z",
        "workDays": []
      }
    },
    "status": "",
    "stickerPacks": [],
    "totalPoints": 0,
    "username": "support1"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.amitysolutions.com/ekoai/api-reference/botv2/botv2-api/user-event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
