|
1 | 1 | --- |
2 | 2 | title: 'Overview' |
3 | | -description: "Complete Novu API reference covering authentication, endpoints, rate limits, and server-side integration for notifications." |
| 3 | +description: 'High-level overview of the Novu REST API, available resources, and links to OpenAPI, Postman, SDKs, and getting started guides.' |
4 | 4 | --- |
5 | 5 |
|
| 6 | +The Novu REST API lets you manage subscribers, trigger workflows, configure integrations, and operate your notification infrastructure from your backend. Use it directly with HTTP requests, or through one of our [server-side SDKs](/platform/sdks#server-side-sdks). |
| 7 | + |
6 | 8 | <Note> |
7 | | - It's important to note that our API and backend SDK are intended for use exclusively in |
8 | | - server-side applications. **Attempting to use them in a client-side application will result in |
9 | | - Cross-Origin Resource Sharing (CORS) errors.** This restriction ensures the security and integrity |
10 | | - of our services. |
| 9 | + The REST API and server-side SDKs are intended for server-side applications only. Using them in client-side code causes Cross-Origin Resource Sharing (CORS) errors and exposes your secret key. |
11 | 10 | </Note> |
12 | 11 |
|
13 | | -## Authentication |
| 12 | +## Base URL |
14 | 13 |
|
15 | | -Authentication for the Novu API involves the use of an API Key, which is a secure credential that is tied to your Novu account. This key should be included in the header of the request in the Authorization field as a string prefixed with 'ApiKey '. |
| 14 | +| Region | Base URL | |
| 15 | +| --- | --- | |
| 16 | +| **US (default)** | `https://api.novu.co/v1` | |
| 17 | +| **EU** | `https://eu.api.novu.co/v1` | |
16 | 18 |
|
17 | | -```bash |
18 | | ---header 'Authorization: ApiKey <NOVU_SECRET_KEY>' |
19 | | -``` |
| 19 | +All endpoints in this reference use the US base URL unless noted otherwise. See [Authentication](/api-reference/authentication) for regional WebSocket hostnames and credential setup. |
20 | 20 |
|
21 | | -For example, when using Novu in a Node.js application, the Novu package should be imported and initialized with the API key, as shown in this snippet: |
| 21 | +## API capabilities |
22 | 22 |
|
23 | | -```javascript |
24 | | -import { Novu } from '@novu/api'; |
25 | | -const novu = new Novu({ |
26 | | - secretKey: "NOVU_SECRET_KEY", |
27 | | -}); |
28 | | -``` |
| 23 | +The REST API is organized around the core resources you use to build and operate notifications: |
29 | 24 |
|
30 | | -Replace `<NOVU_SECRET_KEY>` with your actual API Key, available in the API Key section of the Novu Dashboard. |
| 25 | +<Columns cols={2}> |
| 26 | + <Card title="Events" icon="zap" href="/api-reference/events/trigger-event"> |
| 27 | + Trigger, bulk trigger, broadcast, and cancel workflow executions. |
| 28 | + </Card> |
| 29 | + <Card title="Subscribers" icon="users" href="/api-reference/subscribers/create-a-subscriber"> |
| 30 | + Create, update, and manage notification recipients and their preferences. |
| 31 | + </Card> |
| 32 | + <Card title="Inbox" icon="inbox" href="/api-reference/subscribers/retrieve-subscriber-notifications"> |
| 33 | + Read, mark, archive, snooze, and manage in-app notifications. |
| 34 | + </Card> |
| 35 | + <Card title="Topics" icon="hash" href="/api-reference/topics/create-a-topic"> |
| 36 | + Group subscribers and send notifications to topic audiences. |
| 37 | + </Card> |
| 38 | + <Card title="Workflows" icon="git-branch" href="/api-reference/workflows/create-a-workflow"> |
| 39 | + Create, sync, and manage notification workflow definitions. |
| 40 | + </Card> |
| 41 | + <Card title="Integrations" icon="plug" href="/api-reference/integrations/create-an-integration"> |
| 42 | + Configure channel providers for email, SMS, push, and chat delivery. |
| 43 | + </Card> |
| 44 | + <Card title="Environments" icon="server" href="/api-reference/environments/list-all-environments"> |
| 45 | + Manage environments and publish resources between them. |
| 46 | + </Card> |
| 47 | + <Card title="Messages" icon="message-square" href="/api-reference/messages/list-all-messages"> |
| 48 | + List and delete sent messages across channels. |
| 49 | + </Card> |
| 50 | +</Columns> |
31 | 51 |
|
32 | | -<Warning> |
33 | | - It is advised not to hardcode your credentials in a file in production environments. Use |
34 | | - environment variables instead. |
35 | | -</Warning> |
| 52 | +Browse the sidebar for the full endpoint reference, including translations, contexts, layouts, channel connections, and activity tracking. |
36 | 53 |
|
37 | | -## API Endpoints |
| 54 | +## Developer resources |
38 | 55 |
|
39 | | -Novu provides a multitude of API endpoints that enable a variety of functionalities. the base URL for the Novu API is `https://api.novu.co/v1`. |
| 56 | +Use these resources to explore, test, and integrate with the API: |
40 | 57 |
|
41 | | -<Note> |
42 | | - We offer two API options: the US API and the EU API. By default, our API documentation refers to the US API, which can be accessed at: https://api.novu.co/v1. |
| 58 | +<Columns cols={2}> |
| 59 | + <Card title="OpenAPI specification" icon="file-json" href="https://api.novu.co/openapi.json"> |
| 60 | + Machine-readable API schema for code generation, validation, and tooling. |
| 61 | + </Card> |
| 62 | + <Card title="Postman collection" icon="send" href="https://github.com/novuhq/novu-postman/blob/main/postman/novu_api_postman_collection.json"> |
| 63 | + Pre-built requests to test endpoints in Postman or compatible tools. |
| 64 | + </Card> |
| 65 | + <Card title="Server-side SDKs" icon="code" href="/platform/sdks#server-side-sdks"> |
| 66 | + Official SDKs for TypeScript, Python, Go, PHP, .NET, and Java. |
| 67 | + </Card> |
| 68 | + <Card title="Authentication" icon="key" href="/api-reference/authentication"> |
| 69 | + Set up API keys, environment credentials, and security best practices. |
| 70 | + </Card> |
| 71 | +</Columns> |
43 | 72 |
|
44 | | - If you require the EU version, you can access it here: https://eu.api.novu.co/v1. |
45 | | -</Note> |
| 73 | +### Import the Postman collection |
| 74 | + |
| 75 | +1. Clone or download the [novu-postman](https://github.com/novuhq/novu-postman) repository. |
| 76 | +2. Import `postman/novu_api_postman_collection.json` into Postman. |
| 77 | +3. Set the `secretKey` collection variable to your environment's secret key from the [API Keys](https://dashboard.novu.co/api-keys) page. |
| 78 | + |
| 79 | +## Getting started |
46 | 80 |
|
47 | | -For instance, to get tenant information, the endpoint to use would include the tenant's identifier and look like this `https://api.novu.co/v1/tenants/{identifier}`. |
| 81 | +<Steps> |
| 82 | + <Step title="Get your API key"> |
| 83 | + Copy your environment's secret key from the [Novu Dashboard](https://dashboard.novu.co/api-keys). See [Authentication](/api-reference/authentication) for details on credential types and security. |
| 84 | + </Step> |
| 85 | + <Step title="Make your first request"> |
| 86 | + Trigger a workflow or create a subscriber using the REST API or an SDK. Start with [Trigger event](/api-reference/events/trigger-event) or [Create a subscriber](/api-reference/subscribers/create-a-subscriber). |
| 87 | + </Step> |
| 88 | + <Step title="Review API policies"> |
| 89 | + Understand [Rate limiting](/api-reference/rate-limiting), [Idempotency](/api-reference/idempotency), and [Payload limits](/api-reference/payload-limits) before building production integrations. |
| 90 | + </Step> |
| 91 | +</Steps> |
0 commit comments