Skip to content
campaiDeveloper
campai.com

Crm · Work hours

GET/{organizationId}/{mandateId}/crm/work-hours/accounts/{accountId}Reads only

Get work hours account

Gets a work hours account by organization, mandate and account ID. The response includes the account, its entries and reviewers, covered contacts, history and notes, buyout deadline, and booking settings.

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.
  • The caller needs workHours.read.
  • With assigned-only work hours access, the caller can get the account only if their user ID is a reviewer on at least one entry.
  • The legacy contact.read permission also allows contact actor details to be shown.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • accountIdidrequired
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/YOUR_ACCOUNT_ID' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • accountobject
    34 properties
    • _idid
    • createdAtstring · date-timenullable
    • updatedAtstring · date-timenullable
    • removedAtstring · date-timenullable
    • createdByobjectnullable

      Without user.read, user actors such as account.createdBy are masked, except for the caller's own actor.

      Without apiKey.read, API actors such as account.createdBy are masked, including the caller's own API actor.

    • updatedByobjectnullable
    • removedByobjectnullable
    • __ignoreTriggersstringnullable
    • organizationid
    • mandatesid[]
    • mandateScopestring
      selected all
    • 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
    • reminderSentForDeadlinestringnullable
    • groupobjectnullable
      3 properties
      • _idid
      • namestring

        at most 40 characters

      • numberstring

        at most 24 characters

    • contactsid[]

      at most 100 items

    • 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

    • reviewerUserIdsstring[]

      at most 100 items · each at least 1 characters

    • 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
    • changesobject[]

      at most 1000 items

    • notesobject[]
      6 properties
      • idstring

        exactly 6 characters

      • contentstring

        at most 4000 characters

      • writtenAtstring · date-time
      • writtenByobject
      • updatedAtstring · date-time
      • updatedByobject
    • contactobjectnullable
    • payerobjectnullable
    • contactActorsobject[]
    • buyoutDeadlinestringnullable

      account.buyoutDeadline is null when the account's rule has no buyout.

  • bookingobjectnullable

    booking is null when work hours settings are unavailable.

    3 properties
    • defaultMandateidnullable
    • sepaDirectDebitCashAccountidnullable
    • sepaCreditTransferCashAccountidnullable
  • entriesobject[]
    30 properties
    • _idid
    • createdAtstring · date-timenullable
    • updatedAtstring · date-timenullable
    • removedAtstring · date-timenullable
    • createdByobjectnullable
    • updatedByobjectnullable
    • removedByobjectnullable
    • __ignoreTriggersstringnullable
    • organizationid
    • mandatesid[]
    • mandateScopestring
      selected all
    • accountid
    • ruleid
    • periodobject
      3 properties
      • yearinteger

        2000–2999

      • fromstring
      • tostring
    • unitstring
      hours shifts
    • datestring
    • activitystring

      2–100 characters

    • quantitynumber

      0.25–99

    • statusstring
      draft submitted approved
    • submittedAtstring · date-timenullable
    • submittedByobjectnullable
    • submittedOnBehalfboolean
    • reviewsobject[]

      at most 100 items

      4 properties
      • atstring · date-time
      • byobject
      • decisionstring
        submitted returned approved revoked
      • messagestringnullable

        at most 2000 characters

    • changesobject[]

      at most 100 items

      4 properties
      • atstring · date-time
      • byobject
      • previousQuantitynumber

        at least 0

      • quantitynumber

        at least 0

    • reviewerUserIdsstring[]

      at most 100 items · each at least 1 characters

    • approvedAtstring · date-timenullable
    • approvedByobjectnullable
    • eventobjectnullable
      3 properties
      • _idid
      • namestring

        at most 200 characters

      • attendeeid
    • helperobject
    • reviewersobject[]

      Without user.read, entries[].reviewers can include only the caller's own reviewer actor.

More about the fields

  • account.contactActors[].user: Without user.read, the name is masked and the image is null for another user's nested actor in account.contactActors[].user.
Response200
{
  "account": {
    "_id": "000000000000000000000001",
    "organization": "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",
    "reminderSentForDeadline": "string",
    "group": {
      "_id": "000000000000000000000001",
      "name": "string",
      "number": "string"
    },
    "contacts": [
      "000000000000000000000001"
    ],
    "months": 0,
    "calculatedRequired": 0,
    "override": {
      "required": 0,
      "reason": "string"
    },
    "required": 0,
    "approved": 0,
    "submitted": 0,
    "missing": 0,
    "reviewerUserIds": [
      "string"
    ],
    "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"
      }
    },
    "changes": [
      {
        "at": "2026-06-15T22:30:00Z",
        "by": {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        },
        "type": "required",
        "previousRequired": 0,
        "required": 0,
        "reason": "string"
      }
    ],
    "notes": [
      {
        "id": "string",
        "content": "string",
        "writtenAt": "2026-06-15T22:30:00Z",
        "writtenBy": {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        }
      }
    ],
    "contact": {
      "name": "string",
      "type": "user",
      "userId": "string",
      "image": {
        "resource": "string"
      }
    },
    "payer": {
      "name": "string",
      "type": "user",
      "userId": "string",
      "image": {
        "resource": "string"
      }
    },
    "contactActors": [
      {
        "name": "string",
        "type": "user",
        "userId": "string",
        "image": {
          "resource": "string"
        }
      }
    ],
    "buyoutDeadline": "string"
  },
  "booking": {
    "defaultMandate": "000000000000000000000001",
    "sepaDirectDebitCashAccount": "000000000000000000000001",
    "sepaCreditTransferCashAccount": "000000000000000000000001"
  },
  "entries": [
    {
      "_id": "000000000000000000000001",
      "organization": "000000000000000000000001",
      "mandates": [
        "000000000000000000000001"
      ],
      "account": "000000000000000000000001",
      "rule": "000000000000000000000001",
      "period": {
        "year": 2000,
        "from": "string",
        "to": "string"
      },
      "unit": "hours",
      "date": "string",
      "activity": "string",
      "quantity": 0.25,
      "status": "draft",
      "submittedAt": "2026-06-15T22:30:00Z",
      "submittedBy": {
        "name": "string",
        "type": "user",
        "userId": "string",
        "image": {
          "resource": "string"
        }
      },
      "submittedOnBehalf": true,
      "reviews": [
        {
          "at": "2026-06-15T22:30:00Z",
          "by": {
            "name": "string",
            "type": "user",
            "userId": "string",
            "image": {
              "resource": "string"
            }
          },
          "decision": "submitted",
          "message": "string"
        }
      ],
      "changes": [
        {
          "at": "2026-06-15T22:30:00Z",
          "by": {
            "name": "string",
            "type": "user",
            "userId": "string",
            "image": {
              "resource": "string"
            }
          },
          "previousQuantity": 0,
          "quantity": 0
        }
      ],
      "reviewerUserIds": [
        "string"
      ],
      "approvedAt": "2026-06-15T22:30:00Z",
      "approvedBy": {
        "name": "string",
        "type": "user",
        "userId": "string",
        "image": {
          "resource": "string"
        }
      },
      "event": {
        "_id": "000000000000000000000001",
        "name": "string",
        "attendee": "000000000000000000000001"
      },
      "helper": {
        "name": "string",
        "type": "user",
        "userId": "string",
        "image": {
          "resource": "string"
        }
      },
      "reviewers": [
        {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        }
      ]
    }
  ]
}

Errors

Other errors

StatusErrorWhen
404Work hours account not found.If the account is not found for the requested organization and mandate, the endpoint returns HTTP 404 with workHours.errors.accountNotFound.
404Work hours account not found.With assigned-only work hours access, if the caller is not a reviewer on any entry, the endpoint returns HTTP 404 with workHours.errors.accountNotFound.

Errors nearly every request can meet are listed under Errors.