Update insight context
curl --request PUT \
--url https://apiweb.mile.app/api/v3/ai-insight/context/{objectId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"objectDescription": "<string>",
"fieldList": [
{
"key": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}"
payload = {
"objectDescription": "<string>",
"fieldList": [
{
"key": "<string>",
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
objectDescription: '<string>',
fieldList: [{key: '<string>', description: '<string>'}]
})
};
fetch('https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}', 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/ai-insight/context/{objectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'objectDescription' => '<string>',
'fieldList' => [
[
'key' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/ai-insight/context/{objectId}"
payload := strings.NewReader("{\n \"objectDescription\": \"<string>\",\n \"fieldList\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objectDescription\": \"<string>\",\n \"fieldList\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objectDescription\": \"<string>\",\n \"fieldList\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"updatedTime": "2026-10-16T02:00:00.000000Z",
"updatedBy": "[email protected]"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Insight
Update insight context
Saves your edits to the context of a task type. Only fields of the task type (and fields already in the context) are kept. autoGenerateFrequency turns scheduled reports on: weekly or monthly, or none to stop them.
Requires the edit/ai-insight permission.
PUT
/
ai-insight
/
context
/
{objectId}
Update insight context
curl --request PUT \
--url https://apiweb.mile.app/api/v3/ai-insight/context/{objectId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"objectDescription": "<string>",
"fieldList": [
{
"key": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}"
payload = {
"objectDescription": "<string>",
"fieldList": [
{
"key": "<string>",
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
objectDescription: '<string>',
fieldList: [{key: '<string>', description: '<string>'}]
})
};
fetch('https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}', 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/ai-insight/context/{objectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'objectDescription' => '<string>',
'fieldList' => [
[
'key' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/ai-insight/context/{objectId}"
payload := strings.NewReader("{\n \"objectDescription\": \"<string>\",\n \"fieldList\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objectDescription\": \"<string>\",\n \"fieldList\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/ai-insight/context/{objectId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objectDescription\": \"<string>\",\n \"fieldList\": [\n {\n \"key\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"updatedTime": "2026-10-16T02:00:00.000000Z",
"updatedBy": "[email protected]"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Authorizations
Use a valid Bearer token to authenticate.
Path Parameters
Task type (flow) id.
Example: 64ee1a2b3c4d5e6f7a8b9c0d
Body
application/json
What the task type is used for.
Example: Last-mile delivery of parcels to customer addresses.
Description per field. Each entry needs key.
Show child attributes
Show child attributes
Scheduled report frequency.
Available options:
none, weekly, monthly Response
Success
The response is of type object.