{
  "openapi": "3.1.0",
  "info": {
    "title": "WorkdayAPI",
    "version": "0.2.0",
    "summary": "Business-day and public-holiday math for 29 countries.",
    "description": "JSON API behind https://workdayapi.mike-tusa.workers.dev. No key needed for light use (about 30 requests/min per IP). A free API key (POST /v1/keys) allows about 120/min and 1,000 calls/month. There are no X-RateLimit-* headers; a 429 carries Retry-After. AI agents can also use the remote MCP server at https://workdayapi.mike-tusa.workers.dev/mcp (see /llms.txt). Not legal, payroll or financial advice.",
    "contact": {
      "name": "WorkdayAPI",
      "email": "digitalpromohub.support@gmail.com",
      "url": "https://workdayapi.mike-tusa.workers.dev/"
    }
  },
  "servers": [
    {
      "url": "https://workdayapi.mike-tusa.workers.dev"
    }
  ],
  "externalDocs": {
    "description": "Human-readable API docs",
    "url": "https://workdayapi.mike-tusa.workers.dev/docs"
  },
  "tags": [
    {
      "name": "calendar"
    },
    {
      "name": "keys"
    },
    {
      "name": "meta"
    },
    {
      "name": "mcp"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Free key (`wd_live_` + 64 hex). Optional on calendar routes and /mcp."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Same key as `Authorization: Bearer wd_live_…`."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {}
            }
          },
          "docs": {
            "type": "string"
          }
        }
      },
      "JsonRpcMessage": {
        "type": "object",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object"
          }
        }
      }
    }
  },
  "paths": {
    "/v1/holidays": {
      "get": {
        "tags": [
          "calendar"
        ],
        "operationId": "getHolidays",
        "summary": "Holidays for a country and year",
        "security": [
          {},
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "ISO 3166-1 alpha-2 code",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$",
              "maxLength": 2
            },
            "example": "US"
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "description": "2020-2035",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$"
            },
            "example": "2027"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Region code, e.g. DE-BY or US-CA",
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "description": "Comma list of public, bank, observance, or all",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Holiday list",
            "headers": {
              "x-cache": {
                "description": "`HIT`/`MISS` (edge cache) or `BYPASS`",
                "schema": {
                  "type": "string",
                  "enum": [
                    "HIT",
                    "MISS",
                    "BYPASS"
                  ]
                }
              },
              "x-plan": {
                "description": "`anonymous`, `free` or `pro`",
                "schema": {
                  "type": "string"
                }
              },
              "x-quota-limit": {
                "description": "Monthly calls for the key's plan (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-used": {
                "description": "Calls used this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-remaining": {
                "description": "Calls left this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-workdayapi-version": {
                "description": "Deployed version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "`missing_parameter`, `invalid_date`, `invalid_country`, `invalid_weekend`, `invalid_types`, `invalid_days`, `invalid_year` or `duplicate_parameter`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`invalid_api_key`: a key was sent but is malformed, unknown or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_country` or `unknown_region`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`date_out_of_range`, `year_out_of_range`, `days_out_of_range` or `result_out_of_range`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`, `too_many_auth_failures` or `monthly_quota_exceeded`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/is-business-day": {
      "get": {
        "tags": [
          "calendar"
        ],
        "operationId": "isBusinessDay",
        "summary": "Is a date a business day?",
        "security": [
          {},
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "ISO 3166-1 alpha-2 code",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$",
              "maxLength": 2
            },
            "example": "US"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD, 2020-01-01..2035-12-31",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "maxLength": 10
            },
            "example": "2027-07-05"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Region code, e.g. DE-BY or US-CA",
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "weekend",
            "in": "query",
            "required": false,
            "description": "Weekend days, e.g. sat,sun (default), fri,sat or none",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "description": "Comma list of public, bank, observance, or all",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Business-day check",
            "headers": {
              "x-cache": {
                "description": "`HIT`/`MISS` (edge cache) or `BYPASS`",
                "schema": {
                  "type": "string",
                  "enum": [
                    "HIT",
                    "MISS",
                    "BYPASS"
                  ]
                }
              },
              "x-plan": {
                "description": "`anonymous`, `free` or `pro`",
                "schema": {
                  "type": "string"
                }
              },
              "x-quota-limit": {
                "description": "Monthly calls for the key's plan (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-used": {
                "description": "Calls used this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-remaining": {
                "description": "Calls left this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-workdayapi-version": {
                "description": "Deployed version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "`missing_parameter`, `invalid_date`, `invalid_country`, `invalid_weekend`, `invalid_types`, `invalid_days`, `invalid_year` or `duplicate_parameter`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`invalid_api_key`: a key was sent but is malformed, unknown or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_country` or `unknown_region`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`date_out_of_range`, `year_out_of_range`, `days_out_of_range` or `result_out_of_range`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`, `too_many_auth_failures` or `monthly_quota_exceeded`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/add": {
      "get": {
        "tags": [
          "calendar"
        ],
        "operationId": "addBusinessDays",
        "summary": "Add or subtract business days",
        "security": [
          {},
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "ISO 3166-1 alpha-2 code",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$",
              "maxLength": 2
            },
            "example": "US"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD, 2020-01-01..2035-12-31",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "maxLength": 10
            },
            "example": "2027-12-23"
          },
          {
            "name": "days",
            "in": "query",
            "required": true,
            "description": "Integer, |days| <= 2500",
            "schema": {
              "type": "string",
              "pattern": "^[+-]?\\d+$",
              "maxLength": 6
            },
            "example": "3"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Region code, e.g. DE-BY or US-CA",
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "weekend",
            "in": "query",
            "required": false,
            "description": "Weekend days, e.g. sat,sun (default), fri,sat or none",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "description": "Comma list of public, bank, observance, or all",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result date",
            "headers": {
              "x-cache": {
                "description": "`HIT`/`MISS` (edge cache) or `BYPASS`",
                "schema": {
                  "type": "string",
                  "enum": [
                    "HIT",
                    "MISS",
                    "BYPASS"
                  ]
                }
              },
              "x-plan": {
                "description": "`anonymous`, `free` or `pro`",
                "schema": {
                  "type": "string"
                }
              },
              "x-quota-limit": {
                "description": "Monthly calls for the key's plan (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-used": {
                "description": "Calls used this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-remaining": {
                "description": "Calls left this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-workdayapi-version": {
                "description": "Deployed version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "`missing_parameter`, `invalid_date`, `invalid_country`, `invalid_weekend`, `invalid_types`, `invalid_days`, `invalid_year` or `duplicate_parameter`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`invalid_api_key`: a key was sent but is malformed, unknown or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_country` or `unknown_region`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`date_out_of_range`, `year_out_of_range`, `days_out_of_range` or `result_out_of_range`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`, `too_many_auth_failures` or `monthly_quota_exceeded`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/between": {
      "get": {
        "tags": [
          "calendar"
        ],
        "operationId": "businessDaysBetween",
        "summary": "Business days between two dates",
        "security": [
          {},
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "ISO 3166-1 alpha-2 code",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$",
              "maxLength": 2
            },
            "example": "US"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD, 2020-01-01..2035-12-31",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "maxLength": 10
            },
            "example": "2027-12-01"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD, 2020-01-01..2035-12-31",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "maxLength": 10
            },
            "example": "2027-12-31"
          },
          {
            "name": "inclusive",
            "in": "query",
            "required": false,
            "description": "Count the end date (true/false)",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false",
                "1",
                "0",
                "yes",
                "no"
              ]
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Region code, e.g. DE-BY or US-CA",
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "weekend",
            "in": "query",
            "required": false,
            "description": "Weekend days, e.g. sat,sun (default), fri,sat or none",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "description": "Comma list of public, bank, observance, or all",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Day counts",
            "headers": {
              "x-cache": {
                "description": "`HIT`/`MISS` (edge cache) or `BYPASS`",
                "schema": {
                  "type": "string",
                  "enum": [
                    "HIT",
                    "MISS",
                    "BYPASS"
                  ]
                }
              },
              "x-plan": {
                "description": "`anonymous`, `free` or `pro`",
                "schema": {
                  "type": "string"
                }
              },
              "x-quota-limit": {
                "description": "Monthly calls for the key's plan (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-used": {
                "description": "Calls used this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-quota-remaining": {
                "description": "Calls left this month (keyed calls only)",
                "schema": {
                  "type": "integer"
                }
              },
              "x-workdayapi-version": {
                "description": "Deployed version",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "`missing_parameter`, `invalid_date`, `invalid_country`, `invalid_weekend`, `invalid_types`, `invalid_days`, `invalid_year` or `duplicate_parameter`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`invalid_api_key`: a key was sent but is malformed, unknown or revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_country` or `unknown_region`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`date_out_of_range`, `year_out_of_range`, `days_out_of_range` or `result_out_of_range`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`, `too_many_auth_failures` or `monthly_quota_exceeded`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/countries": {
      "get": {
        "tags": [
          "calendar"
        ],
        "operationId": "listCountries",
        "summary": "Supported countries, regions and sources",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "Country list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/batch": {
      "post": {
        "tags": [
          "calendar"
        ],
        "operationId": "batch",
        "summary": "Many operations in one request (Pro only; paid plans coming soon)",
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ops"
                ],
                "properties": {
                  "ops": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-op results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json` or `invalid_batch`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`api_key_required` or `invalid_api_key`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`plan_required`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` (16 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`too_many_ops`, `too_many_calendars` or `too_many_details`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`, `too_many_auth_failures` or `monthly_quota_exceeded`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys": {
      "post": {
        "tags": [
          "keys"
        ],
        "operationId": "createKey",
        "summary": "Get a free API key (shown once)",
        "security": [
          {}
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Key created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key": {
                      "type": "string",
                      "pattern": "^wd_live_[a-f0-9]{64}$"
                    },
                    "plan": {
                      "const": "free"
                    },
                    "monthly_limit": {
                      "type": "integer"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`signup_closed`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "`method_not_allowed`",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` or `signup_limit_reached`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/key": {
      "get": {
        "tags": [
          "keys"
        ],
        "operationId": "keyStatus",
        "summary": "Plan and monthly usage for your key",
        "security": [
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "plan": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "month": {
                      "type": "string"
                    },
                    "used": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "`api_key_required` or `invalid_api_key`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` or `too_many_auth_failures`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`daily_capacity_reached` or `quota_unavailable`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "meta"
        ],
        "operationId": "health",
        "summary": "Service status, version and limits",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "service",
                    "version"
                  ],
                  "properties": {
                    "status": {
                      "const": "ok"
                    },
                    "service": {
                      "const": "workdayapi"
                    },
                    "version": {
                      "type": "string",
                      "examples": [
                        "0.2.0"
                      ]
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcp",
        "summary": "Remote MCP server (Streamable HTTP, JSON-RPC 2.0)",
        "description": "Model Context Protocol endpoint. Stateless, JSON responses only (no SSE, no Mcp-Session-Id). Supported protocol versions: 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05. Modern (2026-07-28) requests carry params._meta and the MCP-Protocol-Version, Mcp-Method and Mcp-Name headers; legacy clients use initialize. Tools: get_holidays, is_business_day, add_business_days, business_days_between, list_countries. Same keys and limits as /v1/*; each tools/call counts as one API call. Body max 65536 bytes; legacy batches max 10 messages with at most one tools/call.",
        "security": [
          {},
          {
            "apiKeyHeader": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "MCP-Protocol-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-07-28",
                "2025-11-25",
                "2025-06-18",
                "2025-03-26",
                "2024-11-05"
              ]
            }
          },
          {
            "name": "Mcp-Method",
            "in": "header",
            "required": false,
            "description": "Required for 2026-07-28; must equal the body method",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Mcp-Name",
            "in": "header",
            "required": false,
            "description": "Required for 2026-07-28 tools/call; must equal params.name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/JsonRpcMessage"
                  },
                  {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "$ref": "#/components/schemas/JsonRpcMessage"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response (or batch). Tool failures, including rate limits, are results with isError: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": [
                    "object",
                    "array"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Notification(s) accepted; no body"
          },
          "400": {
            "description": "Parse error (-32700), invalid request (-32600), header mismatch (-32020), unsupported protocol version (-32022) or missing _meta (-32602)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key (JSON-RPC error, data.code = invalid_api_key)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Origin header present but not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown method in a 2026-07-28 request (-32601)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "413": {
            "description": "Body larger than the cap",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many non-call MCP messages from this IP, or too many failed key attempts",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (`internal_error`); per-message failures are JSON-RPC -32603 inside a 200 response instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Key service unavailable (`quota_unavailable` / `daily_capacity_reached`)",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcp_get_not_allowed",
        "summary": "Not supported (stateless server: no SSE stream, no sessions)",
        "responses": {
          "405": {
            "description": "Always 405 with `Allow: POST, OPTIONS` and a JSON-RPC error body",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "POST, OPTIONS"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcp_delete_not_allowed",
        "summary": "Not supported (stateless server: no SSE stream, no sessions)",
        "responses": {
          "405": {
            "description": "Always 405 with `Allow: POST, OPTIONS` and a JSON-RPC error body",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "POST, OPTIONS"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}