Saltar al contingut principal
GET

Obtenir una absència per ID

Scope:team:time-off.read
https://api.holded.com/api/v2/employees/{employeeId}/time-offs/{timeOffId}

Recupera els detalls complets d'una absència específica de l'empleat.

Paràmetres

Paràmetres de ruta

employeeIdstringobligatori

ID de l'empleat (ObjectId hexadecimal de 24 caràcters)

timeOffIdstringobligatori

ID de l'absència (ObjectId hexadecimal de 24 caràcters)

Petició

python
import requests

url = "https://api.holded.com/api/v2/employees/507f1f77bcf86cd799439012/time-offs/507f1f77bcf86cd799439011"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respostes

Resposta

json
{
  "id": "507f1f77bcf86cd799439011",
  "employee_id": "507f1f77bcf86cd799439012",
  "time_off_type_id": "507f1f77bcf86cd799439013",
  "time_off_type_name": "Vacation",
  "start_date": "2026-06-01",
  "end_date": "2026-06-05",
  "day_period": "full_day",
  "status": "pending",
  "days": "5",
  "description": "Summer holidays",
  "reason": null,
  "start_hour": "09:00",
  "end_hour": "13:00",
  "num_hours": "4",
  "attachments": [
    {}
  ]
}

Respostes exitoses

200Absència trobadaapplication/json
object
idstring

Unique identifier of the time off request

employee_idstring | null

Identifier of the employee. Null when assigned to a workplace.

time_off_type_idstring | null

Identifier of the time off type

time_off_type_namestring | null

Name of the time off type

start_datestring<date>

Start date of the absence (YYYY-MM-DD, Europe/Madrid)

end_datestring<date> | null

End date of the absence (YYYY-MM-DD, Europe/Madrid). Null for single-day requests.

day_periodstring | null

Half-day granularity for single-day requests

Enum:morningafternoonfull_dayhourly
statusstring | null

Current approval status

Enum:pendingacceptedrejectedcancelled
daysstring

Number of days consumed (as a decimal string)

descriptionstring | null

Free-form note attached to the request

reasonstring | null

Rejection or cancellation reason

start_hourstring | null

Start time for HOURS-granularity absences (HH:MM, Europe/Madrid)

end_hourstring | null

End time for HOURS-granularity absences (HH:MM, Europe/Madrid)

num_hoursstring | null

Total hours duration for HOURS-granularity absences

attachments[]object[]

Attached files (currently always empty)

Respostes d'error

401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Absència no trobadaapplication/json
429Límit de sol·licituds exceditapplication/json