Skip to content

Punch Events

This module describes the API endpoints for managing punch events. A punch event represents a point in time with a type (start, stop, break start, break stop). The endpoints allow creating, viewing, listing, and deleting (soft-delete) events. Punch events are used to track working hours (time trackings).

AttributeDescriptionDetails
discarded_atTime of removal (or null)Cannot be set manually. Automatically set when deleted (soft-delete).
punched_atTime of punchingCannot be set manually. Set server-side upon creation.
punch_typeType of eventMust be set. Allowed values: 'start', 'stop', 'break_start', 'break_stop'.
user_idID of the user associated with the eventCannot be set manually. Set in the backend to the current user.

The following relationships can be included in the request using the include parameter:

RelationshipTypeDescription
userhas_oneThe user associated with the punch event.

Can be included in the request using the meta[permissions] parameter. They indicate which actions the current user can perform on a punch event.

GroupDescription
actionsIndicates whether the user can delete the punch event (delete).

Use this endpoint to create a new punch event.

POST /api/v1/punch_events

{
"data": {
"type": "punch_event",
"attributes": {
"punch_type": "start"
}
}
}
{
"data": {
"id": "0e2f7b86-9b1e-4c1a-9d9a-7a0b6f1c5e3d",
"type": "punch_event",
"attributes": {
"punch_type": "start",
"punched_at": "2025-08-12T08:15:30Z",
"user_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"discarded_at": null
}
}
}

Use this endpoint to retrieve the details of a single punch event.

GET /api/v1/punch_events/:id

NameDescription
idThe ID of the punch event to retrieve.
{
"data": {
"id": "0e2f7b86-9b1e-4c1a-9d9a-7a0b6f1c5e3d",
"type": "punch_event",
"attributes": {
"punch_type": "start",
"punched_at": "2025-08-12T08:15:30Z",
"user_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"discarded_at": null
}
}
}

Use this endpoint to retrieve all punch events you have permission to view.

GET /api/v1/punch_events

{
"data": [
{
"id": "0e2f7b86-9b1e-4c1a-9d9a-7a0b6f1c5e3d",
"type": "punch_event",
"attributes": {
"punch_type": "start",
"punched_at": "2025-08-12T08:15:30Z",
"user_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"discarded_at": null
}
}
]
}

List all punch events:

GET /api/v1/punch_events

Filter by type:

GET /api/v1/punch_events?filter[punch_type]=eq:start

Filter by user:

GET /api/v1/punch_events?filter[user_id]=eq:123

Sort by punch time (descending):

GET /api/v1/punch_events?sort=-punched_at


Use this endpoint to delete a punch event. The event will be soft-deleted; discarded_at will be set automatically.

DELETE /api/v1/punch_events/:id

NameDescription
idThe ID of the punch event to delete.
{
"data": {
"id": "0e2f7b86-9b1e-4c1a-9d9a-7a0b6f1c5e3d",
"type": "punch_event",
"attributes": {
"punch_type": "start",
"punched_at": "2025-08-12T08:15:30Z",
"user_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"discarded_at": "2025-08-12T10:03:11Z"
}
}
}