{
  "openapi": "3.1.0",
  "info": {
    "title": "ANOMA API",
    "version": "2026-11-24",
    "description": "People, time off, attendance, expenses, approvals and payroll inputs, with signed webhooks."
  },
  "servers": [
    {
      "url": "https://app.anomahq.com/api"
    }
  ],
  "security": [
    {
      "key": []
    }
  ],
  "tags": [
    {
      "name": "people",
      "description": "Everyone in the company, their department, manager and job."
    },
    {
      "name": "leave",
      "description": "Leave types, balances and requests. Requests go through the company’s approval chain."
    },
    {
      "name": "attendance",
      "description": "Daily attendance, and punches from machines or other systems."
    },
    {
      "name": "expenses",
      "description": "Expense claims and where they stand."
    },
    {
      "name": "approvals",
      "description": "Everything waiting for a decision, and deciding it."
    },
    {
      "name": "payroll",
      "description": "Locked months: paid days, loss of pay, overtime, expenses to pay and dues at exit."
    },
    {
      "name": "webhooks",
      "description": "Get told the moment something happens, signed so you know it is ANOMA."
    }
  ],
  "paths": {
    "/v1/me": {
      "get": {
        "operationId": "me",
        "summary": "Who this key is",
        "description": "The company, the key’s name and scopes. Handy for checking a key works.",
        "tags": [
          "webhooks"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "string"
                    },
                    "company": {
                      "type": "string"
                    },
                    "key": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "prefix": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "sandbox": {
                      "type": "boolean"
                    },
                    "api_version": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "workspace": "acme",
                  "company": "Acme Pvt Ltd",
                  "key": {
                    "name": "Payroll sync",
                    "prefix": "ank_acme_3f9a",
                    "scopes": [
                      "payroll:read"
                    ]
                  },
                  "sandbox": false,
                  "api_version": "2026-11-24"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/employees": {
      "get": {
        "operationId": "employees.list",
        "summary": "List people",
        "description": "Needs the `employees:read` scope.",
        "tags": [
          "people"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "active (default), exited or all",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "exited",
                "all"
              ]
            }
          },
          {
            "name": "department_id",
            "in": "query",
            "required": false,
            "description": "Only this department",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Only people added, changed or exited since this time (ISO 8601, within the last 30 days)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 200 (default 50)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the previous page",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "emp_code": {
                            "type": "string"
                          },
                          "first_name": {
                            "type": "string"
                          },
                          "last_name": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "phone": {
                            "type": "string"
                          },
                          "department": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          },
                          "designation": {
                            "type": "string"
                          },
                          "manager_id": {
                            "type": "integer"
                          },
                          "employment_type": {
                            "type": "string"
                          },
                          "join_date": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "exit_date": {
                            "type": "null"
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 12,
                      "emp_code": "E0012",
                      "first_name": "Sneha",
                      "last_name": "Iyer",
                      "name": "Sneha Iyer",
                      "email": "sneha@acme.in",
                      "phone": "+919876543210",
                      "department": {
                        "id": 3,
                        "name": "Engineering"
                      },
                      "designation": "Backend engineer",
                      "manager_id": 4,
                      "employment_type": "full_time",
                      "join_date": "2024-04-01",
                      "status": "active",
                      "exit_date": null
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "employees.create",
        "summary": "Add a person",
        "description": "They get an invitation to sign in when the company has email on. Their onboarding checklist starts.\n\nNeeds the `employees:write` scope.",
        "tags": [
          "people"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "emp_code": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "department": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "designation": {
                      "type": "string"
                    },
                    "manager_id": {
                      "type": "integer"
                    },
                    "employment_type": {
                      "type": "string"
                    },
                    "join_date": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "exit_date": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "id": 57,
                  "emp_code": "E0012",
                  "first_name": "Arjun",
                  "last_name": "Mehta",
                  "name": "Arjun Mehta",
                  "email": "arjun@acme.in",
                  "phone": "+919876543210",
                  "department": {
                    "id": 3,
                    "name": "Engineering"
                  },
                  "designation": "Backend engineer",
                  "manager_id": 4,
                  "employment_type": "full_time",
                  "join_date": "2024-04-01",
                  "status": "active",
                  "exit_date": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "join_date": {
                    "type": "string"
                  },
                  "designation": {
                    "type": "string"
                  },
                  "department_id": {
                    "type": "integer"
                  },
                  "manager_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "first_name",
                  "join_date"
                ]
              },
              "example": {
                "first_name": "Arjun",
                "last_name": "Mehta",
                "email": "arjun@acme.in",
                "join_date": "2026-12-01",
                "designation": "Sales executive",
                "department_id": 2,
                "manager_id": 4
              }
            }
          }
        }
      }
    },
    "/v1/employees/{id}": {
      "get": {
        "operationId": "employees.get",
        "summary": "Get a person",
        "description": "Needs the `employees:read` scope.",
        "tags": [
          "people"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "emp_code": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "department": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "designation": {
                      "type": "string"
                    },
                    "manager_id": {
                      "type": "integer"
                    },
                    "employment_type": {
                      "type": "string"
                    },
                    "join_date": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "exit_date": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "id": 12,
                  "emp_code": "E0012",
                  "first_name": "Sneha",
                  "last_name": "Iyer",
                  "name": "Sneha Iyer",
                  "email": "sneha@acme.in",
                  "phone": "+919876543210",
                  "department": {
                    "id": 3,
                    "name": "Engineering"
                  },
                  "designation": "Backend engineer",
                  "manager_id": 4,
                  "employment_type": "full_time",
                  "join_date": "2024-04-01",
                  "status": "active",
                  "exit_date": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "employees.update",
        "summary": "Change a person’s details",
        "description": "Send only what changes.\n\nNeeds the `employees:write` scope.",
        "tags": [
          "people"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "emp_code": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "department": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "designation": {
                      "type": "string"
                    },
                    "manager_id": {
                      "type": "integer"
                    },
                    "employment_type": {
                      "type": "string"
                    },
                    "join_date": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "exit_date": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "id": 12,
                  "emp_code": "E0012",
                  "first_name": "Sneha",
                  "last_name": "Iyer",
                  "name": "Sneha Iyer",
                  "email": "sneha@acme.in",
                  "phone": "+919876543210",
                  "department": {
                    "id": 3,
                    "name": "Engineering"
                  },
                  "designation": "Senior backend engineer",
                  "manager_id": 4,
                  "employment_type": "full_time",
                  "join_date": "2024-04-01",
                  "status": "active",
                  "exit_date": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "designation": {
                    "type": "string"
                  },
                  "department_id": {
                    "type": "integer"
                  }
                },
                "required": []
              },
              "example": {
                "designation": "Senior backend engineer",
                "department_id": 3
              }
            }
          }
        }
      }
    },
    "/v1/departments": {
      "get": {
        "operationId": "departments.list",
        "summary": "List departments",
        "description": "Needs the `employees:read` scope.",
        "tags": [
          "people"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "headcount": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 3,
                      "name": "Engineering",
                      "headcount": 24
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/holidays": {
      "get": {
        "operationId": "holidays.list",
        "summary": "List holidays",
        "description": "Needs the `employees:read` scope.",
        "tags": [
          "people"
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Defaults to this year",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "location": {
                            "type": "null"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "date": "2026-12-25",
                      "name": "Christmas",
                      "location": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/leave/types": {
      "get": {
        "operationId": "leave.types",
        "summary": "List leave types",
        "description": "Needs the `leave:read` scope.",
        "tags": [
          "leave"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "paid": {
                            "type": "boolean"
                          },
                          "annual_quota": {
                            "type": "integer"
                          },
                          "half_day": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "name": "Casual leave",
                      "paid": true,
                      "annual_quota": 12,
                      "half_day": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/leave/balances": {
      "get": {
        "operationId": "leave.balances",
        "summary": "A person’s leave balances",
        "description": "Needs the `leave:read` scope.",
        "tags": [
          "leave"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "query",
            "required": true,
            "description": "Whose balances",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Defaults to this year",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "employee_id": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type_id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "available": {
                            "type": "integer"
                          },
                          "used": {
                            "type": "integer"
                          },
                          "pending": {
                            "type": "integer"
                          },
                          "accrued": {
                            "type": "integer"
                          },
                          "carried": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "employee_id": 12,
                  "year": 2026,
                  "data": [
                    {
                      "type_id": 1,
                      "name": "Casual leave",
                      "available": 7,
                      "used": 4,
                      "pending": 1,
                      "accrued": 12,
                      "carried": 0
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/leave/requests": {
      "get": {
        "operationId": "leave.list",
        "summary": "List time-off requests",
        "description": "Needs the `leave:read` scope.",
        "tags": [
          "leave"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "pending, approved, rejected or cancelled",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "rejected",
                "cancelled"
              ]
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "description": "Only this person",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Overlapping this date or later (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Overlapping this date or earlier (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 200 (default 50)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the previous page",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "employee_id": {
                            "type": "integer"
                          },
                          "employee_name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          },
                          "start_date": {
                            "type": "string"
                          },
                          "end_date": {
                            "type": "string"
                          },
                          "days": {
                            "type": "integer"
                          },
                          "half_day": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 88,
                      "employee_id": 12,
                      "employee_name": "Sneha Iyer",
                      "type": {
                        "id": 1,
                        "name": "Casual leave"
                      },
                      "start_date": "2026-12-08",
                      "end_date": "2026-12-09",
                      "days": 2,
                      "half_day": false,
                      "reason": "Family function",
                      "status": "pending",
                      "stage": "Waiting for their manager",
                      "created_at": "2026-11-24T09:12:00Z"
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "leave.create",
        "summary": "Request time off for someone",
        "description": "Checked against their balance and the company’s leave rules, then sent through the approval chain like a request made in ANOMA.\n\nNeeds the `leave:write` scope.",
        "tags": [
          "leave"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "employee_id": {
                      "type": "integer"
                    },
                    "employee_name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "days": {
                      "type": "integer"
                    },
                    "half_day": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 88,
                  "employee_id": 12,
                  "employee_name": "Sneha Iyer",
                  "type": {
                    "id": 1,
                    "name": "Casual leave"
                  },
                  "start_date": "2026-12-08",
                  "end_date": "2026-12-09",
                  "days": 2,
                  "half_day": false,
                  "reason": "Family function",
                  "status": "pending",
                  "stage": "Waiting for their manager",
                  "created_at": "2026-11-24T09:12:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "employee_id": {
                    "type": "integer"
                  },
                  "leave_type_id": {
                    "type": "integer"
                  },
                  "start_date": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "half_day": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "employee_id",
                  "leave_type_id",
                  "start_date"
                ]
              },
              "example": {
                "employee_id": 12,
                "leave_type_id": 1,
                "start_date": "2026-12-08",
                "end_date": "2026-12-09",
                "half_day": false,
                "reason": "Family function"
              }
            }
          }
        }
      }
    },
    "/v1/leave/requests/{id}": {
      "get": {
        "operationId": "leave.get",
        "summary": "Get a time-off request",
        "description": "Needs the `leave:read` scope.",
        "tags": [
          "leave"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "employee_id": {
                      "type": "integer"
                    },
                    "employee_name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "days": {
                      "type": "integer"
                    },
                    "half_day": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 88,
                  "employee_id": 12,
                  "employee_name": "Sneha Iyer",
                  "type": {
                    "id": 1,
                    "name": "Casual leave"
                  },
                  "start_date": "2026-12-08",
                  "end_date": "2026-12-09",
                  "days": 2,
                  "half_day": false,
                  "reason": "Family function",
                  "status": "pending",
                  "stage": "Waiting for their manager",
                  "created_at": "2026-11-24T09:12:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/leave/requests/{id}/cancel": {
      "post": {
        "operationId": "leave.cancel",
        "summary": "Cancel a time-off request",
        "description": "Needs the `leave:write` scope.",
        "tags": [
          "leave"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "employee_id": {
                      "type": "integer"
                    },
                    "employee_name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "days": {
                      "type": "integer"
                    },
                    "half_day": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "null"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 88,
                  "employee_id": 12,
                  "employee_name": "Sneha Iyer",
                  "type": {
                    "id": 1,
                    "name": "Casual leave"
                  },
                  "start_date": "2026-12-08",
                  "end_date": "2026-12-09",
                  "days": 2,
                  "half_day": false,
                  "reason": "Family function",
                  "status": "cancelled",
                  "stage": null,
                  "created_at": "2026-11-24T09:12:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/attendance": {
      "get": {
        "operationId": "attendance.list",
        "summary": "Attendance for a date range",
        "description": "Needs the `attendance:read` scope.",
        "tags": [
          "attendance"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "First day (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Last day, at most 62 days after from",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "description": "Only this person",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "employee_id": {
                            "type": "integer"
                          },
                          "date": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "check_in": {
                            "type": "string"
                          },
                          "check_out": {
                            "type": "string"
                          },
                          "work_min": {
                            "type": "integer"
                          },
                          "late_min": {
                            "type": "integer"
                          },
                          "source": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "employee_id": 12,
                      "date": "2026-11-24",
                      "status": "present",
                      "check_in": "09:12",
                      "check_out": "18:40",
                      "work_min": 568,
                      "late_min": 0,
                      "source": "device"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/attendance/punches": {
      "post": {
        "operationId": "attendance.punches",
        "summary": "Send punches",
        "description": "Up to 1,000 punches by employee code. The first punch of a day is the check-in, the last the check-out. Days HR corrected are left alone; months locked for payroll are refused.\n\nNeeds the `attendance:write` scope.",
        "tags": [
          "attendance"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accepted": {
                      "type": "integer"
                    },
                    "days_updated": {
                      "type": "integer"
                    },
                    "unknown_codes": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "accepted": 2,
                  "days_updated": 1,
                  "unknown_codes": []
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "punches": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "emp_code": {
                          "type": "string"
                        },
                        "at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "punches"
                ]
              },
              "example": {
                "punches": [
                  {
                    "emp_code": "E0012",
                    "at": "2026-11-24T09:12"
                  },
                  {
                    "emp_code": "E0012",
                    "at": "2026-11-24T18:40"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/expenses/claims": {
      "get": {
        "operationId": "expenses.list",
        "summary": "List expense claims",
        "description": "Needs the `expenses:read` scope.",
        "tags": [
          "expenses"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "draft, pending, approved, rejected, paid or withdrawn",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "description": "Only this person",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 200 (default 50)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the previous page",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "employee_id": {
                            "type": "integer"
                          },
                          "employee_name": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "submitted_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 31,
                      "employee_id": 12,
                      "employee_name": "Sneha Iyer",
                      "title": "Client visit to Pune",
                      "total": 4820,
                      "status": "pending",
                      "submitted_at": "2026-11-22"
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/approvals": {
      "get": {
        "operationId": "approvals.list",
        "summary": "Everything waiting for a decision",
        "description": "Needs the `approvals:write` scope.",
        "tags": [
          "approvals"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "ref_id": {
                            "type": "integer"
                          },
                          "kind_label": {
                            "type": "string"
                          },
                          "employee_id": {
                            "type": "integer"
                          },
                          "employee_name": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "kind": "leave",
                      "ref_id": 88,
                      "kind_label": "Time off",
                      "employee_id": 12,
                      "employee_name": "Sneha Iyer",
                      "summary": "2 days of casual leave, 8 Dec 2026 to 9 Dec 2026",
                      "reason": "Family function",
                      "stage": "Waiting for their manager",
                      "created_at": "2026-11-24 09:12:00"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/approvals/{kind}/{ref_id}/decide": {
      "post": {
        "operationId": "approvals.decide",
        "summary": "Approve or decline",
        "description": "Decided as the HR admin who created the key, so the company’s approval chain moves on exactly as if they clicked it.\n\nNeeds the `approvals:write` scope.",
        "tags": [
          "approvals"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "description": "leave, correction, expense, comp_off, profile …",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ref_id",
            "in": "path",
            "required": true,
            "description": "The request’s id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string"
                    },
                    "ref_id": {
                      "type": "integer"
                    },
                    "result": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "kind": "leave",
                  "ref_id": 88,
                  "result": "approved"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "decision"
                ]
              },
              "example": {
                "decision": "approved",
                "note": "Enjoy the break"
              }
            }
          }
        }
      }
    },
    "/v1/payroll/months": {
      "get": {
        "operationId": "payroll.months",
        "summary": "Locked payroll months",
        "description": "Needs the `payroll:read` scope.",
        "tags": [
          "payroll"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "month": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "people": {
                            "type": "integer"
                          },
                          "locked_at": {
                            "type": "string"
                          },
                          "hash": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "month": "2026-10",
                      "status": "locked",
                      "people": 48,
                      "locked_at": "2026-11-02T10:00:00Z",
                      "hash": "9c1e…"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/payroll/months/{month}": {
      "get": {
        "operationId": "payroll.month",
        "summary": "A locked month’s payroll inputs",
        "description": "The same contract as the payroll export (anoma.payroll-inputs/v1). 409 if the month is not locked yet.\n\nNeeds the `payroll:read` scope.",
        "tags": [
          "payroll"
        ],
        "parameters": [
          {
            "name": "month",
            "in": "path",
            "required": true,
            "description": "YYYY-MM",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "contract": {
                      "type": "string"
                    },
                    "month": {
                      "type": "string"
                    },
                    "people": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emp_code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "days_in_month": {
                            "type": "integer"
                          },
                          "paid_days": {
                            "type": "integer"
                          },
                          "lop_days": {
                            "type": "integer"
                          },
                          "overtime_hours": {
                            "type": "integer"
                          },
                          "expenses_to_pay": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "contract": "anoma.payroll-inputs/v1",
                  "month": "2026-10",
                  "people": [
                    {
                      "emp_code": "E0012",
                      "name": "Sneha Iyer",
                      "days_in_month": 31,
                      "paid_days": 30,
                      "lop_days": 1,
                      "overtime_hours": 4,
                      "expenses_to_pay": 4820
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events.list",
        "summary": "Recent events",
        "description": "Everything that happened in the last 30 days, newest first. The same events webhooks deliver.\n\nNeeds the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only this event type, e.g. leave.approved",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 200 (default 50)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the previous page",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "employee_id": {
                                "type": "integer"
                              },
                              "employee_name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "integer"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                }
                              },
                              "start_date": {
                                "type": "string"
                              },
                              "end_date": {
                                "type": "string"
                              },
                              "days": {
                                "type": "integer"
                              },
                              "half_day": {
                                "type": "boolean"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "stage": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": "null"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "evt_2b7f0c…",
                      "type": "leave.approved",
                      "created_at": "2026-11-24T10:02:11Z",
                      "data": {
                        "id": 88,
                        "employee_id": 12,
                        "employee_name": "Sneha Iyer",
                        "type": {
                          "id": 1,
                          "name": "Casual leave"
                        },
                        "start_date": "2026-12-08",
                        "end_date": "2026-12-09",
                        "days": 2,
                        "half_day": false,
                        "reason": "Family function",
                        "status": "pending",
                        "stage": "Waiting for their manager",
                        "created_at": "2026-11-24T09:12:00Z"
                      }
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "webhooks.list",
        "summary": "List webhook endpoints",
        "description": "Needs the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "url": "https://hooks.acme.in/anoma",
                      "events": [
                        "leave.approved",
                        "employee.created"
                      ],
                      "active": true,
                      "description": "Payroll sync",
                      "created_at": "2026-11-20 08:00:00"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "webhooks.create",
        "summary": "Add a webhook endpoint",
        "description": "The signing secret is shown once, in this response. Use [\"*\"] for every event.\n\nNeeds the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "url": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "secret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 2,
                  "url": "https://hooks.acme.in/anoma",
                  "events": [
                    "leave.approved",
                    "employee.created"
                  ],
                  "active": true,
                  "secret": "whsec_…"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              },
              "example": {
                "url": "https://hooks.acme.in/anoma",
                "events": [
                  "leave.approved",
                  "employee.created"
                ],
                "description": "Payroll sync"
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "operationId": "webhooks.delete",
        "summary": "Remove a webhook endpoint",
        "description": "Needs the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "operationId": "webhooks.test",
        "summary": "Send a test event",
        "description": "Needs the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "event": {
                      "type": "string"
                    },
                    "delivery_id": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "event": "ping",
                  "delivery_id": 41
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/deliveries": {
      "get": {
        "operationId": "webhooks.deliveries",
        "summary": "Recent deliveries, with what your server answered",
        "description": "Needs the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "query",
            "required": false,
            "description": "Only this endpoint",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only deliveries after this id (for live views)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "endpoint_id": {
                            "type": "integer"
                          },
                          "event_id": {
                            "type": "string"
                          },
                          "event": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "integer"
                          },
                          "response_status": {
                            "type": "integer"
                          },
                          "duration_ms": {
                            "type": "integer"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 41,
                      "endpoint_id": 2,
                      "event_id": "evt_2b7f0c…",
                      "event": "leave.approved",
                      "status": "sent",
                      "attempts": 1,
                      "response_status": 200,
                      "duration_ms": 182,
                      "created_at": "2026-11-24 10:02:11"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/deliveries/{id}": {
      "get": {
        "operationId": "webhooks.delivery",
        "summary": "One delivery in full",
        "description": "The exact signed request ANOMA sent (headers and body) and what your server answered, for checking signatures or debugging.\n\nNeeds the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "event": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "request_headers": {
                      "type": "object",
                      "properties": {
                        "x-anoma-event": {
                          "type": "string"
                        },
                        "x-anoma-signature": {
                          "type": "string"
                        }
                      }
                    },
                    "body": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "workspace": {
                          "type": "string"
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "employee_id": {
                              "type": "integer"
                            },
                            "employee_name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "integer"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            },
                            "start_date": {
                              "type": "string"
                            },
                            "end_date": {
                              "type": "string"
                            },
                            "days": {
                              "type": "integer"
                            },
                            "half_day": {
                              "type": "boolean"
                            },
                            "reason": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "stage": {
                              "type": "string"
                            },
                            "created_at": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "response_status": {
                      "type": "integer"
                    },
                    "response_body": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 41,
                  "event": "leave.approved",
                  "status": "sent",
                  "url": "https://hooks.acme.in/anoma",
                  "request_headers": {
                    "x-anoma-event": "leave.approved",
                    "x-anoma-signature": "t=1795500000,v1=5f0c…"
                  },
                  "body": {
                    "id": "evt_2b7f0c…",
                    "type": "leave.approved",
                    "created_at": "2026-11-24T10:02:11Z",
                    "workspace": "acme",
                    "data": {
                      "id": 88,
                      "employee_id": 12,
                      "employee_name": "Sneha Iyer",
                      "type": {
                        "id": 1,
                        "name": "Casual leave"
                      },
                      "start_date": "2026-12-08",
                      "end_date": "2026-12-09",
                      "days": 2,
                      "half_day": false,
                      "reason": "Family function",
                      "status": "pending",
                      "stage": "Waiting for their manager",
                      "created_at": "2026-11-24T09:12:00Z"
                    }
                  },
                  "response_status": 200,
                  "response_body": "ok"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/deliveries/{id}/redeliver": {
      "post": {
        "operationId": "webhooks.redeliver",
        "summary": "Send a delivery again",
        "description": "Needs the `webhooks:manage` scope.",
        "tags": [
          "webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Its id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delivery_id": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "delivery_id": 42
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "key": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from ANOMA → Developers (ank_…)."
      }
    },
    "responses": {
      "Error": {
        "description": "Something was wrong",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "employee.created": {
      "post": {
        "summary": "Someone was added",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "employee.created"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "employee.updated": {
      "post": {
        "summary": "Someone’s details changed",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "employee.updated"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "employee.exited": {
      "post": {
        "summary": "Someone left the company",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "employee.exited"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "leave.submitted": {
      "post": {
        "summary": "Time off was requested",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "leave.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "leave.approved": {
      "post": {
        "summary": "Time off was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "leave.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "leave.rejected": {
      "post": {
        "summary": "Time off was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "leave.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "leave.cancelled": {
      "post": {
        "summary": "Time off was cancelled",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "leave.cancelled"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "attendance.checked_in": {
      "post": {
        "summary": "Someone checked in",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "attendance.checked_in"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "attendance.checked_out": {
      "post": {
        "summary": "Someone checked out",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "attendance.checked_out"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "training.completed": {
      "post": {
        "summary": "Someone completed a course",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "training.completed"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "correction.submitted": {
      "post": {
        "summary": "An attendance fix was asked for",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "correction.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "correction.approved": {
      "post": {
        "summary": "An attendance fix was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "correction.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "correction.rejected": {
      "post": {
        "summary": "An attendance fix was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "correction.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "expense.submitted": {
      "post": {
        "summary": "An expense claim was submitted",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "expense.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "expense.approved": {
      "post": {
        "summary": "An expense claim was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "expense.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "expense.rejected": {
      "post": {
        "summary": "An expense claim was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "expense.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "comp_off.submitted": {
      "post": {
        "summary": "Comp-off was claimed",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "comp_off.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "comp_off.approved": {
      "post": {
        "summary": "Comp-off was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "comp_off.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "comp_off.rejected": {
      "post": {
        "summary": "Comp-off was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "comp_off.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "profile.submitted": {
      "post": {
        "summary": "Someone asked to change their details",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "profile.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "profile.approved": {
      "post": {
        "summary": "A change to someone’s details was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "profile.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "profile.rejected": {
      "post": {
        "summary": "A change to someone’s details was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "profile.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "resignation.submitted": {
      "post": {
        "summary": "Someone resigned",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "resignation.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "resignation.approved": {
      "post": {
        "summary": "A resignation was accepted",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "resignation.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "resignation.rejected": {
      "post": {
        "summary": "A resignation was not accepted",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "resignation.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "letter.submitted": {
      "post": {
        "summary": "Someone asked for a letter",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "letter.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "letter.approved": {
      "post": {
        "summary": "A letter was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "letter.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "letter.rejected": {
      "post": {
        "summary": "A letter was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "letter.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "loan.submitted": {
      "post": {
        "summary": "Someone asked for a loan or advance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "loan.submitted"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "loan.approved": {
      "post": {
        "summary": "A loan or advance was approved",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "loan.approved"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "loan.rejected": {
      "post": {
        "summary": "A loan or advance was declined",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "loan.rejected"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "approval.requested": {
      "post": {
        "summary": "A request is waiting for someone",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "approval.requested"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "payroll.month.locked": {
      "post": {
        "summary": "HR locked a month for payroll",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "payroll.month.locked"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    },
    "ping": {
      "post": {
        "summary": "A test from the Developers screen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "const": "ping"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx within 15 seconds"
          }
        }
      }
    }
  }
}