{
  "openapi": "3.1.0",
  "info": {
    "title": "Karwa Public Careers API",
    "version": "1.0.0",
    "description": "Server-to-server API. Both credentials are required. Only eligible public postings in your company are exposed."
  },
  "servers": [
    {
      "url": "http://localhost:8000/api/auth/public/v1",
      "description": "Local gateway; replace with your deployed HTTPS gateway"
    }
  ],
  "paths": {
    "/whoami": {
      "get": {
        "summary": "Workspace Api Key Identity",
        "operationId": "workspace_api_key_identity_auth_public_v1_whoami_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceApiKeyPrincipal"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "tags": [
          "Credential identity"
        ],
        "description": "Requires both credential headers and Read permission. All careers requests are company-scoped. See /resources/docs/public-api."
      }
    },
    "/jobs": {
      "get": {
        "tags": [
          "Public careers"
        ],
        "summary": "List Jobs",
        "operationId": "list_jobs_auth_public_v1_jobs_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "company_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 160
                },
                {
                  "type": "null"
                }
              ],
              "title": "Company Slug"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 160,
              "default": "",
              "title": "Search"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeveloperJobPage"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "description": "Requires both credential headers and jobs:read. All careers requests are company-scoped. See /resources/docs/public-api."
      }
    },
    "/jobs/{job_id}": {
      "get": {
        "tags": [
          "Public careers"
        ],
        "summary": "Get Job",
        "operationId": "get_job_auth_public_v1_jobs__job_id__get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "posting_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 160
                },
                {
                  "type": "null"
                }
              ],
              "title": "Posting Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeveloperJob"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "description": "Requires both credential headers and jobs:read. All careers requests are company-scoped. See /resources/docs/public-api."
      }
    },
    "/jobs/{job_id}/application-form": {
      "get": {
        "tags": [
          "Public careers"
        ],
        "summary": "Get Form",
        "operationId": "get_form_auth_public_v1_jobs__job_id__application_form_get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "posting_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 160
                },
                {
                  "type": "null"
                }
              ],
              "title": "Posting Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeveloperForm"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "description": "Requires both credential headers and jobs:read. All careers requests are company-scoped. See /resources/docs/public-api."
      }
    },
    "/jobs/{job_id}/application-session": {
      "post": {
        "tags": [
          "Public careers"
        ],
        "summary": "Start Application",
        "operationId": "start_application_auth_public_v1_jobs__job_id__application_session_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "posting_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 160
                },
                {
                  "type": "null"
                }
              ],
              "title": "Posting Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApplicationSession"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          },
          "413": {
            "description": "Request exceeds upload or JSON size limit"
          },
          "503": {
            "description": "Temporary service failure"
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "description": "Requires both credential headers and applications:write. All careers requests are company-scoped. See /resources/docs/public-api."
      }
    },
    "/jobs/{job_id}/application-files/{question_id}": {
      "post": {
        "tags": [
          "Public careers"
        ],
        "summary": "Upload File",
        "operationId": "upload_file_auth_public_v1_jobs__job_id__application_files__question_id__post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "question_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Question Id"
            }
          },
          {
            "name": "posting_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 160
                },
                {
                  "type": "null"
                }
              ],
              "title": "Posting Id"
            }
          },
          {
            "name": "filename",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255,
              "default": "upload",
              "title": "Filename"
            }
          },
          {
            "name": "X-Karwa-Application-Token",
            "in": "header",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Karwa-Application-Token"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeveloperUpload"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          },
          "413": {
            "description": "Request exceeds upload or JSON size limit"
          },
          "503": {
            "description": "Temporary service failure"
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "description": "Requires both credential headers and applications:write. All careers requests are company-scoped. See /resources/docs/public-api.",
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 10485760
              }
            }
          }
        }
      }
    },
    "/jobs/{job_id}/applications": {
      "post": {
        "tags": [
          "Public careers"
        ],
        "summary": "Submit Application",
        "operationId": "submit_application_auth_public_v1_jobs__job_id__applications_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "posting_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 160
                },
                {
                  "type": "null"
                }
              ],
              "title": "Posting Id"
            }
          },
          {
            "name": "X-Karwa-Application-Token",
            "in": "header",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Karwa-Application-Token"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicJobApplicationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeveloperReceipt"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credential or application session"
          },
          "403": {
            "description": "Missing permission, scope or plan access"
          },
          "404": {
            "description": "Posting unavailable"
          },
          "429": {
            "description": "Rate limited; observe Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Wait this many seconds before retrying"
              }
            }
          },
          "413": {
            "description": "Request exceeds upload or JSON size limit"
          },
          "503": {
            "description": "Temporary service failure"
          },
          "409": {
            "description": "Duplicate application"
          }
        },
        "security": [
          {
            "AppKey": [],
            "SecretKey": []
          }
        ],
        "description": "Requires both credential headers and applications:write. All careers requests are company-scoped. See /resources/docs/public-api."
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "DeveloperReceipt": {
        "properties": {
          "submitted": {
            "type": "boolean",
            "title": "Submitted",
            "default": true
          },
          "application_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Application Reference"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "created_at"
        ],
        "title": "DeveloperReceipt"
      },
      "PublicJobApplicationCreate": {
        "properties": {
          "full_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "minLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "cover_letter": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Letter"
          },
          "consent": {
            "type": "boolean",
            "title": "Consent",
            "default": false
          },
          "source": {
            "type": "string",
            "enum": [
              "careers_site",
              "google_jobs"
            ],
            "title": "Source",
            "default": "careers_site"
          },
          "source_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Token"
          },
          "referrer_origin": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Referrer Origin"
          },
          "referral_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Referral Token"
          },
          "referral_visitor_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ],
            "title": "Referral Visitor Id"
          },
          "utm_parameters": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Utm Parameters"
          },
          "answers": {
            "additionalProperties": true,
            "type": "object",
            "title": "Answers"
          }
        },
        "type": "object",
        "title": "PublicJobApplicationCreate"
      },
      "DeveloperUpload": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "filename": {
            "type": "string",
            "title": "Filename"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          }
        },
        "type": "object",
        "required": [
          "token",
          "filename",
          "content_type",
          "size_bytes"
        ],
        "title": "DeveloperUpload"
      },
      "PublicApplicationSession": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "token",
          "expires_at"
        ],
        "title": "PublicApplicationSession"
      },
      "DeveloperForm": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "posting_id": {
            "type": "string",
            "title": "Posting Id"
          },
          "application_form": {
            "additionalProperties": true,
            "type": "object",
            "title": "Application Form"
          },
          "consent_required": {
            "type": "boolean",
            "title": "Consent Required",
            "default": true
          },
          "max_file_bytes": {
            "type": "integer",
            "title": "Max File Bytes",
            "default": 10485760
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "posting_id",
          "application_form"
        ],
        "title": "DeveloperForm"
      },
      "DeveloperJob": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "posting_id": {
            "type": "string",
            "title": "Posting Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "company_name": {
            "type": "string",
            "title": "Company Name"
          },
          "company_slug": {
            "type": "string",
            "title": "Company Slug"
          },
          "department": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Department"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "employment_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Employment Type"
          },
          "workplace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workplace"
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          },
          "application_deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Application Deadline"
          },
          "compensation_summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compensation Summary"
          },
          "apply_url": {
            "type": "string",
            "title": "Apply Url"
          }
        },
        "type": "object",
        "required": [
          "id",
          "posting_id",
          "title",
          "description",
          "company_name",
          "company_slug",
          "apply_url"
        ],
        "title": "DeveloperJob"
      },
      "DeveloperJobPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DeveloperJob"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset",
          "has_more"
        ],
        "title": "DeveloperJobPage"
      },
      "WorkspaceApiKeyPrincipal": {
        "properties": {
          "organization_id": {
            "type": "integer",
            "title": "Organization Id"
          },
          "company_name": {
            "type": "string",
            "title": "Company Name"
          },
          "key_id": {
            "type": "integer",
            "title": "Key Id"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "public_api",
              "integration",
              "both"
            ],
            "title": "Purpose"
          },
          "permissions": {
            "items": {
              "type": "string",
              "enum": [
                "read",
                "write"
              ]
            },
            "type": "array",
            "title": "Permissions"
          },
          "scopes": {
            "items": {
              "type": "string",
              "enum": [
                "jobs:read",
                "applications:write"
              ]
            },
            "type": "array",
            "title": "Scopes"
          }
        },
        "type": "object",
        "required": [
          "organization_id",
          "company_name",
          "key_id",
          "purpose",
          "permissions"
        ],
        "title": "WorkspaceApiKeyPrincipal"
      }
    },
    "securitySchemes": {
      "AppKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Karwa-App-Key"
      },
      "SecretKey": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
