# Get an attendance period. - Retrieves an attendance period by given attendance period ID. # OpenAPI definition ```json { "openapi": "3.0.0", "info": { "title": "Attendances API", "version": "2.0.0", "description": "Endpoints to manage attendance periods, projects and their members." }, "servers": [ { "url": "https://api.personio.de" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Attendances", "description": "Endpoints relating to the times that people work, and the rules that define this." } ], "paths": { "/v2/attendance-periods/{id}": { "parameters": [ { "$ref": "#/components/parameters/periodIdParam" } ], "get": { "x-path-examples": { "200 GET Valid request": { "value": "/papi/v2/attendance-periods/bd242cd1-5116-41a0-99aa-c12af4837c81" }, "200 GET Valid request (open period)": { "value": "/papi/v2/attendance-periods/9b620908-8252-4dbb-b406-053a9b9d8e98" }, "403 Forbidden response": { "value": "/papi/v2/attendance-periods/bd242cd1-5116-41a0-99aa-c12af4837c81" }, "404 Resource Not Found": { "value": "/papi/v2/attendance-periods/bd242cd1-5116-41a0-99aa-c12af4837c81" } }, "tags": [ "Attendances" ], "summary": "Get an attendance period.", "description": "- Retrieves an attendance period by given attendance period ID.", "responses": { "200": { "$ref": "#/components/responses/AttendancePeriodResponse" }, "403": { "$ref": "#/components/responses/ForbiddenResponse" }, "404": { "$ref": "#/components/responses/NotFoundResponse" } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer" } }, "schemas": { "AttendancePeriod": { "type": "object", "description": "- Model of period entity. - Describes a period of work or break time associated with a person.", "properties": { "id": { "type": "string", "example": "1234" }, "person": { "type": "object", "description": "An object reference for a Person.", "required": [ "id" ], "properties": { "id": { "type": "string", "example": "1234" } } }, "type": { "description": "Field definition of attendance period types.", "type": "string", "enum": [ "WORK", "BREAK" ] }, "is_auto_generated": { "description": "Only applies to break periods. Auto generated periods are created by the system based on customer configured break rules.", "type": "boolean" }, "approval": { "type": "object", "description": "An object reference for approval details.", "required": [ "status" ], "properties": { "status": { "description": "Field definition of attendance period status.", "type": "string", "enum": [ "PENDING", "CONFIRMED", "REJECTED" ] } } }, "start": { "description": "Date time property", "type": "object", "required": [ "date_time" ], "properties": { "date_time": { "$ref": "#/components/schemas/DateTimeWithoutTimezone" } } }, "end": { "description": "Date time property", "type": "object", "nullable": true, "required": [ "date_time" ], "properties": { "date_time": { "$ref": "#/components/schemas/DateTimeWithoutTimezone" } } }, "attribution_date": { "description": "The date that the work/break hours of this period are attributed to. This date can be different than both the date of the start and end time of this period, e.g. on overnight shifts.", "type": "string", "format": "date", "example": "2022-01-02" }, "created_at": { "description": "Date time property", "type": "string", "format": "date-time" }, "updated_at": { "description": "Date time property", "type": "string", "format": "date-time" }, "comment": { "type": "string", "nullable": true, "maxLength": 1000, "example": "An example comment." }, "project": { "nullable": true, "description": "Project object reference by ID.", "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "example": "1234" } } } } }, "DateTimeWithoutTimezone": { "type": "string", "example": "2022-01-01T14:00:00", "description": "An RFC3339 date and timestamp without a timezone offset." } }, "responses": { "AttendancePeriodResponse": { "description": "Successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AttendancePeriod" }, "examples": { "200 GET Valid request": { "$ref": "#/components/examples/GetAttendancePeriodResponse" }, "200 GET Valid request (open period)": { "$ref": "#/components/examples/GetAttendancePeriodResponseOpen" } } } } }, "ForbiddenResponse": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/responses/NotFoundResponse/content/application~1problem%2Bjson/schema" }, "examples": { "403 Forbidden response": { "$ref": "#/components/examples/ForbiddenResponse" } } } } }, "NotFoundResponse": { "description": "The resource could not be found.", "content": { "application/problem+json": { "schema": { "type": "object", "description": "This object represents an error response.", "properties": { "personio_trace_id": { "type": "string", "example": "aswo3f-a202lfso-312123sld-1230ddd", "description": "A unique ID that was created for this error." }, "timestamp": { "type": "string", "format": "date-time", "example": "2021-05-28T11:17:30.000Z", "description": "The timestamp of when the error occurred." }, "errors": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "example": "Not found", "description": "The title of the error." }, "detail": { "type": "string", "example": "The requested resource was not found.", "description": "A short description about the error." }, "type": { "type": "string", "format": "uri", "example": "https://developer.personio.de/reference/errors#common.requested_resource_not_found", "description": "A link to the developer hub where more information can be found for the encountered error." }, "_meta": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, "examples": { "404 Resource Not Found": { "$ref": "#/components/examples/NotFoundResponse" } } } } } }, "examples": { "GetAttendancePeriodResponse": { "value": { "id": "bd242cd1-5116-41a0-99aa-c12af4837c81", "person": { "id": "1234" }, "type": "WORK", "approval": { "status": "PENDING" }, "start": { "date_time": "2024-06-07T08:00:00" }, "end": { "date_time": "2024-06-07T11:00:00" }, "attribution_date": "2026-06-07", "created_at": "2024-06-07T11:17:30Z", "updated_at": "2024-06-07T11:17:30Z", "comment": "Comment associated with this attendance period.", "project": { "id": "82173" } } }, "GetAttendancePeriodResponseOpen": { "value": { "id": "9b620908-8252-4dbb-b406-053a9b9d8e98", "person": { "id": "1234" }, "type": "WORK", "approval": { "status": "PENDING" }, "start": { "date_time": "2024-06-07T08:00:00" }, "end": null, "attribution_date": "2026-06-07", "created_at": "2024-06-07T11:17:30Z", "updated_at": "2024-06-07T11:17:30Z", "comment": "Comment associated with this attendance period.", "project": { "id": "82173" } } }, "ForbiddenResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30+00:00", "errors": [ { "title": "Access denied", "detail": "Access denied to perform attendance period operations.", "type": "https://developer.personio.de/reference/errors#common.forbidden_response" } ] } }, "NotFoundResponse": { "value": { "personio_trace_id": "aswo3f-a202lfso-312123sld-1230ddd", "timestamp": "2021-05-28T11:17:30+00:00", "errors": [ { "title": "Resource not found", "detail": "The requested resource is not found.", "type": "https://developer.personio.de/reference/errors#common.resource_not_found" } ] } } } } } ```