Skip to content
campaiDeveloper
campai.com

Crm · Work hours

GET/{organizationId}/{mandateId}/crm/work-hours/accountsReads only

List work hours accounts

Lists work hours accounts for accessible mandates, using the current period by default. You can select a period or all periods and filter by rule, contact, name, or userFilter, with pagination. The response includes the accounts and their reviewers, a count, rules, period settings, and booking settings; it is empty when work hours are not set up.

Permissions

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

Who may call it

  • The caller must have organization access.
  • The caller needs mandate.read and workHours.read.
  • Callers limited to assigned work hours entries see only accounts of their assigned entries.
  • Without user.read, other user actors are masked; the current actor is exempt from this check.
  • Without apiKey.read, API key actors are masked.
  • Legacy contact.read also permits contact actor details.
  • Any one of contact:member.read, contact:address.read, contact:customer.read, contact:sponsor.read, contact:contributor.read, contact:employee.read, or contact:supplier.read permits contact actor details, regardless of the contact type.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Query parameters

  • periodFromstring
  • allPeriodsboolean

    default false

  • ruleIdid
  • contactIdid
  • searchstring

    at most 100 characters

  • userFilterstringnullable
  • limitinteger

    1–200 · default 50

  • offsetinteger

    at least 0 · default 0

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

Response

200 Successful response

Content-Type: application/json

  • accountsobject[]

    When work hours are not set up, accounts is empty.

    19 properties
    • _idid
    • mandatesid[]
    • ruleobject
      15 properties
      • _idid
      • labelstring

        1–60 characters

      • unitstring
        hours shifts
      • requirednumber

        0–999

      • holderstring
        contact group
      • helpersstring
        members anyone
      • proRatastring
        none months
      • feeintegernullable

        at most 999999

      • buyoutobjectnullable
        2 properties
        • amountinteger

          at most 9999999

        • untilDaysinteger

          0–365

      • accountintegernullable

        1–999999999

      • costCenter1numbernullable

        1–99999999

      • costCenter2numbernullable

        1–99999999

      • eventCategoriesobject[]

        at most 10 items

        3 properties
        • namestring

          1–60 characters

        • nameNormalizedstring

          1–60 characters

        • bookingCategoryIdid
      • legalBasisstring

        at most 300 characters

      • decidedAtstringnullable
    • periodobject
      3 properties
      • yearinteger

        2000–2999

      • fromstring
      • tostring
    • deadlineAtstring
    • groupobjectnullable
      3 properties
      • _idid
      • namestring

        at most 40 characters

      • numberstring

        at most 24 characters

    • monthsinteger

      0–12

    • calculatedRequirednumber

      0–999

    • overrideobjectnullable
      2 properties
      • requirednumber

        0–999

      • reasonstring

        2–200 characters

    • requirednumber

      0–999

    • approvednumber

      at least 0

    • submittednumber

      at least 0

    • missingnumber

      at least 0

    • statusstring
      open settled
    • buyoutobjectnullable
      2 properties
      • atstring · date-time
      • byobject
    • settlementobjectnullable
      6 properties
      • atstring · date-time
      • byobject
      • missingnumber

        0–999

      • amountinteger

        0–9999999999

      • buyoutboolean
      • receiptobjectnullable
        3 properties
        • _idid
        • receiptNumberstring

          at most 30 characters

        • mandateid
    • contactobjectnullable
    • payerobjectnullable
    • reviewersobject[]

      Without user.read, accounts[].reviewers includes only the current user, if they are a reviewer.

  • countinteger

    count is zero when work hours are not set up.

  • rulesobject[]

    When work hours are not set up, rules is empty and periodStartMonth, periodFrom, and booking are null.

    4 properties
    • _idid
    • labelstring

      1–60 characters

    • unitstring
      hours shifts
    • activeboolean
  • periodStartMonthintegernullable
  • periodFromstringnullable

    periodFrom is null when contactId is supplied or allPeriods is true.

  • bookingobjectnullable
    3 properties
    • defaultMandateidnullable
    • sepaDirectDebitCashAccountidnullable
    • sepaCreditTransferCashAccountidnullable
Response200
{
  "accounts": [
    {
      "_id": "000000000000000000000001",
      "mandates": [
        "000000000000000000000001"
      ],
      "rule": {
        "_id": "000000000000000000000001",
        "label": "string",
        "unit": "hours",
        "required": 0,
        "holder": "contact",
        "helpers": "members",
        "proRata": "none",
        "fee": 1,
        "buyout": {
          "amount": 1,
          "untilDays": 0
        },
        "account": 1,
        "costCenter1": 1,
        "costCenter2": 1,
        "eventCategories": [
          {
            "name": "string",
            "nameNormalized": "string",
            "bookingCategoryId": "000000000000000000000001"
          }
        ],
        "legalBasis": "string",
        "decidedAt": "string"
      },
      "period": {
        "year": 2000,
        "from": "string",
        "to": "string"
      },
      "deadlineAt": "string",
      "group": {
        "_id": "000000000000000000000001",
        "name": "string",
        "number": "string"
      },
      "months": 0,
      "calculatedRequired": 0,
      "override": {
        "required": 0,
        "reason": "string"
      },
      "required": 0,
      "approved": 0,
      "submitted": 0,
      "missing": 0,
      "status": "open",
      "buyout": {
        "at": "2026-06-15T22:30:00Z",
        "by": {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        }
      },
      "settlement": {
        "at": "2026-06-15T22:30:00Z",
        "by": {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        },
        "missing": 0,
        "amount": 0,
        "buyout": true,
        "receipt": {
          "_id": "000000000000000000000001",
          "receiptNumber": "string",
          "mandate": "000000000000000000000001"
        }
      },
      "contact": {
        "name": "string",
        "type": "user",
        "userId": "string",
        "image": {
          "resource": "string"
        }
      },
      "payer": {
        "name": "string",
        "type": "user",
        "userId": "string",
        "image": {
          "resource": "string"
        }
      },
      "reviewers": [
        {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        }
      ]
    }
  ],
  "count": 1,
  "rules": [
    {
      "_id": "000000000000000000000001",
      "label": "string",
      "unit": "hours",
      "active": true
    }
  ],
  "periodStartMonth": 1,
  "periodFrom": "string",
  "booking": {
    "defaultMandate": "000000000000000000000001",
    "sepaDirectDebitCashAccount": "000000000000000000000001",
    "sepaCreditTransferCashAccount": "000000000000000000000001"
  }
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.