Skip to content
campaiDeveloper
campai.com

Crm · Work hours

GET/{organizationId}/crm/work-hours/settingsReads only

Get work hours settings

Gets an organization's work hours settings using its organization ID. Returns the settings, including rules and reviewers, or null if 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 access to the organization.
  • The caller must have the crmSettings.read permission.

Request

Path parameters

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

Response

200 Successful response

Content-Type: application/json

  • periodStartMonthinteger

    1–12

  • submissionDeadlineDaysinteger

    0–90

  • reminderDaysBeforeDeadlineinteger

    0–60

  • rulesobject[]

    at most 50 items

    19 properties
    • _idid
    • labelstring

      1–60 characters

    • activeboolean
    • unitstring
      hours shifts
    • requirednumber

      0–999

    • conditionobjectnullable
      2 properties
      • operatorstring
        and or
      • conditions(object (recursive) | object)[]

        at least 1 items

        4 properties
        • leftobject | object of any
          Variant 1: 1 property
          • variablestring

            at least 1 characters

          Variant 2: 4 properties
          • sourceobject
            1 property
            • variablestring

              at least 1 characters

          • lookupobjectnullable
            1 property
            • variablestring

              at least 1 characters

          • arrayboolean
          • selectobject (recursive)
          Variant 3: 2 properties
          • funcstring
            33 values
            concat ifEmpty lowercase uppercase substring trim abs ceil floor min max mod sum sub mul div avg med parseNumber formatNumber dateOnly dateTime dateOnlyPart dateTimePart age dateOnlyDifference dateTimeDifference setDateOnly setDateTime addDateOnly addDateTime formatDateOnly formatDateTime
          • paramsobject (recursive)[]
          Variant 4: 1 property
          • literalnumber[] | number
          Variant 5: 3 properties
          • ifobject (recursive)
          • thenobject (recursive)
          • elseobject (recursive)
        • cmpFuncstring
          15 values
          eq isSet lt lte gt gte includes contains startsWith endsWith before beforeAt after afterAt isToday
        • rightobject | object of any
          Variant 1: 1 property
          • variablestring

            at least 1 characters

          Variant 2: 4 properties
          • sourceobject
            1 property
            • variablestring

              at least 1 characters

          • lookupobjectnullable
            1 property
            • variablestring

              at least 1 characters

          • arrayboolean
          • selectobject (recursive)
          Variant 3: 2 properties
          • funcstring
            33 values
            concat ifEmpty lowercase uppercase substring trim abs ceil floor min max mod sum sub mul div avg med parseNumber formatNumber dateOnly dateTime dateOnlyPart dateTimePart age dateOnlyDifference dateTimeDifference setDateOnly setDateTime addDateOnly addDateTime formatDateOnly formatDateTime
          • paramsobject (recursive)[]
          Variant 4: 1 property
          • literalnumber[] | number
          Variant 5: 3 properties
          • ifobject (recursive)
          • thenobject (recursive)
          • elseobject (recursive)
        • negateboolean
    • holderstring
      contact group
    • groupTypeidnullable
    • 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
    • reviewerUserIdsstring[]

      at most 50 items · each at least 1 characters

    • legalBasisstring

      at most 300 characters

    • decidedAtstringnullable
  • reviewerUserIdsstring[]

    at most 50 items · each at least 1 characters

  • reviewerRulesobject[]

    at most 50 items

    2 properties
    • conditionobject
      2 properties
      • operatorstring
        and or
      • conditions(object (recursive) | object)[]

        at least 1 items

        4 properties
        • leftobject | object of any
          Variant 1: 1 property
          • variablestring

            at least 1 characters

          Variant 2: 4 properties
          • sourceobject
            1 property
            • variablestring

              at least 1 characters

          • lookupobjectnullable
            1 property
            • variablestring

              at least 1 characters

          • arrayboolean
          • selectobject (recursive)
          Variant 3: 2 properties
          • funcstring
            33 values
            concat ifEmpty lowercase uppercase substring trim abs ceil floor min max mod sum sub mul div avg med parseNumber formatNumber dateOnly dateTime dateOnlyPart dateTimePart age dateOnlyDifference dateTimeDifference setDateOnly setDateTime addDateOnly addDateTime formatDateOnly formatDateTime
          • paramsobject (recursive)[]
          Variant 4: 1 property
          • literalnumber[] | number
          Variant 5: 3 properties
          • ifobject (recursive)
          • thenobject (recursive)
          • elseobject (recursive)
        • cmpFuncstring
          15 values
          eq isSet lt lte gt gte includes contains startsWith endsWith before beforeAt after afterAt isToday
        • rightobject | object of any
          Variant 1: 1 property
          • variablestring

            at least 1 characters

          Variant 2: 4 properties
          • sourceobject
            1 property
            • variablestring

              at least 1 characters

          • lookupobjectnullable
            1 property
            • variablestring

              at least 1 characters

          • arrayboolean
          • selectobject (recursive)
          Variant 3: 2 properties
          • funcstring
            33 values
            concat ifEmpty lowercase uppercase substring trim abs ceil floor min max mod sum sub mul div avg med parseNumber formatNumber dateOnly dateTime dateOnlyPart dateTimePart age dateOnlyDifference dateTimeDifference setDateOnly setDateTime addDateOnly addDateTime formatDateOnly formatDateTime
          • paramsobject (recursive)[]
          Variant 4: 1 property
          • literalnumber[] | number
          Variant 5: 3 properties
          • ifobject (recursive)
          • thenobject (recursive)
          • elseobject (recursive)
        • negateboolean
    • reviewerUserIdsstring[]

      1–50 items · each at least 1 characters

  • defaultMandateidnullable
  • sepaDirectDebitCashAccountidnullable
  • sepaCreditTransferCashAccountidnullable
Response200
{
  "periodStartMonth": 1,
  "submissionDeadlineDays": 0,
  "reminderDaysBeforeDeadline": 0,
  "rules": [
    {
      "_id": "000000000000000000000001",
      "label": "string",
      "active": true,
      "unit": "hours",
      "required": 0,
      "condition": {
        "operator": "and",
        "conditions": [
          null
        ]
      },
      "holder": "contact",
      "groupType": "000000000000000000000001",
      "helpers": "members",
      "proRata": "none",
      "fee": 1,
      "buyout": {
        "amount": 1,
        "untilDays": 0
      },
      "account": 1,
      "costCenter1": 1,
      "costCenter2": 1,
      "eventCategories": [
        {
          "name": "string",
          "nameNormalized": "string",
          "bookingCategoryId": "000000000000000000000001"
        }
      ],
      "reviewerUserIds": [
        "string"
      ],
      "legalBasis": "string",
      "decidedAt": "string"
    }
  ],
  "reviewerUserIds": [
    "string"
  ],
  "reviewerRules": [
    {
      "condition": {
        "operator": "and",
        "conditions": [
          null
        ]
      },
      "reviewerUserIds": [
        "string"
      ]
    }
  ],
  "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.