Notification Service API Documentation
Welcome to the interactive API documentation for the Notification Service. This platform enables you to send notifications across multiple channels including Email, Lark, and Slack with a unified API interface.
Base URL
https://notification.api.dev.levart.id/api
All API endpoints are relative to this base URL
Authentication
Secure your API requests using one of two methods:
-
โข
API Credential: Use
X-API-Credentialheader -
โข
Sanctum Token: Use
Authorization: Bearer {token}
Interactive Testing
Test API endpoints directly from this page:
- โข Edit request payloads in real-time
- โข View live responses with status codes
- โข Copy dynamic cURL commands
Multi-Channel Support
Send notifications across multiple platforms:
Template System
Use pre-configured templates with features:
- โข Variable substitution
- โข Multi-language support
- โข File attachments
Quick Start Guide
- 1 Enter your API Credential in the input field at the top of the page
- 2 Browse available endpoints in the sidebar (Email, Lark, Slack, Templates)
- 3 Click an endpoint to expand and view parameters and examples
- 4 Edit the request payload in the "Try It Out" section
- 5 Click "๐ Send Request" to test the API and view the response
Best Practices
- โข Always validate your JSON payload before sending requests
- โข Keep your API credentials secure and never expose them in client-side code
- โข Use templates for consistent messaging across your application
- โข Check response status codes and handle errors appropriately
-
โข
For file uploads, use
multipart/form-datacontent type
Email API Endpoints
PostMessageRaw
https://notification.api.dev.levart.id/api/email/1/post-message-raw
Send raw email message payload
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| to | string | Required | Recipient email address |
| subject | string | Required | Email subject line |
| message | string | Required | Email message body |
๐งช Try It Out
Code Examples
Success Response:
{
"success": true,
"message": "Email sent successfully",
"log_id": 123
}
Error Response:
{
"success": false,
"message": "Email address (to) is required",
"log_id": null
}
Lark API Endpoints
PostMessageRaw
https://notification.api.dev.levart.id/api/lark/2/post-message-raw
Send a raw message to Lark using chat.postMessage API
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | string | Required | Lark channel ID (e.g., oc_xxxxxx) |
| text | string | Required | Message text content |
๐งช Try It Out
Code Examples
Success Response:
{
"code": 0,
"msg": "success",
"data": {
"message_id": "om_xxxxxx",
"root_id": "om_xxxxxx",
"parent_id": "om_xxxxxx"
},
"log_id": 123
}
Error Response:
{
"code": 1,
"msg": "Channel is required",
"data": null
}
PostMessage
https://notification.api.dev.levart.id/api/lark/2/post-message
Send a simple text message to Lark
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| text | string | Required | Message text content |
| channel | string | Required | Lark channel ID |
๐งช Try It Out
Code Examples
Success Response:
{
"code": 0,
"msg": "success",
"data": {
"message_id": "om_xxxxxx"
},
"log_id": 123
}
Error Response:
{
"code": 1,
"msg": "Text field is required",
"data": null
}
UploadFiles
https://notification.api.dev.levart.id/api/lark/2/upload-files
Upload files to Lark
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| mode | string | Required | Upload mode: "upload" or "paths" |
| files | array | Optional | File objects for upload mode |
| paths | array | Optional | File paths for paths mode |
| disk | string | Optional | Disk name (required for paths mode) |
๐งช Try It Out
Code Examples
Success Response:
{
"code": 0,
"msg": "success",
"data": {
"files": [
{
"file_token": "file_token_xxxxxx",
"file_id": "file_id_xxxxxx"
}
]
},
"log_id": 123
}
Error Response:
{
"code": 1,
"msg": "Please select files to upload or provide file paths",
"data": null
}
PostApproval
https://notification.api.dev.levart.id/api/lark/2/post-approval
Send an approval request message
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| approvalId | integer | Required | Approval request ID |
| chatId | string | Required | Lark chat ID |
| description | string | Required | Approval description |
| descriptionConfirmation | string | Optional | Confirmation message |
| files | array | Optional | Optional file attachments |
๐งช Try It Out
Code Examples
Success Response:
{
"code": 0,
"msg": "success",
"data": {
"message_id": "om_xxxxxx"
},
"log_id": 123
}
Error Response:
{
"code": 1,
"msg": "Approval ID is required",
"data": null
}
Slack API Endpoints
PostMessageRaw
https://notification.api.dev.levart.id/api/slack/3/post-message-raw
Send a raw message to Slack using chat.postMessage API
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | string | Required | Slack channel ID (e.g., C1234567890) |
| text | string | Required | Message text content |
| thread_ts | string | Optional | Thread timestamp for replies |
๐งช Try It Out
Code Examples
Success Response:
{
"ok": true,
"channel": "C1234567890",
"ts": "1234567890.123456",
"message": {
"text": "Hello from API!",
"user": "U1234567890",
"ts": "1234567890.123456"
},
"log_id": 123
}
Error Response:
{
"ok": false,
"error": "Channel is required"
}
PostMessage
https://notification.api.dev.levart.id/api/slack/3/post-message
Send a simple text message to Slack
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| text | string | Required | Message text content |
| channel | string | Required | Slack channel ID |
๐งช Try It Out
Code Examples
Success Response:
{
"ok": true,
"channel": "C1234567890",
"ts": "1234567890.123456",
"message": {
"text": "Hello from PostMessage API!",
"user": "U1234567890",
"ts": "1234567890.123456"
},
"log_id": 123
}
Error Response:
{
"ok": false,
"error": "Text field is required"
}
Update
https://notification.api.dev.levart.id/api/slack/3/update
Update an existing message in Slack
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts | string | Required | Message timestamp to update |
| text | string | Required | New message text |
| channel | string | Required | Slack channel ID |
๐งช Try It Out
Code Examples
Success Response:
{
"ok": true,
"channel": "C1234567890",
"ts": "1234567890.123456",
"text": "Updated message text",
"log_id": 123
}
Error Response:
{
"ok": false,
"error": "Timestamp (ts) is required"
}
UploadFiles
https://notification.api.dev.levart.id/api/slack/3/upload-files
Upload files to Slack
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| mode | string | Required | Upload mode: "upload" or "paths" |
| files | array | Optional | File objects for upload mode |
| paths | array | Optional | File paths for paths mode |
| disk | string | Optional | Disk name (required for paths mode) |
๐งช Try It Out
Code Examples
Success Response:
{
"ok": true,
"file": {
"id": "F1234567890",
"name": "file.txt",
"url_private": "https:\/\/files.slack.com\/files-private\/..."
},
"log_id": 123
}
Error Response:
{
"ok": false,
"error": "Please select files to upload or provide file paths"
}
PostApproval
https://notification.api.dev.levart.id/api/slack/3/post-approval
Send an approval request message with approve/reject buttons
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| approvalId | integer | Required | Approval request ID |
| channel | string | Required | Slack channel ID |
| description | string | Required | Approval description |
| descriptionConfirmation | string | Optional | Confirmation message |
| files | array | Optional | Optional file attachments |
๐งช Try It Out
Code Examples
Success Response:
{
"ok": true,
"channel": "C1234567890",
"ts": "1234567890.123456",
"message": {
"text": "Approval request",
"blocks": []
},
"log_id": 123
}
Error Response:
{
"ok": false,
"error": "Approval ID is required"
}
Message Templates
Template-based messaging API for sending pre-configured message templates with variable substitution
Send Template Message
https://notification.api.dev.levart.id/api/templates/send
Send a message using a pre-configured template with variable substitution. Supports file attachments and multiple channels (Email, Lark, Slack).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| template_id | string | Required | Unique identifier of the message template |
| receiver | string | Required | Recipient identifier (email address, Lark user ID, or Slack user ID) |
| variables | object | Optional | Key-value pairs for template variable substitution (e.g., {"name": "John", "amount": "100"}) |
| lang | string | Optional | Language code for template (e.g., "en", "id"). Defaults to template's default language |
| channel | string | Optional | Override channel for template (email, lark, or slack) |
| attachments.* | file | Optional | File attachments (max 10MB per file). Use multipart/form-data for file uploads |
๐งช Try It Out
Code Examples
Success Response:
{
"success": true,
"message": "Template message sent successfully",
"data": {
"template_id": "welcome_email",
"receiver": "user@example.com",
"channel": "email",
"log_id": 456
}
}
Error Response:
{
"success": false,
"message": "Template not found",
"errors": {
"template_id": [
"The specified template does not exist"
]
}
}