This API endpoint allows batch operations on sessions across multiple projects including sub sessions.

The request must group sessions by project ID using the following structure:

  • sessionsToUpdate: Hash where keys are project IDs and values are arrays of sessions to update (data fields are merged with existing data)
  • sessionsToAdd: Hash where keys are project IDs and values are arrays of sessions to create
  • sessionsToDelete: Hash where keys are project IDs and values are arrays of sessions to delete

Note: For update operations, only the data fields you specify will be updated. Existing fields not included in the request will be preserved.

Request Format:

{
  "sessionsToUpdate": {
    "project_id": [
      {
        "uuid": "existing-session-uuid",
        "data": { "field1": "updated-value" },
        "is_deleted": false
      }
    ]
  },
  "sessionsToAdd": {
    "project_id": [
      {
        "uuid": "new-session-uuid", 
        "unit_id": "device-1",
        "data": { "field1": "value1" }
      }
    ]
  },
  "sessionsToDelete": {
    "project_id": [
      {
        "uuid": "session-to-delete"
      }
    ]
  },
  "recalc": false
}

Example with multiple projects:

{
  "sessionsToUpdate": {
    "39": [
      {
        "uuid": "f5888307-c837-4401-b907-e2d1d26aff8a",
        "data": { "jobnumber": "3" }
      }
    ],
    "38": [
      {
        "uuid": "65ec3fb1-937a-45a1-bbe9-490c323f03bb", 
        "data": { "jobnumber": "3" }
      }
    ]
  },
  "recalc": false
}

Authentication: Use HTTP Basic Auth with username and password.

A successful call will return a JSON response with the results of each operation.

Params

Param name Description
project_id
required

The project ID number

Validations:

  • Must be a Integer

sessionsToUpdate
optional

Hash where keys are project IDs and values are arrays of sessions to update

Validations:

  • Must be a Hash

sessionsToAdd
optional

Hash where keys are project IDs and values are arrays of sessions to create

Validations:

  • Must be a Hash

sessionsToDelete
optional

Hash where keys are project IDs and values are arrays of sessions to delete

Validations:

  • Must be a Hash

source
optional

Source of the session operations

Validations:

  • Must be a String

recalc
optional

Whether to recalculate session data

Validations:

  • Must be a Boolean