{
  "openapi": "3.1.0",
  "info": {
    "title": "Aequo Public API",
    "version": "1.0.0",
    "description": "Connect Aequo to your other systems. Base URL: https://{workspace}.aequohr.com/api/public/v1 (or your own domain). Authenticate with an API key from Settings → API keys: `Authorization: Bearer aeq_…`. Each key carries scopes. Salary, health (sick leave is reported as an absence of type `absent`) and whistleblowing data are never available through the API. Every call is logged for your company admin for 90 days.",
    "contact": {
      "name": "Aequo",
      "url": "https://aequohr.com/developers",
      "email": "service@aequohr.com"
    }
  },
  "servers": [
    {
      "url": "https://{workspace}.aequohr.com/api/public/v1",
      "variables": {
        "workspace": {
          "default": "your-company",
          "description": "Your Aequo workspace subdomain"
        }
      }
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/employees": {
      "get": {
        "summary": "List employees (work master data, no salary or private data)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "employees:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          },
          {
            "$ref": "#/components/parameters/status"
          },
          {
            "$ref": "#/components/parameters/updated_since"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Employee"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/employees/{id}": {
      "get": {
        "summary": "Get one employee",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "employees:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The employee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Employee"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/departments": {
      "get": {
        "summary": "List departments",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "departments:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Department"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/absences": {
      "get": {
        "summary": "List absences (sick leave appears as type `absent`)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "absences:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          },
          {
            "$ref": "#/components/parameters/employee_id"
          },
          {
            "$ref": "#/components/parameters/status"
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Absence"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/working-time": {
      "get": {
        "summary": "List recorded working time per day",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "working_time:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          },
          {
            "$ref": "#/components/parameters/employee_id"
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WorkingTime"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/projects": {
      "get": {
        "summary": "List projects (no rates or euro budgets)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "project_time:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          },
          {
            "$ref": "#/components/parameters/status"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Project"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/time-entries": {
      "get": {
        "summary": "List project time entries",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "project_time:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          },
          {
            "$ref": "#/components/parameters/employee_id"
          },
          {
            "$ref": "#/components/parameters/project_id"
          },
          {
            "$ref": "#/components/parameters/status"
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/updated_since"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TimeEntry"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "summary": "Book project time for an employee (stored as a draft for the weekly approval)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "project_time:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewTimeEntry"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TimeEntry"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/documents": {
      "get": {
        "summary": "List employee document metadata (no files; confidential documents excluded)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-required-scope": "documents:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/per_page"
          },
          {
            "$ref": "#/components/parameters/employee_id"
          },
          {
            "$ref": "#/components/parameters/updated_since"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Page"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Document"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "aeq_…",
        "description": "API key from Settings → API keys. Scopes: employees:read, departments:read, absences:read, working_time:read, project_time:read, project_time:write, documents:read."
      }
    },
    "parameters": {
      "page": {
        "name": "page",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        }
      },
      "per_page": {
        "name": "per_page",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "status": {
        "name": "status",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "updated_since": {
        "name": "updated_since",
        "in": "query",
        "description": "Only records changed since this date/time (ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "employee_id": {
        "name": "employee_id",
        "in": "query",
        "schema": {
          "type": "integer"
        }
      },
      "project_id": {
        "name": "project_id",
        "in": "query",
        "schema": {
          "type": "integer"
        }
      },
      "from": {
        "name": "from",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "to": {
        "name": "to",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing, invalid, revoked or expired API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the required scope, or the API is not part of the company's plan",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Invalid parameters",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "errors": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "More than 120 requests per minute for this key — see the Retry-After header",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "Page": {
        "type": "object",
        "properties": {
          "links": {
            "type": "object"
          },
          "meta": {
            "type": "object",
            "properties": {
              "current_page": {
                "type": "integer"
              },
              "last_page": {
                "type": "integer"
              },
              "per_page": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Employee": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "employee_number": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "work_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "department": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "job_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "manager_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "employment_type": {
            "type": "string"
          },
          "employment_status": {
            "type": "string"
          },
          "hire_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "termination_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Department": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "name_de": {
            "type": [
              "string",
              "null"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "parent_department_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "head_employee_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        }
      },
      "Absence": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "employee_id": {
            "type": "integer"
          },
          "type": {
            "type": "object",
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "key": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "e.g. annual, special — `absent` for sick leave"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "start_half_day": {
            "type": "boolean"
          },
          "end_half_day": {
            "type": "boolean"
          },
          "days": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "cancelled"
            ]
          }
        }
      },
      "WorkingTime": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "employee_id": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "clock_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "clock_out_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "worked_minutes": {
            "type": "integer"
          },
          "break_minutes": {
            "type": "integer"
          },
          "overtime_minutes": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "client_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "client": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "planned",
              "active",
              "closed"
            ]
          },
          "lead_employee_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "is_billable": {
            "type": "boolean"
          },
          "budget_hours": {
            "type": [
              "number",
              "null"
            ]
          },
          "starts_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "ends_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimeEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "employee_id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "phase_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "task_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "minutes": {
            "type": "integer"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "billable": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "submitted",
              "approved",
              "rejected"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NewTimeEntry": {
        "type": "object",
        "required": [
          "employee_id",
          "project_id",
          "date",
          "minutes"
        ],
        "properties": {
          "employee_id": {
            "type": "integer",
            "description": "Must be on the project's team"
          },
          "project_id": {
            "type": "integer",
            "description": "An active project"
          },
          "project_phase_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "project_task_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Today or earlier"
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_billable": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "employee_id": {
            "type": "integer"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "signature_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiry_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}