FleetWorkAPI Docs
Job Management

Bulk Create Jobs

Create multiple jobs in a single API call.

POST/api/v1/workspace/jobs/bulk-create

Request Body

FieldTypeRequiredDescription
jobsarrayRequiredArray of job objects — same schema as Create Job

Each Shipment job (jobType=1) in the array must still have exactly 2 tasks (1 Pick + 1 Drop). Rules are validated per job.

{
  "jobs": [
    {
      "jobName": "Job A",
      "jobStatus": 1,
      "jobType": 1,
      "tasks": [
        {
          "taskName": "Pick up at Warehouse",
          "taskType": 1,
          "shipmentProperty": { "shipmentType": 1 },
          "place": {
            "refId": "WH-001",
            "name": "Main Warehouse",
            "address": "100 Warehouse St, D7",
            "lat": 10.74,
            "lng": 106.72
          }
        },
        {
          "taskName": "Deliver to Customer A",
          "taskType": 1,
          "shipmentProperty": { "shipmentType": 2 },
          "place": {
            "refId": "CUST-A-001",
            "name": "Customer A",
            "address": "123 Le Loi, D1",
            "lat": 10.7731,
            "lng": 106.703
          }
        }
      ]
    },
    {
      "jobName": "Job B",
      "jobStatus": 1,
      "jobType": 1,
      "tasks": [
        {
          "taskName": "Pick up at Depot",
          "taskType": 1,
          "shipmentProperty": { "shipmentType": 1 },
          "place": {
            "refId": "DEPOT-002",
            "name": "Depot B",
            "address": "200 Industrial Rd, D12",
            "lat": 10.756,
            "lng": 106.695
          }
        },
        {
          "taskName": "Deliver to Customer B",
          "taskType": 1,
          "shipmentProperty": { "shipmentType": 2 },
          "place": {
            "refId": "CUST-B-001",
            "name": "Customer B",
            "address": "456 Hai Ba Trung, D3",
            "lat": 10.7856,
            "lng": 106.6862
          }
        }
      ]
    }
  ]
}

Example

Request

curl -X POST \
  "https://live.fleetwork.vn/api/v1/workspace/jobs/bulk-create" \
  -H "API-KEY: <your-key>" \
  -H "Content-Type: application/json" \
  -d '{"jobs":[{"jobName":"Job A","jobStatus":1,"jobType":1,"tasks":[{"taskName":"Pick up","taskType":1,"shipmentProperty":{"shipmentType":1},"place":{"refId":"WH-001","name":"Warehouse","address":"100 Warehouse St","lat":10.74,"lng":106.72}},{"taskName":"Deliver","taskType":1,"shipmentProperty":{"shipmentType":2},"place":{"refId":"CUST-A-001","name":"Customer A","address":"123 Le Loi","lat":10.7731,"lng":106.703}}]}]}'

Response

{
  "code": "OK",
  "message": null,
  "data": {
    "totalJobs": 2,
    "successCount": 2,
    "failedCount": 0,
    "results": [
      {
        "index": 0,
        "jobId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "isSuccess": true,
        "jobName": "Job A"
      },
      {
        "index": 1,
        "jobId": "a1b2c3d4-5717-4562-b3fc-2c963f66afa6",
        "isSuccess": true,
        "jobName": "Job B"
      }
    ]
  }
}

On this page