Skip to main content
POST
/
plugin
Create add-on/plugin
curl --request POST \
  --url https://apiweb.mile.app/api/v3/plugin \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'name=<string>' \
  --form 'description=<string>' \
  --form resourceFile='@example-file' \
  --form icon='@example-file'
{
  "status": true,
  "message": "Plugin created successfully",
  "data": {
    "id": "68b440c9dad4c5d45707f6d2",
    "name": "Custom Dashboard Widget",
    "description": "A custom widget for displaying real-time analytics data",
    "resourceFile": "1756656087_Custom-Dashboard-Widget.js",
    "icon": "https://cdn.mile.app/plugins/icons/1756656087_dashboard-widget.svg",
    "organizationId": "686cc0ff083ca8093204f002",
    "resourceUrl": "https://cdn.mile.app/plugins/2025/08/31/686cc0ff083ca8093204f002/1756656087_Custom-Dashboard-Widget.js",
    "createdBy": "user@mile.app",
    "updatedBy": "user@mile.app",
    "createdTime": "2025-08-31T10:30:00.000000Z",
    "updatedTime": "2025-08-31T10:35:00.000000Z",
    "organizationName": "MileApp",
    "isUsed": false,
    "customModuleId": null,
    "status": "active"
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

multipart/form-data
name
string
required

Name of the add-on/plugin (3-100 characters, must be unique within your organization)

Required string length: 3 - 100
description
string
required
resourceFile
file
required

JavaScript file (.js) containing the add-on code (max 5MB). Must contain valid JavaScript syntax.

icon
file

SVG icon file (.svg) for the add-on (max 500KB, optional)

Response

Plugin created successfully

status
boolean
required

Operation success status

Example:

true

message
string
required

Success message

Example:

"Plugin created successfully"

data
object
required
Example:
{
"id": "68b440c9dad4c5d45707f6d2",
"name": "Custom Dashboard Widget",
"description": "A custom widget for displaying real-time analytics data",
"resourceFile": "1756656087_Custom-Dashboard-Widget.js",
"icon": "https://cdn.mile.app/plugins/icons/1756656087_dashboard-widget.svg",
"organizationId": "686cc0ff083ca8093204f002",
"resourceUrl": "https://cdn.mile.app/plugins/2025/08/31/686cc0ff083ca8093204f002/1756656087_Custom-Dashboard-Widget.js",
"createdBy": "user@mile.app",
"updatedBy": "user@mile.app",
"createdTime": "2025-08-31T10:30:00.000000Z",
"updatedTime": "2025-08-31T10:35:00.000000Z",
"organizationName": "MileApp",
"isUsed": false,
"customModuleId": null,
"status": "active"
}