---
title: "Create a new notification"
description: "Create a custom notification for workspace users"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Notifications

`POST /api/notifications/{workspaceId}`

Create a custom notification for workspace users

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `workspaceId` (`post/api/notifications/workspaceId.path.workspaceId`; string, required) — Workspace ID for data isolation

## Request body

_Required._

- `title` (`post/api/notifications/workspaceId.title`; string, required) — Notification title
  - maxLength 255; example `"System Alert"`
- `message` (`post/api/notifications/workspaceId.message`; string, required) — Detailed notification message
  - maxLength 1000; example `"Your SMS quota is running low"`
- `type` (`post/api/notifications/workspaceId.type`; string, optional) — Notification type
  - one of `"info"`, `"success"`, `"warning"`, `"error"`; default `"info"`
- `priority` (`post/api/notifications/workspaceId.priority`; string, optional) — Priority level
  - one of `"low"`, `"medium"`, `"high"`, `"urgent"`; default `"medium"`

## Example request

```json
{
  "title": "System Alert",
  "message": "Your SMS quota is running low",
  "type": "info",
  "priority": "low"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/notifications/<workspaceId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "System Alert",
  "message": "Your SMS quota is running low",
  "type": "info",
  "priority": "low"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/notifications/<workspaceId>';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    title: 'System Alert',
    message: 'Your SMS quota is running low',
    type: 'info',
    priority: 'low'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/notifications/<workspaceId>"

payload = {
    "title": "System Alert",
    "message": "Your SMS quota is running low",
    "type": "info",
    "priority": "low"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Notification created successfully

#### Example

```json
{
  "success": true,
  "notification": {
    "id": "string",
    "workspace_id": "string",
    "title": "New Message Received",
    "message": "You have received a new message from John Doe",
    "type": "info",
    "priority": "medium",
    "read": false,
    "dismissed": false,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "message": "Notification created successfully"
}
```

- `success` (`post/api/notifications/workspaceId.response.201.success`; boolean, optional)
  - example `true`
- `notification` (`post/api/notifications/workspaceId.response.201.notification`; object, optional)
  - `id` (`post/api/notifications/workspaceId.response.201.notification.id`; string, optional) — Unique notification identifier
  - `workspace_id` (`post/api/notifications/workspaceId.response.201.notification.workspace_id`; string, optional) — Workspace ID
  - `title` (`post/api/notifications/workspaceId.response.201.notification.title`; string, optional) — Notification title
    - example `"New Message Received"`
  - `message` (`post/api/notifications/workspaceId.response.201.notification.message`; string, optional) — Notification message content
    - example `"You have received a new message from John Doe"`
  - `type` (`post/api/notifications/workspaceId.response.201.notification.type`; string, optional) — Notification type
    - one of `"info"`, `"success"`, `"warning"`, `"error"`; example `"info"`
  - `priority` (`post/api/notifications/workspaceId.response.201.notification.priority`; string, optional) — Notification priority level
    - one of `"low"`, `"medium"`, `"high"`, `"urgent"`; example `"medium"`
  - `read` (`post/api/notifications/workspaceId.response.201.notification.read`; boolean, optional) — Whether notification has been read
    - default `false`
  - `dismissed` (`post/api/notifications/workspaceId.response.201.notification.dismissed`; boolean, optional) — Whether notification has been dismissed
    - default `false`
  - `created_at` (`post/api/notifications/workspaceId.response.201.notification.created_at`; string, optional) — Notification creation timestamp
    - format `date-time`
  - `updated_at` (`post/api/notifications/workspaceId.response.201.notification.updated_at`; string, optional) — Last update timestamp
    - format `date-time`
- `message` (`post/api/notifications/workspaceId.response.201.message`; string, optional)
  - example `"Notification created successfully"`

### 400

Bad request

### 500

Server error


Source: https://developer.channelautomations.com/api/post-api-notifications-workspace-id/index.md
