Skip to content

Create staff types in batch

Request

🔐 Required role: STF_TYP_C

📖 Data dictionary: Staff

Create staff types in batch

Creates up to 100 staff types in a single request.

Notes:

  • The request body is JSON { "items": [ ... ] } where items is an array of staff type objects (same shape as single /create).
  • items must contain 1–100 elements; otherwise the request is rejected with 400.
  • Successful creates appear under succeeded; failures appear under failed with an error message (partial success is allowed).
  • 201 when every item succeeds; 422 when every item fails; 200 when there is a mix of successes and failures.

Response body (201, 200 and 422): the body is not wrapped in data/meta. It always has both arrays; index is the item's position in the request items.

{
  "succeeded": [ { "index": 0, "display": "Associate", "id": 41 } ],
  "failed": [ { "index": 1, "display": "Manager", "message": "Sorry, the specified permission set was not found or is not active." } ]
}
  • succeeded[]: index (integer), display (string), id (integer, id of the new staff type)
  • failed[]: index (integer), display (string), message (string, why the item was not created)
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Bodyapplication/jsonrequired
itemsArray of objectsrequired

Items

curl -i -X POST \
  https://api.sandbox.aiwyn.app/api/v1/staff/type/batch/create \
  -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 '{
    "items": [
      {
        "display": "Associate",
        "description": "Associate staff type"
      },
      {
        "display": "Manager",
        "description": "Manager staff type"
      }
    ]
  }'

Responses

Partial success — some staff types were created and some failed

Bodyapplication/json
succeededArray of objectsrequired

Succeeded

failedArray of objectsrequired

Failed

Response
{ "succeeded": [ { … } ], "failed": [ { … } ] }