Skip to content

Create or update time management code records (upsert)

Request

🔐 Required role: TM_CODE_C

📖 Data dictionary: Time-management code

Create or update time management code records (upsert)

Records are created if they don't exist, or updated if matched by systemRef. Maximum 100 records per request.

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. A type that is not a code type returns 400.

ExpenseCode

Expense codes classify ExpenseEntry records. Persist them here first, then reference them from entries by code (the exact code value) or by expenseCodeId. See the ExpenseCode request sample.

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/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": [
      {
        "type": "ExpenseCode",
        "systemRef": {
          "system": "PM",
          "reference": "TRAVEL"
        },
        "attributes": {
          "pmsRef": "TRAVEL",
          "code": "TRAVEL",
          "display": "Travel",
          "description": "Mileage, airfare and lodging",
          "billable": true,
          "reimbursable": true,
          "taxable": false,
          "active": true
        }
      }
    ]
  }'

Responses

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