Policy
put/v1/workspaces/{workspaceId}/time-off/policies/{id}

Request

  • Base URL: https://api.clockify.me/api
  • URL: https://api.clockify.me/api/v1/workspaces/{workspaceId}/time-off/policies/{id}
  • Auth: one of:
    • API key in header x-api-key
    • API key in header x-addon-token

Path parameters

workspaceIdstring required

Represents a workspace identifier across the system.

Example:60f91b3ffdaf031696ec61a8
idstring required

Represents a policy identifier across the system.

Example:63034cd0cb0fb876a57e93ad

Request body

allowHalfDayboolean required

Indicates whether policy allows half day.

allowNegativeBalanceboolean required

Indicates whether policy allows negative balance.

archivedboolean required

Indicates whether policy is archived.

colorstring

Provide color in format ^#(?:[0-9a-fA-F]{6}){1}$. Explanation: A valid color code should start with '#' and consist of six hexadecimal characters, representing a color in hexadecimal format. Color value is in standard RGB hexadecimal format.

everyoneIncludingNewboolean required

Indicates whether the policy is shown to new users.

hasExpirationboolean required

Indicates whether the policy has expiration.

icon'UMBRELLA' | 'SNOWFLAKE' | 'FAMILY' | 'PLANE' | 'STETHOSCOPE' | 'HEALTH_METRICS' | 'CHILDCARE' | 'LUGGAGE' | 'MONETIZATION' | 'CALENDAR'

Provide icon.

namestring required

Provide the name you would like to use for updating the policy.

toilSyncMethodstring

Indicates how changes to users and user groups should also affect related TOIL Policy users and user groups. This defaults to ADD_NEW_USERS, which means that when we find new users, we also just add them to the related TOIL Policies.

Example request

{
  "allowHalfDay": true,
  "approve": {
    "requiresApproval": true,
    "userIds": [
      "6579d126c2fe3b25f20ea001",
      "6579d126c2fe3b25f20ea002"
    ]
  },
  "automaticAccrual": {
    "amount": 2,
    "period": "MONTH"
  },
  "color": "#8BC34A",
  "icon": "UMBRELLA",
  "name": "Days",
  "negativeBalance": {
    "amount": 2,
    "period": "MONTH",
    "shouldReset": true
  },
  "userGroups": {
    "contains": "CONTAINS",
    "ids": [
      "5b715612b079875110791111",
      "5b715612b079875110791222"
    ],
    "status": "ALL"
  },
  "users": {
    "contains": "CONTAINS",
    "ids": [
      "5b715612b079875110791111",
      "5b715612b079875110791222"
    ],
    "status": "ALL"
  }
}

Response

OK

allowHalfDayboolean

Indicates whether the half day is allowed.

allowNegativeBalanceboolean

Indicates whether the negative balance is allowed.

archivedboolean

Indicates whether the policy is archived.

colorstring

Represents the color assigned to the policy.

everyoneIncludingNewboolean

Indicates whether the policy is applied to future new users.

icon'UMBRELLA' | 'SNOWFLAKE' | 'FAMILY' | 'PLANE' | 'STETHOSCOPE' | 'HEALTH_METRICS' | 'CHILDCARE' | 'LUGGAGE' | 'MONETIZATION' | 'CALENDAR'

Represents the icon assigned to the policy.

idstring

Represents policy identifier across the system.

namestring

Represents the name of the policy.

projectIdstring

Represents project identifier across the system.

timeUnit'DAYS' | 'HOURS'

Represents the time unit of the policy.

userGroupIdsstring[]

Represents user groups' identifiers across the system. Indicates which user groups are included in the policy.

userIdsstring[]

Represents users' identifiers across the system. Indicates which users are included in the policy.

workspaceIdstring

Represents workspace identifier across the system.

Example response

{
  "allowNegativeBalance": true,
  "approve": {
    "requiresApproval": true,
    "userIds": [
      "6579d126c2fe3b25f20ea001",
      "6579d126c2fe3b25f20ea002"
    ]
  },
  "archived": true,
  "automaticAccrual": {
    "amount": 20,
    "period": "YEAR",
    "timeUnit": "DAYS"
  },
  "color": "#8BC34A",
  "icon": "UMBRELLA",
  "id": "5b715612b079875110791111",
  "name": "Days",
  "timeUnit": "DAYS",
  "userGroupIds": [
    "5b715612b079875110791342",
    "5b715612b079875110791324",
    "5b715612b079875110793142"
  ],
  "userIds": [
    "5b715612b079875110791432",
    "5b715612b079875110791234"
  ],
  "workspaceId": "5b715612b079875110792222"
}

Changes

    • info

      added the new optional request property

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the request property default value was added

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status

    • info

      the response's property default value was added for the status