Source: https://fyno.docs.pageloop.ai/api-reference/fire-an-event/post-wsid-version-event

# Notify a single user

POST `https://api.fyno.io/v1/{WSID}/{version}/event`

This API enables you to fire a notification event, which sends out notifications to your users.

Before firing your first notification event, you must perform the following actions in your Fyno account:

- Create a Template
- Create a Notification Event
- Create an API Key
- And obtain your workspace ID from the API Keys page.

## Authorization

#### Authorization (header, string, required)

Enter your API Key. If you don't have it already, you can create one from the API Keys page within your Fyno account

## Path Parameters

#### WSID (path, string, required)

Enter your workspace ID. You can obtain this value from the API Keys page within your Fyno account.

#### version (path, enum (string), required) — allowed: live, test

Enter the version for which you wish to fire the notification.

## Response

#### 202

Request accepted successfully and it will be processed asynchronously.

#### event (string, required)

#### received\_time (string, required)

#### request\_id (string, required)

#### response (object, required)

#### properties

#### discord (object)

#### email (object)

#### inapp (object)

#### push (object)

#### slack (object)

#### sms (object)

#### teams (object)

#### voice (object)

#### whatsapp (object)

#### 400

Event name does not exist

#### \_message (string, required)

#### status (string, required)

#### 401

API Key or Workspace ID is invalid. User is unauthorised.

#### \_message (string, required)

#### status (string, required)

#### Request

```bash cURL
curl -X POST 'https://api.fyno.io/v1/{WSID}/{version}/event' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

```javascript JavaScript
const res = await fetch('https://api.fyno.io/v1/{WSID}/{version}/event', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
const data = await res.json();
```

```python Python
import requests

res = requests.post(
    'https://api.fyno.io/v1/{WSID}/{version}/event',
    headers={'Authorization': 'Bearer <token>'},
    json={}
)
data = res.json()
```

#### Response

```json 202
{
  "event": "event_name",
  "received_time": "2025-02-17T07:49:13.352Z",
  "request_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "response": {
    "discord": {
      "destination": "101XXXXXXXXXX7XXXXX",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "email": {
      "destination": "abcde@fghi.com",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "inapp": {
      "destination": "12345",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "push": {
      "destination": "ExponentPushToken[XXXXX]",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "slack": {
      "destination": "CXXXXXXXXXX",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "sms": {
      "destination": "+919879XXXXXX",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "teams": {
      "destination": "General",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "voice": {
      "destination": "+919879XXXXXX",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    },
    "whatsapp": {
      "destination": "+919879XXXXXX",
      "msg_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XXXX",
      "status": "ok"
    }
  }
}
```

```json 400
{
  "_message": "The notification event name 'event_name' is invalid or does not exists on prod",
  "status": "error"
}
```

```json 401
{
  "_message": "Invalid API details",
  "status": "error"
}
```
