From cd1b641b00f51c558fc6ea7b2c12173fecae946a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 13:24:34 +0200 Subject: [PATCH 1/7] docs for localized notifications --- .../notifications/features-and-guidelines.mdx | 11 +- .../how-to-send-notifications.mdx | 131 +++++++++++++++++- src/pages/mini-apps/reference/api.mdx | 103 -------------- 3 files changed, 136 insertions(+), 109 deletions(-) diff --git a/src/pages/mini-apps/notifications/features-and-guidelines.mdx b/src/pages/mini-apps/notifications/features-and-guidelines.mdx index 0a57a8f7..19fb21be 100644 --- a/src/pages/mini-apps/notifications/features-and-guidelines.mdx +++ b/src/pages/mini-apps/notifications/features-and-guidelines.mdx @@ -22,15 +22,20 @@ the recipient's username. -d '{ "app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], - "title": "title", - "message": "🧑‍🍳 We're cooking something special for you ${username}", + "localisations": [ + { + "language": "en", + "title": "title", + "message": "🧑‍🍳 We're cooking something special for you ${username}" + } + ], "mini_app_path": "worldapp://mini-app?app_id=[app_id]&path=[path]" }' ``` -when sent to users, the messagebecomes:
+when sent to users, the message becomes:
`🧑‍🍳 We're cooking something special for you mistico`
`🧑‍🍳 We're cooking something special for you tute`
`🧑‍🍳 We're cooking something special for you struck`
diff --git a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx index b7d04586..d63e75ca 100644 --- a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx +++ b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx @@ -1,3 +1,5 @@ +import { Link } from '@/components/Link' + # Send Notifications Please take a minute to read the [Features & Guidelines](/mini-apps/notifications/features-and-guidelines). @@ -13,6 +15,9 @@ Notifications are queued on our servers, users may not receive them immediately. ## Manually sending notifications from Developer Portal +**Note: This form doesn't support localized notifications yet. +To take advantage of localizations, use the API.** + You can send notifications to multiple wallet addresses (up to a thousand) directly from the Developer Portal.
@@ -21,9 +26,130 @@ You can send notifications to multiple wallet addresses (up to a thousand) direc Use the form to input addresses, and content details. Once you click the `Send` button and get a success response, your notifications will be queued for delivery. -## Calling the send-notification endpoint +## Send Notification API{{ tag: "POST", label: "https://developer.worldcoin.org/api/v2/minikit/send-notification" }} + +This endpoint lets you send localized notifications to users of your mini app and requires an `api_key`. + +### How do localizations work? + +The user language is available to you when a user accesses your mini app +(via [Navigator](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language)). + +All you need to do is provide localizations, in our backend we will infer which language is preferred by the user. +Currently we support only a subset of languages, with plans to expand - find the entire list [here](/mini-apps/notifications/supported-languages). + +- If a user prefers a language that we don't support right now, we will favor English. +- If you don't specify a language that the user prefers, we will not send the notification. + You will be informed about this via a specific `reason` property in the response. + + + + ### Body Params + + You are required to either specify both `title` and `message` OR `localisations`. + + + + The `wallet_addresses` is an array of wallet addresses to send the notification to. Users must have opted in to notifications for your app. Max 1000 users per call. + + + `localisations` is an array of objects with properties: + - `language` (string, required): The language of the notification. + - `title` (string, required): The localized title of the notification. + - `message` (string, required): The localized message of the notification. + It's required to provide at least the `en` language. + + + Note: This will not localize your notifications. The `title` is the title of the notification. It should be 30 characters or less. May contain emojis. + + + Note: This will not localize your notifications. The `message` is the message of the notification. It should be 200 characters or less. You can include the special variable `${username}` in your message, which will be replaced with the actual username of the recipient when the notification is delivered. + + + The `mini_app_path` is the url encoded path of the mini app where your notification should link to when the user clicks on it.

Should be of the format `worldapp://mini-app?app_id=[app_id]&path=[path]` (path is optional). +
+ + The `app_id` is the identifier of the app initiating the transaction. + +
+ + ### Request Headers + + + The `Authorization` header should be the `api_key` for your app from the Developer Portal. Make sure to + prefix it with `Bearer {api_key}`. + + + + + + ```bash {{ title: "cURL" }} + curl -X POST "https://developer.worldcoin.org/api/v2/minikit/send-notification" \ + -H "Authorization: Bearer {api_key}" \ + -H "Content-Type: application/json" \ + -d '{"app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], "title": "title", "message": "Hello ${username}, your transaction is complete!", "mini_app_path": "mini_app_path"}' + ``` + ```js + fetch(apiUrl, { + method: 'POST', + headers: { + 'Authorization': 'Bearer {api_key}', + }, + body: JSON.stringify({ + app_id: "app_id", + wallet_addresses: ["0x123", "0x456"], + title: "title", + message: "Hello ${username}, your transaction is complete!", + mini_app_path: "mini_app_path" + }) + }) + ``` + + -You can also call our API to send notifications. For detailed information, see the [API Reference](/mini-apps/reference/api#send-notification). +
+
+### Response + + + + + Indicates if the API request was successful. + + + The HTTP status code of the response. + + + An array of notification delivery results for each wallet address, where each item contains: + - `walletAddress` (string): The wallet address that the notification was attempted to be sent to + - `sent` (boolean): Whether the notification was successfully sent to this wallet address + - `reason` (string, optional): If the notification failed to send, this field contains the reason + + + + + + ```json + { + "success": true, + "status": 200, + "result": [ + { + "walletAddress": "0x377da9cab87c04a1d6f19d8b4be9aef8df26fcdd", + "sent": true + }, + { + "walletAddress": "0x444da9cab87c04a1d6f19d8b4be9aef8df26fcdd", + "sent": false, + "reason": "User has notification disabled for World App" + } + ] + } + ``` + + + +
## Testing @@ -36,4 +162,3 @@ to enable notifications for your mini app inside of World App to receive them. - [Features & Guidelines](/mini-apps/notifications/guidelines) - [How To Request Notification Permissions](/mini-apps/commands/request-permission) - [How To Get Notification Permissions](/mini-apps/commands/get-permissions) -- [Send Notification API Reference](/mini-apps/reference/api#send-notification) diff --git a/src/pages/mini-apps/reference/api.mdx b/src/pages/mini-apps/reference/api.mdx index 336d9044..eb36f9fd 100644 --- a/src/pages/mini-apps/reference/api.mdx +++ b/src/pages/mini-apps/reference/api.mdx @@ -152,109 +152,6 @@ fetch(apiUrl, {
-## Send Notification{{ tag: "POST", label: "https://developer.worldcoin.org/api/v2/minikit/send-notification" }} - -This endpoint lets you send notifications to users of your mini app and requires an `api_key`. - - - - ### Body Params - - - The `wallet_addresses` is an array of wallet addresses to send the notification to. Users must have opted in to notifications for your app. Max 1000 users per call. - - - The `title` is the title of the notification. It should be 30 characters or less. May contain emojis. - - - The `message` is the message of the notification. It should be 200 characters or less. You can include the special variable `${username}` in your message, which will be replaced with the actual username of the recipient when the notification is delivered. - - - The `mini_app_path` is the url encoded path of the mini app where your notification should link to when the user clicks on it.

Should be of the format `worldapp://mini-app?app_id=[app_id]&path=[path]` (path is optional). -
- - The `app_id` is the identifier of the app initiating the transaction. - -
- - ### Request Headers - - - The `Authorization` header should be the `api_key` for your app from the Developer Portal. Make sure to - prefix it with `Bearer {api_key}`. - - - - - - ```bash {{ title: "cURL" }} - curl -X POST "https://developer.worldcoin.org/api/v2/minikit/send-notification" \ - -H "Authorization: Bearer {api_key}" \ - -H "Content-Type: application/json" \ - -d '{"app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], "title": "title", "message": "Hello ${username}, your transaction is complete!", "mini_app_path": "mini_app_path"}' - ``` - ```js - fetch(apiUrl, { - method: 'POST', - headers: { - 'Authorization': 'Bearer {api_key}', - }, - body: JSON.stringify({ - app_id: "app_id", - wallet_addresses: ["0x123", "0x456"], - title: "title", - message: "Hello ${username}, your transaction is complete!", - mini_app_path: "mini_app_path" - }) - }) - ``` - - - -
-
-### Response - - - - - Indicates if the API request was successful. - - - The HTTP status code of the response. - - - An array of notification delivery results for each wallet address, where each item contains: - - `walletAddress` (string): The wallet address that the notification was attempted to be sent to - - `sent` (boolean): Whether the notification was successfully sent to this wallet address - - `reason` (string, optional): If the notification failed to send, this field contains the reason - - - - - - ```json - { - "success": true, - "status": 200, - "result": [ - { - "walletAddress": "0x377da9cab87c04a1d6f19d8b4be9aef8df26fcdd", - "sent": true - }, - { - "walletAddress": "0x444da9cab87c04a1d6f19d8b4be9aef8df26fcdd", - "sent": false, - "reason": "User has notification disabled for World App" - } - ] - } - ``` - - - -
- ## Get Transaction{{ tag: "GET", label: "https://developer.worldcoin.org/api/v2/minikit/transaction/{transaction_id}?app_id=&type=" }} From bf87d27c686dee15ee0d88596b2e310a1cd1ea83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 13:34:57 +0200 Subject: [PATCH 2/7] add table and redact --- .../how-to-send-notifications.mdx | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx index d63e75ca..83225215 100644 --- a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx +++ b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx @@ -9,7 +9,7 @@ To send notifications to users you need to: - Request permission in the Developer Portal Advanced settings, for your mini app, - request permission to send notifications from the user, via MiniKit (see [Request Permission](/mini-apps/commands/request-permission)), -- actually send the notification using our API or the Developer Portal (see [How To Send Notifications](/mini-apps/notifications/how-to-send-notifications)). +- actually send the notification using our API or the Developer Portal. Notifications are queued on our servers, users may not receive them immediately. @@ -32,15 +32,16 @@ This endpoint lets you send localized notifications to users of your mini app an ### How do localizations work? -The user language is available to you when a user accesses your mini app +The user's language is available to you when they access your mini app (via [Navigator](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language)). -All you need to do is provide localizations, in our backend we will infer which language is preferred by the user. -Currently we support only a subset of languages, with plans to expand - find the entire list [here](/mini-apps/notifications/supported-languages). +All you need to do is provide localizations. Our backend will automatically infer which language is preferred by the user. +Currently we support only a subset of languages, with plans to expand. Find the entire list [here](/mini-apps/notifications/how-to-send-notifications#supported-languages). +You can only specify languages that we support. -- If a user prefers a language that we don't support right now, we will favor English. -- If you don't specify a language that the user prefers, we will not send the notification. - You will be informed about this via a specific `reason` property in the response. +- If a user prefers a language that we don't currently support, we will deliver the notification in English. +- If you don't specify a localization for the user's preferred language, the notification will not be delivered. + The response will include a specific `reason` to inform you of this. @@ -87,7 +88,7 @@ Currently we support only a subset of languages, with plans to expand - find the curl -X POST "https://developer.worldcoin.org/api/v2/minikit/send-notification" \ -H "Authorization: Bearer {api_key}" \ -H "Content-Type: application/json" \ - -d '{"app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], "title": "title", "message": "Hello ${username}, your transaction is complete!", "mini_app_path": "mini_app_path"}' + -d '{"app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], "localisations": [{"language": "en", "title": "title", "message": "Hello ${username}, your transaction is complete!"}], "mini_app_path": "mini_app_path"}' ``` ```js fetch(apiUrl, { @@ -98,8 +99,13 @@ Currently we support only a subset of languages, with plans to expand - find the body: JSON.stringify({ app_id: "app_id", wallet_addresses: ["0x123", "0x456"], - title: "title", - message: "Hello ${username}, your transaction is complete!", + localisations: [ + { + language: "en", + title: "title", + message: "Hello ${username}, your transaction is complete!" + } + ], mini_app_path: "mini_app_path" }) }) @@ -162,3 +168,24 @@ to enable notifications for your mini app inside of World App to receive them. - [Features & Guidelines](/mini-apps/notifications/guidelines) - [How To Request Notification Permissions](/mini-apps/commands/request-permission) - [How To Get Notification Permissions](/mini-apps/commands/get-permissions) + +## Supported Languages + +| Language | Code | +| ---------------------------- | -------- | +| English | `en` | +| Catalan | `ca` | +| Chinese Simplified | `zh_CN` | +| French | `fr` | +| German | `de` | +| Hindi | `hi` | +| Japanese | `ja` | +| Korean | `ko` | +| Polish | `pl` | +| Portuguese | `pt` | +| Spanish | `es` | +| Spanish (Latin America) | `es_419` | +| Malay | `ms` | +| Thai | `th` | +| Indonesian | `id` | +| Traditional Chinese (Taiwan) | `zh_TW` | From a2d7bc74d23afa9bf76b3a9e155bf72a6c23dba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 13:41:33 +0200 Subject: [PATCH 3/7] alphabetic order --- .../mini-apps/notifications/how-to-send-notifications.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx index 83225215..f9a8162a 100644 --- a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx +++ b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx @@ -179,13 +179,13 @@ to enable notifications for your mini app inside of World App to receive them. | French | `fr` | | German | `de` | | Hindi | `hi` | +| Indonesian | `id` | | Japanese | `ja` | | Korean | `ko` | +| Malay | `ms` | | Polish | `pl` | | Portuguese | `pt` | | Spanish | `es` | | Spanish (Latin America) | `es_419` | -| Malay | `ms` | | Thai | `th` | -| Indonesian | `id` | | Traditional Chinese (Taiwan) | `zh_TW` | From 0b2167da9c7be2480941aed8aa0c644ef0e1c580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:37:02 +0200 Subject: [PATCH 4/7] restructure --- .../how-to-send-notifications.mdx | 200 ++++-------------- src/pages/mini-apps/reference/api.mdx | 153 ++++++++++++++ 2 files changed, 200 insertions(+), 153 deletions(-) diff --git a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx index f9a8162a..8372d9d1 100644 --- a/src/pages/mini-apps/notifications/how-to-send-notifications.mdx +++ b/src/pages/mini-apps/notifications/how-to-send-notifications.mdx @@ -15,8 +15,9 @@ Notifications are queued on our servers, users may not receive them immediately. ## Manually sending notifications from Developer Portal -**Note: This form doesn't support localized notifications yet. -To take advantage of localizations, use the API.** + + This form doesn't support localized notifications yet. To take advantage of localizations, use the API. + You can send notifications to multiple wallet addresses (up to a thousand) directly from the Developer Portal. @@ -26,136 +27,49 @@ You can send notifications to multiple wallet addresses (up to a thousand) direc Use the form to input addresses, and content details. Once you click the `Send` button and get a success response, your notifications will be queued for delivery. -## Send Notification API{{ tag: "POST", label: "https://developer.worldcoin.org/api/v2/minikit/send-notification" }} - -This endpoint lets you send localized notifications to users of your mini app and requires an `api_key`. - -### How do localizations work? - -The user's language is available to you when they access your mini app -(via [Navigator](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language)). - -All you need to do is provide localizations. Our backend will automatically infer which language is preferred by the user. -Currently we support only a subset of languages, with plans to expand. Find the entire list [here](/mini-apps/notifications/how-to-send-notifications#supported-languages). -You can only specify languages that we support. - -- If a user prefers a language that we don't currently support, we will deliver the notification in English. -- If you don't specify a localization for the user's preferred language, the notification will not be delivered. - The response will include a specific `reason` to inform you of this. - - - - ### Body Params - - You are required to either specify both `title` and `message` OR `localisations`. - - - - The `wallet_addresses` is an array of wallet addresses to send the notification to. Users must have opted in to notifications for your app. Max 1000 users per call. - - - `localisations` is an array of objects with properties: - - `language` (string, required): The language of the notification. - - `title` (string, required): The localized title of the notification. - - `message` (string, required): The localized message of the notification. - It's required to provide at least the `en` language. - - - Note: This will not localize your notifications. The `title` is the title of the notification. It should be 30 characters or less. May contain emojis. - - - Note: This will not localize your notifications. The `message` is the message of the notification. It should be 200 characters or less. You can include the special variable `${username}` in your message, which will be replaced with the actual username of the recipient when the notification is delivered. - - - The `mini_app_path` is the url encoded path of the mini app where your notification should link to when the user clicks on it.

Should be of the format `worldapp://mini-app?app_id=[app_id]&path=[path]` (path is optional). -
- - The `app_id` is the identifier of the app initiating the transaction. - -
- - ### Request Headers - - - The `Authorization` header should be the `api_key` for your app from the Developer Portal. Make sure to - prefix it with `Bearer {api_key}`. - - - - - - ```bash {{ title: "cURL" }} - curl -X POST "https://developer.worldcoin.org/api/v2/minikit/send-notification" \ - -H "Authorization: Bearer {api_key}" \ - -H "Content-Type: application/json" \ - -d '{"app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], "localisations": [{"language": "en", "title": "title", "message": "Hello ${username}, your transaction is complete!"}], "mini_app_path": "mini_app_path"}' - ``` - ```js - fetch(apiUrl, { - method: 'POST', - headers: { - 'Authorization': 'Bearer {api_key}', - }, - body: JSON.stringify({ - app_id: "app_id", - wallet_addresses: ["0x123", "0x456"], - localisations: [ - { - language: "en", - title: "title", - message: "Hello ${username}, your transaction is complete!" - } - ], - mini_app_path: "mini_app_path" - }) - }) - ``` - - - -
-
-### Response - - - - - Indicates if the API request was successful. - - - The HTTP status code of the response. - - - An array of notification delivery results for each wallet address, where each item contains: - - `walletAddress` (string): The wallet address that the notification was attempted to be sent to - - `sent` (boolean): Whether the notification was successfully sent to this wallet address - - `reason` (string, optional): If the notification failed to send, this field contains the reason - - - - - - ```json - { - "success": true, - "status": 200, - "result": [ - { - "walletAddress": "0x377da9cab87c04a1d6f19d8b4be9aef8df26fcdd", - "sent": true - }, - { - "walletAddress": "0x444da9cab87c04a1d6f19d8b4be9aef8df26fcdd", - "sent": false, - "reason": "User has notification disabled for World App" - } - ] - } - ``` - - - -
+## Calling the send-notification endpoint + +The API endpoint provides capabilities for sending notifications programmatically. These notifications can be localized, +which ensures you reach users in their preferred language. This results in a dramatically higher engagement rate. + +### Localization made simple + +```javascript +const response = await fetch('https://developer.worldcoin.org/api/v2/minikit/send-notification', { + method: 'POST', + headers: { + Authorization: `Bearer ${process.env.API_KEY}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + app_id: 'your_app_id', + wallet_addresses: ['0x123...', '0x456...'], + localisations: [ + { + language: 'en', + title: '🎉 Rewards Available', + message: 'Hey ${username}, your daily rewards are ready!', + }, + { + language: 'es', + title: '🎉 Recompensas Disponibles', + message: 'Hola ${username}, tus recompensas diarias están listas!', + }, + { + language: 'fr', + title: '🎉 Récompenses Disponibles', + message: 'Salut ${username}, vos récompenses quotidiennes sont prêtes!', + }, + ], + mini_app_path: 'worldapp://mini-app?app_id=your_app_id&path=/rewards', + }), +}) +``` + +Each user automatically receives the notification in their preferred language. +If their language isn't included in your localizations, you'll receive a specific `reason` in the response. + +For complete API documentation including all supported languages and response formats, see the [API Reference](/mini-apps/reference/api#send-notification). ## Testing @@ -168,24 +82,4 @@ to enable notifications for your mini app inside of World App to receive them. - [Features & Guidelines](/mini-apps/notifications/guidelines) - [How To Request Notification Permissions](/mini-apps/commands/request-permission) - [How To Get Notification Permissions](/mini-apps/commands/get-permissions) - -## Supported Languages - -| Language | Code | -| ---------------------------- | -------- | -| English | `en` | -| Catalan | `ca` | -| Chinese Simplified | `zh_CN` | -| French | `fr` | -| German | `de` | -| Hindi | `hi` | -| Indonesian | `id` | -| Japanese | `ja` | -| Korean | `ko` | -| Malay | `ms` | -| Polish | `pl` | -| Portuguese | `pt` | -| Spanish | `es` | -| Spanish (Latin America) | `es_419` | -| Thai | `th` | -| Traditional Chinese (Taiwan) | `zh_TW` | +- [Send Notification API Reference](/mini-apps/reference/api#send-notification) diff --git a/src/pages/mini-apps/reference/api.mdx b/src/pages/mini-apps/reference/api.mdx index eb36f9fd..adb24be6 100644 --- a/src/pages/mini-apps/reference/api.mdx +++ b/src/pages/mini-apps/reference/api.mdx @@ -152,6 +152,159 @@ fetch(apiUrl, {
+## Send Notification API{{ tag: "POST", label: "https://developer.worldcoin.org/api/v2/minikit/send-notification" }} + +This endpoint lets you send localized notifications to users of your mini app and requires an `api_key`. + +### How do localizations work? + +The user's language is available to you when they access your mini app +(via [Navigator](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language)). + +All you need to do is provide localizations. Our backend will automatically infer which language is preferred by the user. +Currently we support only a subset of languages, with plans to expand. Find the entire list [here](/mini-apps/reference/api#supported-languages). +You can only specify languages that we support. + +- If a user prefers a language that we don't currently support, we will deliver the notification in English. +- If you don't specify a localization for the user's preferred language, the notification will not be delivered. + The response will include a specific `reason` to inform you of this. + + + + ### Body Params + + You are required to either specify both `title` and `message` OR `localisations`. + + + + The `wallet_addresses` is an array of wallet addresses to send the notification to. Users must have opted in to notifications for your app. Max 1000 users per call. + + + `localisations` is an array of objects with properties: + - `language` (string, required): The language of the notification. + - `title` (string, required): The localized title of the notification. + - `message` (string, required): The localized message of the notification. + It's required to provide at least the `en` language. + + + Note: This will not localize your notifications. The `title` is the title of the notification. It should be 30 characters or less. May contain emojis. + + + Note: This will not localize your notifications. The `message` is the message of the notification. It should be 200 characters or less. You can include the special variable `${username}` in your message, which will be replaced with the actual username of the recipient when the notification is delivered. + + + The `mini_app_path` is the url encoded path of the mini app where your notification should link to when the user clicks on it.

Should be of the format `worldapp://mini-app?app_id=[app_id]&path=[path]` (path is optional). +
+ + The `app_id` is the identifier of the app initiating the transaction. + +
+ + ### Request Headers + + + The `Authorization` header should be the `api_key` for your app from the Developer Portal. Make sure to + prefix it with `Bearer {api_key}`. + + + + + + ```bash {{ title: "cURL" }} + curl -X POST "https://developer.worldcoin.org/api/v2/minikit/send-notification" \ + -H "Authorization: Bearer {api_key}" \ + -H "Content-Type: application/json" \ + -d '{"app_id": "app_id", "wallet_addresses": ["0x123", "0x456"], "localisations": [{"language": "en", "title": "title", "message": "Hello ${username}, your transaction is complete!"}], "mini_app_path": "mini_app_path"}' + ``` + ```js + fetch(apiUrl, { + method: 'POST', + headers: { + 'Authorization': 'Bearer {api_key}', + }, + body: JSON.stringify({ + app_id: "app_id", + wallet_addresses: ["0x123", "0x456"], + localisations: [ + { + language: "en", + title: "title", + message: "Hello ${username}, your transaction is complete!" + } + ], + mini_app_path: "mini_app_path" + }) + }) + ``` + + + +
+
+### Response + + + + + Indicates if the API request was successful. + + + The HTTP status code of the response. + + + An array of notification delivery results for each wallet address, where each item contains: + - `walletAddress` (string): The wallet address that the notification was attempted to be sent to + - `sent` (boolean): Whether the notification was successfully sent to this wallet address + - `reason` (string, optional): If the notification failed to send, this field contains the reason + + + + + + ```json + { + "success": true, + "status": 200, + "result": [ + { + "walletAddress": "0x377da9cab87c04a1d6f19d8b4be9aef8df26fcdd", + "sent": true + }, + { + "walletAddress": "0x444da9cab87c04a1d6f19d8b4be9aef8df26fcdd", + "sent": false, + "reason": "User has notification disabled for World App" + } + ] + } + ``` + + + + +### Supported Languages + +| Language | Code | +| ---------------------------- | -------- | +| English | `en` | +| Catalan | `ca` | +| Chinese Simplified | `zh_CN` | +| French | `fr` | +| German | `de` | +| Hindi | `hi` | +| Indonesian | `id` | +| Japanese | `ja` | +| Korean | `ko` | +| Malay | `ms` | +| Polish | `pl` | +| Portuguese | `pt` | +| Spanish | `es` | +| Spanish (Latin America) | `es_419` | +| Thai | `th` | +| Traditional Chinese (Taiwan) | `zh_TW` | + +
+ ## Get Transaction{{ tag: "GET", label: "https://developer.worldcoin.org/api/v2/minikit/transaction/{transaction_id}?app_id=&type=" }} From e6cb11e08b01b17e4ff3d134394775790591ee85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:38:05 +0200 Subject: [PATCH 5/7] example --- src/pages/mini-apps/reference/api.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/mini-apps/reference/api.mdx b/src/pages/mini-apps/reference/api.mdx index adb24be6..9a89d373 100644 --- a/src/pages/mini-apps/reference/api.mdx +++ b/src/pages/mini-apps/reference/api.mdx @@ -274,6 +274,11 @@ You can only specify languages that we support. "walletAddress": "0x444da9cab87c04a1d6f19d8b4be9aef8df26fcdd", "sent": false, "reason": "User has notification disabled for World App" + }, + { + "walletAddress": "0x555da9cab87c04a1d6f19d8b4be9aef8df26fcdd", + "sent": false, + "reason": "User's preferred locale was not found in request" } ] } From 5fec8fd49c914f2f280916937c41d2ca951ef2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:41:03 +0200 Subject: [PATCH 6/7] cspell --- cspell.json | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/cspell.json b/cspell.json index 9a5c6ca5..b6f10c1f 100644 --- a/cspell.json +++ b/cspell.json @@ -3,11 +3,33 @@ "enabled": true, "language": "en-US", "allowCompoundWords": true, - "dictionaries": ["typescript", "node", "npm", "html"], - "enabledLanguageIds": ["typescript", "typescriptreact", "javascript", "markdown", "yaml", "json"], - "ignorePaths": ["**/node_modules", "package.json", "pnpm-lock.yaml"], - "ignoreWords": ["signup"], - "ignoreRegExpList": ["app_[a-z0-9]+", "jwk_[a-z0-9]+", "ey[a-zA-Z0-9]+\\.ey[a-zA-Z0-9]+\\.[a-zA-Z0-9]+"], + "dictionaries": [ + "typescript", + "node", + "npm", + "html" + ], + "enabledLanguageIds": [ + "typescript", + "typescriptreact", + "javascript", + "markdown", + "yaml", + "json" + ], + "ignorePaths": [ + "**/node_modules", + "package.json", + "pnpm-lock.yaml" + ], + "ignoreWords": [ + "signup" + ], + "ignoreRegExpList": [ + "app_[a-z0-9]+", + "jwk_[a-z0-9]+", + "ey[a-zA-Z0-9]+\\.ey[a-zA-Z0-9]+\\.[a-zA-Z0-9]+" + ], "words": [ "abitype", "anonymized", @@ -17,19 +39,25 @@ "CCIP", "clippy", "clsx", + "Completionist", "countup", "Csvg", "defi", "devs", "DEXABI", + "diarias", "disabletxpoolgossip", + "Disponibles", "Emoy", "enode", "erigon", "Eruda", + "están", "ETHSF", "Fbridge", "Fdashboard", + "gamification", + "Gamification", "gigagas", "groth", "gtag", @@ -48,6 +76,7 @@ "JWT", "keccak", "lazo", + "listas", "llms", "localised", "MateoSauton", @@ -66,6 +95,7 @@ "omnichain", "onramps", "Onramps", + "Optimising", "Orbz", "PAYG", "Paylodfor", @@ -75,15 +105,20 @@ "Pimlico", "Pimlico's", "POAP", + "prêtes", "Pyth", "Qppp", "qrcode", "quix", + "quotidiennes", "Rabby", "recma", + "Recompensas", + "Récompenses", "rehype", "reinitializes", "Rustification", + "Salut", "SDAI", "Sepolia", "shiki", @@ -91,6 +126,7 @@ "SIWE", "slugified", "snarkyjs", + "sont", "testid", "timestamptz", "tute", @@ -109,10 +145,6 @@ "zeth", "zkhack", "zrok", - "zustand", - "Completionist", - "gamification", - "Gamification", - "Optimising" + "zustand" ] } From 8edf3fbb86bcb4cca3d4979dc2bfa01eb03880fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Struck?= <98230431+michalstruck@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:44:06 +0200 Subject: [PATCH 7/7] fix link --- src/pages/mini-apps/reference/api.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/mini-apps/reference/api.mdx b/src/pages/mini-apps/reference/api.mdx index 9a89d373..44c8024f 100644 --- a/src/pages/mini-apps/reference/api.mdx +++ b/src/pages/mini-apps/reference/api.mdx @@ -152,7 +152,7 @@ fetch(apiUrl, {
-## Send Notification API{{ tag: "POST", label: "https://developer.worldcoin.org/api/v2/minikit/send-notification" }} +## Send Notification{{ tag: "POST", label: "https://developer.worldcoin.org/api/v2/minikit/send-notification" }} This endpoint lets you send localized notifications to users of your mini app and requires an `api_key`.