Skip to content

Operational

Create, update and look up operational codes and the operational entries that log non-client time against them.

Create or update operational codes (upsert)

Request

🔐 Required role: TM_CODE_C

📖 Data dictionary: Time-management code

Create or update operational codes (upsert)

Operational codes classify non-client operational time.

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

A record updates the code its systemRef names: the same system and reference, the code with that Aiwyn ID when system is aiwyn, or else the code whose pmsRef is the reference. Without a systemRef, it updates the code whose pmsRef is attributes.pmsRef. When nothing matches, a new code 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. Some older operational codes appear in the lookup but aren't matched here, so sending one creates a new operational code.

AttributeTypeRequiredDefaultDescription
pmsRefstringNogeneratedReference in your practice management system.
codestringYes—Code value that operational entries reference.
displaystringYes—Name shown in Aiwyn.
descriptionstringNo—Longer description.
activebooleanNotruefalse deactivates the code.

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

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-codes \
  -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": "TRAINING"
        },
        "attributes": {
          "pmsRef": "TRAINING",
          "code": "TRAINING",
          "display": "Internal training",
          "active": true
        }
      }
    ]
  }'

Responses

All operational codes 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" } }