{
  "openapi": "3.1.0",
  "info": {
    "title": "That Works Careers API",
    "version": "1.0.0",
    "description": "A public, read-only API for discovering current That Works Agency job openings. It never exposes candidate records or accepts applications. Versioning uses the /api/v1 path; no version is currently deprecated. Future deprecation notices will be documented here and signalled with Deprecation and Sunset response headers.",
    "contact": {
      "name": "That Works Agency",
      "email": "hello@thatworks.agency",
      "url": "https://careers.thatworks.agency/contact"
    }
  },
  "servers": [
    {
      "url": "https://careers.thatworks.agency",
      "description": "Production careers site"
    }
  ],
  "externalDocs": {
    "description": "Agent-readable usage guidance",
    "url": "https://careers.thatworks.agency/llms.txt"
  },
  "x-api-versioning-policy": {
    "url": "https://careers.thatworks.agency/api-policy",
    "currentStatus": "No public API version is currently deprecated",
    "deprecationHeader": "Deprecation",
    "sunsetHeader": "Sunset"
  },
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "getApiIndexV1",
        "summary": "Discover the version 1 careers API",
        "description": "Returns the version 1 API index and read-only job discovery links.",
        "responses": {
          "200": {
            "description": "Version 1 API index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["name", "version", "description", "documentation", "resources", "endpoints"],
                  "properties": {
                    "name": { "type": "string" },
                    "version": { "type": "string" },
                    "description": { "type": "string" },
                    "documentation": { "type": "string", "format": "uri" },
                    "resources": { "type": "string", "format": "uri" },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["method", "path", "description"],
                        "properties": {
                          "method": { "type": "string" },
                          "path": { "type": "string" },
                          "description": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs": {
      "get": {
        "operationId": "listOpenJobsV1",
        "summary": "List open jobs in version 1",
        "description": "Returns all currently open That Works Agency positions through the stable version 1 API.",
        "responses": {
          "200": {
            "description": "Open jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["jobs", "total", "lastUpdated"],
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["title", "slug", "summary", "location", "type", "department", "applyUrl"],
                        "properties": {
                          "title": { "type": "string" },
                          "slug": { "type": "string" },
                          "summary": { "type": "string" },
                          "location": { "type": "string" },
                          "type": { "type": "string" },
                          "department": { "type": "string" },
                          "applyUrl": { "type": "string", "format": "uri" }
                        }
                      }
                    },
                    "total": { "type": "integer", "minimum": 0 },
                    "lastUpdated": { "type": "string", "format": "date-time" }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The jobs data source could not be reached.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["error"],
                  "properties": {
                    "error": { "$ref": "#/components/schemas/ApiError" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{slug}": {
      "get": {
        "operationId": "getOpenJobBySlugV1",
        "summary": "Get one open job in version 1",
        "description": "Returns one public job through the stable version 1 API.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The public job slug returned by GET /api/v1/jobs.",
            "schema": { "type": "string", "minLength": 1, "pattern": "^[a-z0-9-]+$" }
          }
        ],
        "responses": {
          "200": {
            "description": "Open job details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["title", "slug", "summary", "location", "type", "department", "responsibilities", "requirements", "niceToHave", "applyUrl"],
                  "properties": {
                    "title": { "type": "string" },
                    "slug": { "type": "string" },
                    "summary": { "type": "string" },
                    "location": { "type": "string" },
                    "type": { "type": "string" },
                    "department": { "type": "string" },
                    "responsibilities": { "type": "array", "items": { "type": "string" } },
                    "requirements": { "type": "array", "items": { "type": "string" } },
                    "niceToHave": { "type": "array", "items": { "type": "string" } },
                    "applyUrl": { "type": "string", "format": "uri" }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The job does not exist or is not open for applications.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["error"],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": ["code", "message", "resolution"],
                      "properties": {
                        "code": { "type": "string" },
                        "message": { "type": "string" },
                        "resolution": { "type": "string" }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "Discover the public careers API",
        "description": "Returns the API name, version, documentation links, and available read-only endpoints.",
        "responses": {
          "200": {
            "description": "API index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["name", "version", "description", "documentation", "resources", "endpoints"],
                  "properties": {
                    "name": { "type": "string" },
                    "version": { "type": "string" },
                    "description": { "type": "string" },
                    "documentation": { "type": "string", "format": "uri" },
                    "resources": { "type": "string", "format": "uri" },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["method", "path", "description"],
                        "properties": {
                          "method": { "type": "string" },
                          "path": { "type": "string" },
                          "description": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/jobs": {
      "get": {
        "operationId": "listOpenJobs",
        "summary": "List open jobs",
        "description": "Returns all currently open That Works Agency positions with public metadata and application URLs.",
        "responses": {
          "200": {
            "description": "Open jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["jobs", "total", "lastUpdated"],
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["title", "slug", "summary", "location", "type", "department", "applyUrl"],
                        "properties": {
                          "title": { "type": "string" },
                          "slug": { "type": "string" },
                          "summary": { "type": "string" },
                          "location": { "type": "string" },
                          "type": { "type": "string" },
                          "department": { "type": "string" },
                          "applyUrl": { "type": "string", "format": "uri" }
                        }
                      }
                    },
                    "total": { "type": "integer", "minimum": 0 },
                    "lastUpdated": { "type": "string", "format": "date-time" }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/JobsUnavailable"
          }
        }
      }
    },
    "/api/jobs/{slug}": {
      "get": {
        "operationId": "getOpenJobBySlug",
        "summary": "Get one open job",
        "description": "Returns the public details for one currently open position. Closed or missing positions return a structured JSON error.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The public job slug returned by GET /api/jobs.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[a-z0-9-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open job details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["title", "slug", "summary", "location", "type", "department", "responsibilities", "requirements", "niceToHave", "applyUrl"],
                  "properties": {
                    "title": { "type": "string" },
                    "slug": { "type": "string" },
                    "summary": { "type": "string" },
                    "location": { "type": "string" },
                    "type": { "type": "string" },
                    "department": { "type": "string" },
                    "responsibilities": { "type": "array", "items": { "type": "string" } },
                    "requirements": { "type": "array", "items": { "type": "string" } },
                    "niceToHave": { "type": "array", "items": { "type": "string" } },
                    "applyUrl": { "type": "string", "format": "uri" }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The job does not exist or is not open for applications.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["error"],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": ["code", "message", "resolution"],
                      "properties": {
                        "code": { "type": "string" },
                        "message": { "type": "string" },
                        "resolution": { "type": "string" }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "The job data source could not be reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiIndex": {
        "type": "object",
        "required": ["name", "version", "description", "documentation", "resources", "endpoints"],
        "properties": {
          "name": { "type": "string" },
          "version": { "type": "string" },
          "description": { "type": "string" },
          "documentation": { "type": "string", "format": "uri" },
          "resources": { "type": "string", "format": "uri" },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["method", "path", "description"],
              "properties": {
                "method": { "type": "string" },
                "path": { "type": "string" },
                "description": { "type": "string" }
              }
            }
          }
        }
      },
      "JobSummary": {
        "type": "object",
        "required": ["title", "slug", "summary", "location", "type", "department", "applyUrl"],
        "properties": {
          "title": { "type": "string" },
          "slug": { "type": "string" },
          "summary": { "type": "string" },
          "location": { "type": "string" },
          "type": { "type": "string" },
          "department": { "type": "string" },
          "applyUrl": { "type": "string", "format": "uri" }
        }
      },
      "OpenJobsResponse": {
        "type": "object",
        "required": ["jobs", "total", "lastUpdated"],
        "properties": {
          "jobs": { "type": "array", "items": { "$ref": "#/components/schemas/JobSummary" } },
          "total": { "type": "integer", "minimum": 0 },
          "lastUpdated": { "type": "string", "format": "date-time" }
        }
      },
      "JobDetail": {
        "allOf": [
          { "$ref": "#/components/schemas/JobSummary" },
          {
            "type": "object",
            "required": ["responsibilities", "requirements", "niceToHave"],
            "properties": {
              "responsibilities": { "type": "array", "items": { "type": "string" } },
              "requirements": { "type": "array", "items": { "type": "string" } },
              "niceToHave": { "type": "array", "items": { "type": "string" } }
            }
          }
        ]
      },
      "ApiError": {
        "type": "object",
        "required": ["code", "message", "resolution"],
        "properties": {
          "code": { "type": "string" },
          "message": { "type": "string" },
          "resolution": { "type": "string" }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "$ref": "#/components/schemas/ApiError" }
        }
      }
    },
    "responses": {
      "JobsUnavailable": {
        "description": "The jobs data source could not be reached.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
      },
      "JobNotFound": {
        "description": "The job does not exist or is not open for applications.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
      },
      "JobUnavailable": {
        "description": "The job data source could not be reached.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
      }
    }
  }
}
