Skip to content
campaiDeveloper
campai.com

Crm · Work hours

POST/{organizationId}/{mandateId}/crm/work-hours/accounts/{accountId}/entries

Add work hours entry

Records work for an open work hours account on behalf of the member. The helper is a contact or, when the rule allows anyone, a name; rules limited to the account’s contacts only accept those. Staff who may edit work hours can approve the entry right away, unless they did the work themselves; otherwise it is submitted and routed to its reviewers.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Permission checks in detail
Required permissions
  • mandate.read
  • workHours.insert
Also checked, depending on the request and the records it touches
  • workHours.edit
  • workHours.read

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • accountIdidrequired

Body

Content-Type: application/json

  • datestringrequired
  • activitystringrequired

    2–100 characters

  • quantitynumberrequired

    0.25–99

  • helperobjectrequired
    Variant 1: 1 property
    • contactIdidrequired
    Variant 2: 1 property
    • namestringrequired

      2–80 characters

  • approvebooleanrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/crm/work-hours/accounts/YOUR_ACCOUNT_ID/entries' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • entryIdid
Response200
{
  "entryId": "000000000000000000000001"
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.