Create add-on
curl --request POST \
--url https://apiweb.mile.app/api/v3/addon \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'name=<string>' \
--form 'description=<string>' \
--form resourceFile=@example-file \
--form icon=@example-fileimport requests
url = "https://apiweb.mile.app/api/v3/addon"
files = {
"resourceFile": ("example-file", open("example-file", "rb")),
"icon": ("example-file", open("example-file", "rb"))
}
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('name', '<string>');
form.append('description', '<string>');
form.append('resourceFile', '<string>');
form.append('icon', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://apiweb.mile.app/api/v3/addon', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/addon",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/addon"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/addon")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/addon")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Add-on 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": "[email protected]",
"updatedBy": "[email protected]",
"createdTime": "2025-08-31T10:30:00.000000Z",
"updatedTime": "2025-08-31T10:35:00.000000Z",
"organizationName": "Acme Logistics",
"isUsed": false,
"isPublished": true,
"customModuleId": null,
"status": "active"
}
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}Add-ons
Create add-on
Creates a new add-on for your organization with JavaScript resource file and optional SVG icon. The add-on extends functionality within the app for your organization.
POST
/
addon
Create add-on
curl --request POST \
--url https://apiweb.mile.app/api/v3/addon \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'name=<string>' \
--form 'description=<string>' \
--form resourceFile=@example-file \
--form icon=@example-fileimport requests
url = "https://apiweb.mile.app/api/v3/addon"
files = {
"resourceFile": ("example-file", open("example-file", "rb")),
"icon": ("example-file", open("example-file", "rb"))
}
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('name', '<string>');
form.append('description', '<string>');
form.append('resourceFile', '<string>');
form.append('icon', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://apiweb.mile.app/api/v3/addon', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/addon",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/addon"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/addon")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/addon")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"resourceFile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"icon\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Add-on 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": "[email protected]",
"updatedBy": "[email protected]",
"createdTime": "2025-08-31T10:30:00.000000Z",
"updatedTime": "2025-08-31T10:35:00.000000Z",
"organizationName": "Acme Logistics",
"isUsed": false,
"isPublished": true,
"customModuleId": null,
"status": "active"
}
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}{
"status": true,
"message": "<string>",
"failedCode": "<string>"
}Authorizations
Use a valid Bearer token to authenticate.
Body
multipart/form-data
Name of the add-on (3-100 characters, must be unique within your organization)
Required string length:
3 - 100JavaScript file (.js) containing the add-on code (max 5MB). Must contain valid JavaScript syntax.
SVG icon file (.svg) for the add-on (max 500KB, optional)
Response
Add-on created successfully
Operation success status
Example:
true
Success message
Example:
"Add-on created successfully"
Show child attributes
Show child attributes
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": "[email protected]",
"updatedBy": "[email protected]",
"createdTime": "2025-08-31T10:30:00.000000Z",
"updatedTime": "2025-08-31T10:35:00.000000Z",
"organizationName": "Acme Logistics",
"isUsed": false,
"isPublished": true,
"customModuleId": null,
"status": "active"
}