Skip to main content
POST
/
activity
Create Activity
curl --request POST \
  --url https://apiweb.mile.app/api/v3/activity \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workflowId": "68f2198aef526585c30e16d2",
  "hubId": "68ff42815ed967adac0f7192",
  "tasks": [
    {
      "customerName": "John Doe",
      "customerAddress": "Jl. Sudirman No. 1, Jakarta",
      "pickupCoordinate": "-6.2088,106.8456",
      "assignee": [
        "driver@example.com"
      ],
      "startTime": "2025-10-31T08:55:00.000+07:00",
      "endTime": "2025-11-01T08:55:00.000+07:00",
      "hubId": "68ff42815ed967adac0f7192",
      "createdFrom": "WEB"
    },
    {
      "recipientName": "Jane Smith",
      "recipientAddress": "Jl. Pajajaran No. 10, Bogor",
      "deliveryCoordinate": "-6.5950,106.8167",
      "assignee": [],
      "startTime": "2025-10-31T08:55:00.000+07:00",
      "endTime": "2025-11-01T08:55:00.000+07:00",
      "hubId": "68ff42815ed967adac0f7192",
      "createdFrom": "WEB"
    }
  ]
}
'
{
  "status": true,
  "code": 201,
  "message": "Activity created successfully",
  "data": {
    "_id": "634e98098ce07d29474a7e22",
    "taskType": "activityMaster",
    "title": "Pickup to Delivery",
    "workflowId": "68f2198aef526585c30e16d2",
    "subId": [
      "634e98098ce07d29474a7e23",
      "634e98098ce07d29474a7e24"
    ],
    "status": "ONGOING",
    "assignee": [
      "driver@example.com"
    ],
    "startTime": "2025-10-31T08:55:00.000+07:00",
    "endTime": "2025-11-01T08:55:00.000+07:00",
    "hubId": "68ff42815ed967adac0f7192",
    "organizationId": "634e98098ce07d29474a7e20",
    "createdBy": "admin@example.com",
    "createdTime": "2025-10-31T08:50:00.000+07:00"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.mileapp.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json
workflowId
string
required

ID of the Workflow that defines the steps for this Activity. Must reference an existing Workflow in your organization.

Example:

"68f2198aef526585c30e16d2"

tasks
object[]
required

Array of step task objects. The array length must equal the Workflow's number of steps; the order of objects matches the order of workflow.steps. Each object carries the schedule, assignee, and Flow-specific data fields for one Workflow step.

hubId
string

Optional hub ID where this Activity is executed. Inherited by all child tasks.

Example:

"68ff42815ed967adac0f7192"

Response

Activity created successfully. The response contains the master task object. workflow.steps is omitted from the response to reduce payload size — read the Workflow directly if you need the step definitions.

status
boolean
Example:

true

code
integer
Example:

201

message
string
Example:

"Activity created successfully"

data
object

The newly-created Activity master task. The shape follows the standard Task object with taskType = activityMaster.