Skip to main content
PUT
/
automation
/
{automation_id}
Update automation by ID
curl --request PUT \
  --url https://apiweb.mile.app/api/v3/automation/{automation_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "event": "<string>",
  "automationType": "<string>",
  "dataType": "<string>",
  "isActive": "<string>"
}
'
{
  "status": true,
  "message": "Success",
  "data": {
    "name": "Auto webhook automation",
    "event": "onTaskFinished",
    "automationType": "webhook",
    "dataType": "task",
    "automationDetails": {
      "url": "https://apiweb.mile.app/webhook",
      "headers": {
        "x-api-key": "1234e98498ce07d29474a7ev2",
        "org": "global"
      }
    },
    "rules": {
      "flow": "Pickup",
      "flowId": "667b712f63020e5f182f0cb2"
    },
    "organizationId": "621dd813eb3ebf16b94dbde3",
    "isActive": true,
    "updatedTime": "2022-07-13T03:16:40+00:00",
    "createdTime": "2022-07-13T03:16:40+00:00",
    "_id": "62ce3918d3f3e1681a3a54b5"
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Path Parameters

automation_id
string
required

Unique identifier for automation that generated by system. Example: 62ce3918d3f3e1681a3a54b5

Body

application/json
name
string
required

Automation's name. Example: Auto create task automation

event
string
required

Act as a trigger that start an automation. There are 8 different types. enum: onTaskCreated, onTaskFinished, onTaskAssigned, onDataSourceCreated, onRoutingResultFinished, onRoutingResultDispatched, onStartTrip, onFinishTrip onTaskCreated: Automation will happen when a task is created. onTaskFinished: Automation will happen when a task is finished (status task: Done). onTaskAssigned: Automation will happen when a task is assigned to field user(s). onDataSourceCreated: Automation will happen when a data source is created. onRoutingResultFinished: Automation will happen when a routing created is created. onRoutingResultDispatched: Automation will happen when a routing is dispatched. onStartTrip: Automation will happen when a start trip is triggered. onFinishTrip: Automation will happen when a finish trip is triggered. Example: onTaskFinished

automationType
string
required

Automation's type. The changes you want to automate. There are 6 different types: enum: createTask, createAssignTask, moveTask, assignTask, webhook, createOrUpdateDataSource, notification createTask: The task will create when an event happens. Example: createTask

dataType
string

Automation's data type. There are 4 different types. enum: task, data, routingResult, locationHistory Default: task

isActive
string

Automation's active state, only active automation will proceed by system Default: true

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

data
object

Detail of object automation.