---
updatedAt: 2025-06-05T21:40:36.000Z
agentTools:
  projectIndex: https://apidocs.officient.io/llms.txt
---

# Add event

Add new events to a calender (eg a day off, overtime,..)

Scope required: calendar:write

## Restrictions:

* All events added in one API call must be within the same year.
* The 'type' parameter can be either 'sick\_day', 'education' or 'custom'
* The custom\_day\_off\_type\_id must only be set when using the 'custom' type. Use the custom event types API call to get the custom types that are available in a given year.

## Tips

For ease of use, the 'duration\_minutes' parameter can be set to 'all\_day'. This will signal that the event should have the duration of the scheduled amount of hours for that day.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "officient-api",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.officient.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/1.0/calendar/{person_id}/events/add": {
      "post": {
        "summary": "Add event",
        "description": "Add new events to a calender (eg a day off, overtime,..)",
        "operationId": "add-event",
        "parameters": [
          {
            "name": "person_id",
            "in": "path",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"success\": 1\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"status_code\": 400,\n    \"reason_phrase\": \"There is already too much time off planned on 29/12/2018.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status_code": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "reason_phrase": {
                      "type": "string",
                      "example": "There is already too much time off planned on 29/12/2018."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "http",
              "code": "{  \n   \"type\":\"custom\",\n   \"custom_day_off_type_id\":\"1103\",\n   \"events\":[  \n      {  \n         \"date\":\"2018-12-29\",\n         \"start_time_minutes\":540,\n         \"duration_minutes\":480\n      }\n   ]\n}",
              "name": "Adding an event with a custom day off type"
            },
            {
              "language": "http",
              "code": "{  \n   \"type\":\"sick_day\",\n   \"custom_day_off_type_id\":\"1103\",\n   \"events\":[  \n      {  \n         \"date\":\"2018-01-25\",\n         \"start_time_minutes\":540,\n         \"duration_minutes\":\"all_day\"\n      },\n      {  \n         \"date\":\"2018-01-25\",\n         \"start_time_minutes\":540,\n         \"duration_minutes\":\"all_day\"\n      }\n   ]\n}",
              "name": "Adding 2 sick days"
            }
          ],
          "samples-languages": [
            "http"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```