uslimato
|

Processes API

Base URL

https://api.uslimato.com/v1

Required scope: processes:read (read operations) or processes:write (write operations).


List Processes

GET /processes

Returns all available process definitions.

Response:

{
  "data": [
    {
      "id": "clx...",
      "name": "Employee Onboarding",
      "slug": "employee-onboarding",
      "description": "Onboard a device for a new employee",
      "trigger_status": "preparing",
      "target_status": "in_use",
      "is_system": true,
      "steps": [
        { "type": "user_picker", "key": "assigned_user", "label": "Assigned To", "required": true },
        { "type": "checklist", "key": "setup_checklist", "label": "Setup Checklist", "items": ["Install OS", "Configure MDM", "Test connectivity"] },
        { "type": "signature", "key": "handover_signature", "label": "Handover Signature" },
        { "type": "complete", "key": "confirm", "label": "Confirm handover" }
      ]
    }
  ]
}

List Process Instances

GET /processes/instances

Returns process instances (in-progress and completed).

Query Parameters:

ParameterTypeDescription
statusstringFilter by in_progress, completed, or cancelled
asset_idstringFilter by asset
process_idstringFilter by process definition

Start Process

POST /processes/:process_id/start

Required scope: processes:write

Starts a new process instance for an asset.

Request Body:

{
  "asset_id": "clx..."
}

Response: { "data": { ...process_instance } }


Advance Process Step

POST /processes/instances/:instance_id/advance

Required scope: processes:write

Submits data for the current step and advances to the next.

Request Body:

{
  "step_data": {
    "assigned_user": "user-id",
    "setup_checklist": ["Install OS", "Configure MDM", "Test connectivity"],
    "handover_signature": "data:image/png;base64,..."
  }
}

The response contains the updated instance with the new current_step index. If this was the final step, the instance status becomes completed.


Process Instance Object

{
  "id": "clx...",
  "process_id": "clx...",
  "asset_id": "clx...",
  "status": "in_progress",
  "current_step": 1,
  "step_data": {},
  "process_name": "Employee Onboarding",
  "asset_name": "MacBook Pro 14\" M3",
  "asset_tag": "USL-00042",
  "started_by_name": "Alice Admin",
  "started_at": "2024-11-20T10:00:00Z",
  "completed_at": null
}