Skip to content

Create or update operational entries (upsert)

Request

🔐 Required role: TM_ENTRY_C

📖 Data dictionary: Time-management entry

Create or update operational entries (upsert)

Every record is saved with type OperationalEntry, so records carry no type. Maximum 100 records per request.

A record updates the entry its systemRef names: the same system and reference, the entry with that Aiwyn ID when system is aiwyn, or else the entry whose pmsRef is the reference. Without a systemRef, it updates the entry whose pmsRef is attributes.pmsRef. When nothing matches, a new entry is created. Attributes left out of an update keep their values. A record with any field other than systemRef and attributes is rejected with 400.

AttributeTypeRequiredDefaultDescription
pmsRefstringNogeneratedReference in your practice management system.
loggedAtdate-timeYes—When the time was logged; see below.
loggedStaffIdAiwyn ID or {system, reference}Yes—Staff member.
codestringNo—Operational code code; an active code is preferred when several share it.
operationalCodeIdintegerNo—Aiwyn ID of the operational code; wins over code.
unitsnumberNo1Hours.
commentstringNo—Comment.
internalNotesstringNo—Note for your firm.
serviceLineIdAiwyn ID or {system, reference}No—Service line.
statusstringNoDRAFTDRAFT or SUBMITTED.
submittedStaffIdAiwyn ID or {system, reference}No—Staff member who submitted it.
submittedDatedate-timeNo—When it was submitted.
activebooleanNotruefalse deactivates the entry.

Select the operational code with code or operationalCodeId; one of them is required. loggedAt takes a date (read as midnight), a date-time without an offset (stored as sent), or one with Z or an offset (converted to UTC).

A record fails with INACTIVE_RESOURCE when the staff member is inactive, CONVERSION_ERROR for an unknown code, UNRESOLVED_REFERENCE when a {system, reference} matches no staff member, service line or submitting staff member (an Aiwyn ID is stored as sent, without a check), BUILD_ERROR when a required attribute, or both the code and its ID, are missing, and VALIDATION_ERROR for a negative units or a blank reference in loggedStaffId.

Custom fields your firm defines for OperationalEntry are accepted too; list them with GET /api/v1/entries/schema/OperationalEntry.

Each record succeeds or fails on its own: 200, 207 or 422 say whether all, some or none succeeded — see Batch writes: per-record results.

Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Bodyapplication/jsonrequired
recordsArray of objectsrequired

Records

curl -i -X POST \
  https://api.sandbox.aiwyn.app/api/v1/operational-entries \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'CF-Access-Client-Id: YOUR_API_KEY_HERE' \
  -H 'CF-Access-Client-Secret: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "records": [
      {
        "systemRef": {
          "system": "PM",
          "reference": "op-entry-001"
        },
        "attributes": {
          "loggedAt": "2026-06-17T09:00:00Z",
          "loggedStaffId": {
            "system": "PM",
            "reference": "12345"
          },
          "code": "TRAINING",
          "units": 1.5,
          "comment": "Internal training"
        }
      }
    ]
  }'

Responses

All operational entries processed successfully

Bodyapplication/json
dataobject
errorobject or null
metaobject
Response
{ "data": { "summary": {}, "records": [ … ] }, "error": {}, "meta": { "success": true, "message": "string", "timestamp": "2019-08-24T14:15:22Z", "version": "string" } }