openapi: 3.2.0 info: contact: email: support@aiapplyd.com name: AI Applyd url: https://aiapplyd.com description: 'The AI Applyd API runs the whole job hunt for you: it matches you to roles that fit your profile, rewrites your resume for each posting, writes the cover letter the form asks for, and auto-applies across the major applicant tracking systems.' license: name: Proprietary url: https://aiapplyd.com/legal/terms title: AI Applyd User Preferences API version: 115c47ce servers: - description: Current environment url: https://api.aiapplyd.com/api/v1 security: - BearerAuth: [] tags: - name: User Preferences paths: /user/preferences: get: tags: - User Preferences summary: Get User Preferences Bundle description: Get the authenticated user's application profile, job match preferences, and AI persona in one round-trip. responses: '200': description: User preferences bundle retrieved content: application/json: schema: $ref: '#/components/schemas/UserPreferencesResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' operationId: getUserPreferences patch: tags: - User Preferences summary: Patch User Preferences Bundle description: Partially update one or more of the user's preference blocks (application profile, job match preferences, AI persona) in a single atomic D1 batch. At least one block must be present. requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchUserPreferences' responses: '200': description: User preferences bundle updated, plus `prefsChanged` content: application/json: schema: $ref: '#/components/schemas/PatchUserPreferencesResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' operationId: patchUserPreferences components: schemas: UserPreferencesData: type: - object - 'null' properties: applicationProfile: $ref: '#/components/schemas/ApplicationProfileData' jobMatchPreferences: $ref: '#/components/schemas/JobMatchPreferencesData' aiPersona: $ref: '#/components/schemas/AIPersonaData' required: - applicationProfile - jobMatchPreferences - aiPersona JobMatchPreferencesData: type: object properties: benefits: type: - array - 'null' items: type: string companySize: type: - array - 'null' items: type: string createdAt: type: - string - 'null' educationLevel: type: - string - 'null' excludeIndustries: type: - array - 'null' items: type: string experienceLevel: type: - string - 'null' experienceLevels: type: - array - 'null' items: type: string id: type: integer includeRemote: type: boolean industries: type: - array - 'null' items: type: string isActive: type: boolean jobTypes: type: - array - 'null' items: type: string locations: type: - array - 'null' items: type: string remoteGlobal: type: boolean salaryCurrency: type: string enum: - usd - eur - gbp - cad - aud - inr description: Currency for salary values example: usd salaryMax: type: - number - 'null' salaryMin: type: - number - 'null' skills: type: - array - 'null' items: type: string targetRoles: type: - array - 'null' items: type: string updatedAt: type: - string - 'null' visaSponsorship: type: - string - 'null' workStyles: type: array items: type: string enum: - onsite - hybrid - remote description: User's preferred work style, physical mode only, no geo scoping example: remote required: - benefits - companySize - createdAt - educationLevel - excludeIndustries - experienceLevel - experienceLevels - id - includeRemote - industries - isActive - jobTypes - locations - remoteGlobal - salaryCurrency - salaryMax - salaryMin - skills - targetRoles - updatedAt - visaSponsorship - workStyles PatchUserPreferencesData: allOf: - $ref: '#/components/schemas/UserPreferencesData' - type: object properties: prefsChanged: type: boolean description: True only when this PATCH changed at least one job_match_preference column AND started a match rebuild. False for an unchanged or persona/profile-only save, when the post-write prefs read failed, and when an earlier save's rebuild was already running (no rebuild started for this request). example: true required: - prefsChanged ResponseMetadata: type: object properties: duration: type: number description: Request duration in milliseconds example: 150 exclusiveMinimum: 0 performance: type: object properties: dbQueries: type: integer minimum: 0 totalDbTime: type: number minimum: 0 description: Performance metrics (preview/local only) requestId: type: string description: Unique request identifier example: req_abc123 timestamp: type: string format: date-time description: ISO 8601 timestamp example: '2026-09-25T17:29:47.224Z' version: type: string description: API version example: v1 ApplicationProfileData: type: object properties: id: type: string description: Application profile identifier example: abc-123 userId: type: string description: User identifier example: user_abc123 phone: type: - string - 'null' description: Phone number example: +1-555-123-4567 addressLine1: type: - string - 'null' description: Address line 1 example: 123 Main St addressLine2: type: - string - 'null' description: Address line 2 example: Apt 4B city: type: - string - 'null' description: City example: San Francisco state: type: - string - 'null' description: State or province example: CA zipCode: type: - string - 'null' description: ZIP or postal code example: '94105' country: type: - string - 'null' description: Country example: US linkedinUrl: type: - string - 'null' description: LinkedIn profile URL example: https://linkedin.com/in/johndoe portfolioUrl: type: - string - 'null' description: Portfolio website URL example: https://johndoe.dev githubUrl: type: - string - 'null' description: GitHub profile URL example: https://github.com/johndoe currentEmployer: type: - string - 'null' description: Current employer / company. Helps tailor recommendations; unlocks team analytics if the company onboards. example: Acme Corp dateOfBirth: type: - string - 'null' description: Date of birth (ISO 8601 date string) example: '1995-06-15' workAuthorization: type: - string - 'null' enum: - us_citizen - permanent_resident - visa_holder - require_sponsorship - other - null description: Work authorization status example: us_citizen willingToRelocate: type: boolean description: Willing to relocate for a job example: false relocationLocations: type: - array - 'null' items: type: string description: Preferred relocation locations as "City, Country" or "Country". Middle admin segments stripped on read. example: - New York, United States - Austin, United States salaryCurrency: type: - string - 'null' enum: - usd - eur - gbp - cad - aud - inr - null description: Salary currency example: usd availableStartDate: type: - string - 'null' description: Earliest available start date (ISO 8601 date string) example: '2026-04-01' noticePeriod: type: - string - 'null' enum: - immediately - two_weeks - one_month - two_months - three_months - flexible - null description: Notice period before starting new position example: two_weeks personalNarrative: type: - string - 'null' description: Free-form narrative about gaps / transitions / short stints. Drives interview-prep red-flag question generation (F8). example: Took a 14-month gap in 2024 for caregiving; returning with a refreshed cloud certification. travelWillingness: type: - string - 'null' enum: - none - up_to_25 - up_to_50 - up_to_75 - up_to_100 - null description: Willingness to travel for work example: up_to_25 securityClearance: type: - string - 'null' enum: - none - confidential - secret - top_secret - ts_sci - prefer_not_to_say - null description: Security clearance level example: none restrictiveCovenantStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Currently subject to a non-compete / non-solicit / restrictive covenant with a former employer example: 'no' criminalRecordStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Has a criminal conviction they are legally required to disclose example: 'no' backgroundCheckConsent: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Consents to a background / reference / credit check or drug screen where the role requires one example: 'yes' relatedToEmployeeStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: 'Has a family member or close personal relationship with an employee of a company they apply to. Global, not per-employer: only a "no" is committable on a form.' example: 'no' exportControlUsPerson: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Is a U.S. person for export-control (ITAR / EAR) purposes. The only declaration whose "yes" is the permissive answer. example: 'yes' highestEducation: type: - string - 'null' enum: - high_school - associate - bachelor - master - doctorate - any - null description: Highest education level completed example: bachelor yearsOfExperience: type: - integer - 'null' description: Total years of professional experience example: 5 veteranStatus: type: - string - 'null' enum: - not_a_veteran - veteran - disabled_veteran - recently_separated_veteran - active_duty_wartime_veteran - armed_forces_service_medal_veteran - prefer_not_to_say - null description: Veteran status for EEO forms example: prefer_not_to_say disabilityStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Disability status for EEO forms example: prefer_not_to_say gender: type: - string - 'null' enum: - male - female - non_binary - prefer_not_to_say - other - null description: Gender for EEO forms example: prefer_not_to_say ethnicity: type: - string - 'null' enum: - american_indian_or_alaska_native - asian - black_or_african_american - hispanic_or_latino - native_hawaiian_or_pacific_islander - white - two_or_more_races - prefer_not_to_say - other - null description: Ethnicity for EEO forms example: prefer_not_to_say sexualOrientation: type: - string - 'null' enum: - heterosexual - gay_or_lesbian - bisexual - prefer_not_to_say - other - null description: Sexual orientation for EEO forms example: prefer_not_to_say pronouns: type: - string - 'null' maxLength: 40 description: Preferred pronouns, self-described free text. Never inferred from a name or from `gender`. example: she/her applyReadiness: type: object properties: missingRequiredForApply: type: array items: type: string enum: - zip_code - state - country description: An application_profile column an employer form can require and that we never invent example: zip_code description: Profile columns an employer form can require that are empty. We never invent these; the user fills them. example: - zip_code - state required: - missingRequiredForApply description: Required-for-apply columns that are still empty addressCompleteness: type: object properties: city: type: boolean complete: type: boolean country: type: boolean postalCode: type: boolean state: type: boolean street: type: boolean required: - city - complete - country - postalCode - state - street createdAt: type: string description: Profile creation timestamp example: '2026-01-15T12:00:00Z' updatedAt: type: string description: Profile last update timestamp example: '2026-03-10T08:30:00Z' required: - id - userId - phone - addressLine1 - addressLine2 - city - state - zipCode - country - linkedinUrl - portfolioUrl - githubUrl - currentEmployer - dateOfBirth - workAuthorization - willingToRelocate - relocationLocations - salaryCurrency - availableStartDate - noticePeriod - personalNarrative - travelWillingness - securityClearance - restrictiveCovenantStatus - criminalRecordStatus - backgroundCheckConsent - relatedToEmployeeStatus - exportControlUsPerson - highestEducation - yearsOfExperience - veteranStatus - disabilityStatus - gender - ethnicity - sexualOrientation - pronouns - applyReadiness - addressCompleteness - createdAt - updatedAt AIPersonaData: type: object properties: id: type: string description: AI persona identifier example: abc-123 userId: type: string description: User identifier example: user_abc123 presetId: type: string enum: - balanced - the_professional - the_conversationalist - the_storyteller - the_closer - the_enthusiast - custom description: Selected persona preset example: balanced personalDescription: type: - string - 'null' description: Free text about the user for AI personalization example: Senior engineer with 10 years in fintech toneInstructions: type: - string - 'null' description: Custom rules for AI tone and style example: Always mention my passion for open-source samplePhrases: type: - array - 'null' items: type: string description: Example phrases the user would naturally use example: - Let me walk you through my approach - I thrive in fast-paced environments generateCoverLetterPerJob: type: boolean description: Whether AI generates a cover letter for each job application example: true tailorResumePerJob: type: boolean description: Whether AI tailors resume for each job application example: true resumeStrategy: type: string enum: - base - tailor description: Resume handling strategy example: tailor coverLetterStrategy: type: string enum: - 'off' - use_base - tailor_base - generate_new description: Cover letter handling strategy example: generate_new translationStrategy: type: string enum: - 'off' - translate - translate_and_tailor description: Translation strategy example: 'off' mode: type: string enum: - copilot - auto_approve description: 'Application mode: copilot (review before submitting) or auto_approve (submits automatically)' example: copilot allowFabrication: type: boolean description: Fill-gaps for the apply agent, enabled by default. When true, a required field the agent cannot take directly from profile facts is sourced real-data-first (the resume, tailored resume, and cover letter for this application, then job preferences, then profile) and only fabricated as a last resort, marked as assumed. When false (explicit opt-out), it never fabricates such an answer. Contact/identity completion (phone, city, postal, profile links) always completes required fields and is not governed by this flag. example: true scoringWeights: type: - object - 'null' properties: location: type: number minimum: 0 maximum: 2 remote: type: number minimum: 0 maximum: 2 salary: type: number minimum: 0 maximum: 2 seniority: type: number minimum: 0 maximum: 2 skills: type: number minimum: 0 maximum: 2 visa: type: number minimum: 0 maximum: 2 required: - location - remote - salary - seniority - skills - visa description: Per-dimension match scoring weights. NULL when the user has never customised them (scorer falls back to uniform defaults). example: skills: 1 location: 1 remote: 1 seniority: 1 salary: 1 visa: 1 createdAt: type: string description: Persona creation timestamp example: '2026-01-15T12:00:00Z' updatedAt: type: string description: Persona last update timestamp example: '2026-03-10T08:30:00Z' required: - id - userId - presetId - personalDescription - toneInstructions - samplePhrases - generateCoverLetterPerJob - tailorResumePerJob - resumeStrategy - coverLetterStrategy - translationStrategy - mode - allowFabrication - scoringWeights - createdAt - updatedAt UserPreferencesResponse: type: object properties: data: $ref: '#/components/schemas/UserPreferencesData' meta: $ref: '#/components/schemas/ResponseMetadata' success: type: boolean enum: - true required: - data - success additionalProperties: false description: Successful API response PatchUserPreferences: type: object properties: applicationProfile: type: object properties: phone: type: - string - 'null' maxLength: 20 description: Phone number example: +1-555-123-4567 addressLine1: type: - string - 'null' maxLength: 255 description: Address line 1 example: 123 Main St addressLine2: type: - string - 'null' maxLength: 255 description: Address line 2 example: Apt 4B city: type: - string - 'null' maxLength: 100 description: City example: San Francisco state: type: - string - 'null' maxLength: 100 description: State or province example: CA zipCode: type: - string - 'null' maxLength: 20 description: ZIP or postal code example: '94105' country: type: - string - 'null' maxLength: 100 description: Country example: US linkedinUrl: type: - string - 'null' maxLength: 500 format: uri description: LinkedIn profile URL example: https://linkedin.com/in/johndoe portfolioUrl: type: - string - 'null' maxLength: 500 format: uri description: Portfolio website URL example: https://johndoe.dev githubUrl: type: - string - 'null' maxLength: 500 format: uri description: GitHub profile URL example: https://github.com/johndoe currentEmployer: type: - string - 'null' maxLength: 120 description: Current employer / company. Helps tailor recommendations; unlocks team analytics if the company onboards. example: Acme Corp dateOfBirth: type: - string - 'null' description: Date of birth (ISO 8601 date string) example: '1995-06-15' workAuthorization: type: - string - 'null' enum: - us_citizen - permanent_resident - visa_holder - require_sponsorship - other - null description: Work authorization status example: us_citizen willingToRelocate: type: boolean description: Willing to relocate for a job example: false relocationLocations: type: - array - 'null' items: type: string description: Preferred relocation locations as "City, Country" or "Country" (max per-entry stripping of middle admin segments on ingest). example: - New York, United States - Austin, United States salaryCurrency: type: - string - 'null' enum: - usd - eur - gbp - cad - aud - inr - null description: Salary currency example: usd availableStartDate: type: - string - 'null' description: Earliest available start date (ISO 8601 date string) example: '2026-04-01' noticePeriod: type: - string - 'null' enum: - immediately - two_weeks - one_month - two_months - three_months - flexible - null description: Notice period before starting new position example: two_weeks personalNarrative: type: - string - 'null' maxLength: 500 description: Free-form narrative about gaps / transitions / short stints. Drives interview-prep red-flag question generation (F8). example: Took a 14-month gap in 2024 for caregiving; returning with a refreshed cloud certification. travelWillingness: type: - string - 'null' enum: - none - up_to_25 - up_to_50 - up_to_75 - up_to_100 - null description: Willingness to travel for work example: up_to_25 securityClearance: type: - string - 'null' enum: - none - confidential - secret - top_secret - ts_sci - prefer_not_to_say - null description: Security clearance level example: none restrictiveCovenantStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Currently subject to a non-compete / non-solicit / restrictive covenant with a former employer example: 'no' criminalRecordStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Has a criminal conviction they are legally required to disclose example: 'no' backgroundCheckConsent: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Consents to a background / reference / credit check or drug screen where the role requires one example: 'yes' relatedToEmployeeStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: 'Has a family member or close personal relationship with an employee of a company they apply to. Global, not per-employer: only a "no" is committable on a form.' example: 'no' exportControlUsPerson: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Is a U.S. person for export-control (ITAR / EAR) purposes. The only declaration whose "yes" is the permissive answer. example: 'yes' highestEducation: type: - string - 'null' enum: - high_school - associate - bachelor - master - doctorate - any - null description: Highest education level completed example: bachelor yearsOfExperience: type: - integer - 'null' minimum: 0 maximum: 50 description: Total years of professional experience example: 5 veteranStatus: type: - string - 'null' enum: - not_a_veteran - veteran - disabled_veteran - recently_separated_veteran - active_duty_wartime_veteran - armed_forces_service_medal_veteran - prefer_not_to_say - null description: Veteran status for EEO forms example: prefer_not_to_say disabilityStatus: type: - string - 'null' enum: - 'yes' - 'no' - prefer_not_to_say - null description: Disability status for EEO forms example: prefer_not_to_say gender: type: - string - 'null' enum: - male - female - non_binary - prefer_not_to_say - other - null description: Gender for EEO forms example: prefer_not_to_say ethnicity: type: - string - 'null' enum: - american_indian_or_alaska_native - asian - black_or_african_american - hispanic_or_latino - native_hawaiian_or_pacific_islander - white - two_or_more_races - prefer_not_to_say - other - null description: Ethnicity for EEO forms example: prefer_not_to_say sexualOrientation: type: - string - 'null' enum: - heterosexual - gay_or_lesbian - bisexual - prefer_not_to_say - other - null description: Sexual orientation for EEO forms example: prefer_not_to_say pronouns: type: - string - 'null' maxLength: 40 description: Preferred pronouns, self-described free text example: she/her additionalProperties: false description: Partial application_profile patch. Only provided fields are updated. jobMatchPreferences: type: object properties: benefits: type: array items: type: string description: Must-have job benefits example: - health_insurance - remote_work companySize: type: array items: type: string description: Preferred company sizes example: - startup - small educationLevel: type: string description: Minimum education level filter example: bachelor excludeIndustries: type: array items: type: string description: Industries to exclude from matches example: - Government & Public Sector experienceLevel: type: string enum: - entry - mid - senior - lead - executive description: Target experience level (DEPRECATED scalar - prefer `experienceLevels`). When `experienceLevels` is present it wins; this scalar is kept so legacy mobile binaries keep working. example: senior experienceLevels: type: array items: type: string enum: - entry - mid - senior - lead - executive description: Professional experience level example: mid description: Target experience levels (multi-select, new source of truth). Empty/omitted = no seniority constraint. The first element is mirrored into the deprecated scalar `experienceLevel`. example: - mid - senior includeRemote: type: boolean description: Include region-restricted remote jobs (workStyles "remote") even when specific locations are set. Does NOT control worldwide remote - see `remoteGlobal`. example: true remoteGlobal: type: boolean description: Accept worldwide "Remote - Anywhere (Global)" jobs from any region. Independent of `includeRemote`/workStyles "remote" (which stay region-restricted). Set via the "Remote - Anywhere (Global)" option in the location picker. example: false industries: type: array items: type: string description: Target industries example: - Technology - Finance isActive: type: boolean description: Enable or disable daily matches example: true jobTypes: type: array items: type: string description: Preferred job types example: - full_time - contract locations: type: array items: type: string maxItems: 5 description: Preferred locations as "City, Country" or "Country" (max 5). Middle admin segments (state/province) are stripped on ingest. Placeholder values ("anywhere", "any", ...) are rejected for security (they disable location scoping and let clients harvest the full job pool). An empty array is accepted ONLY for a caller opted into `remoteGlobal` - worldwide remote is itself the location answer. example: - San Francisco, United States - Berlin, Germany salaryCurrency: type: string enum: - usd - eur - gbp - cad - aud - inr description: Currency for the salary band (converted to USD for matching). Defaults to usd. example: eur salaryMax: type: - number - 'null' minimum: 0 description: Maximum salary requirement. null clears it. example: 200000 salaryMin: type: - number - 'null' minimum: 0 description: Minimum salary requirement. null clears it. example: 100000 skills: type: array items: type: string description: User skills (from resume or manual entry) example: - TypeScript - React - Node.js - PostgreSQL targetRoles: type: array items: type: string minItems: 1 maxItems: 5 description: Target role titles (max 5). When present, at least one specific title is required - empty arrays and placeholder values ("anywhere", "any", ...) are rejected for security (they disable role scoping and let clients harvest the full job pool). example: - Software Engineer - Full Stack Developer visaSponsorship: type: - string - 'null' description: Visa sponsorship preference. null clears it. example: required workStyles: type: array items: type: string enum: - onsite - hybrid - remote description: User's preferred work style, physical mode only, no geo scoping example: remote minItems: 1 description: Preferred work styles (onsite/hybrid/remote) - multi-select, at least 1 required. Geo scoping is inferred from `locations`, NOT this field. example: - remote - hybrid additionalProperties: false description: Partial job_match_preference patch. Only provided fields are updated; salaryMin, salaryMax and visaSponsorship accept null to clear. Free-text role + location arrays are canonicalized server-side. aiPersona: type: object properties: allowFabrication: type: boolean description: 'Allow the apply agent to fill gaps: complete a required field it cannot take from profile facts, sourcing real-data-first (the resume, tailored resume, and cover letter for this application, then job preferences, then profile) and fabricating only as a last resort. Enabled by default; set false to opt out. Contact/identity completion is always-on and not gated by this flag.' example: true coverLetterStrategy: type: string enum: - 'off' - use_base - tailor_base - generate_new description: Cover letter handling strategy example: generate_new dailyLimit: type: integer minimum: 1 maximum: 50 generateCoverLetterPerJob: type: boolean description: Whether to generate cover letter per job example: true minMatchScore: type: integer minimum: 0 maximum: 100 mode: type: string enum: - copilot - auto_approve description: Application mode example: copilot personalDescription: type: - string - 'null' maxLength: 500 description: Free text about yourself (max 500 chars) example: Senior engineer with 10 years in fintech presetId: type: string enum: - balanced - the_professional - the_conversationalist - the_storyteller - the_closer - the_enthusiast - custom description: Selected persona preset example: balanced resumeStrategy: type: string enum: - base - tailor description: Resume handling strategy example: tailor samplePhrases: type: - array - 'null' items: type: string maxLength: 200 maxItems: 10 description: Example phrases you naturally use (max 10) example: - Let me walk you through my approach tailorResumePerJob: type: boolean description: Whether to tailor resume per job example: true toneInstructions: type: - string - 'null' maxLength: 1000 description: Custom tone rules (max 1000 chars) example: Always mention my passion for open-source translationStrategy: type: string enum: - 'off' - translate - translate_and_tailor description: Translation strategy example: 'off' additionalProperties: false description: Partial ai_persona patch. Strategy enums win over legacy booleans via mirrorLegacyBooleans(). additionalProperties: false PatchUserPreferencesResponse: type: object properties: data: $ref: '#/components/schemas/PatchUserPreferencesData' meta: $ref: '#/components/schemas/ResponseMetadata' success: type: boolean enum: - true required: - data - success additionalProperties: false description: Successful API response ApiErrorResponse: type: object properties: error: type: object properties: code: type: string context: oneOf: - type: object properties: errorType: type: string enum: - validation field: type: string fieldErrors: type: array items: type: object properties: code: type: string expected: type: string field: type: string message: type: string received: type: string required: - field - message schemaName: type: string required: - errorType - type: object properties: attemptedEmail: type: string format: email errorType: type: string enum: - authentication failureReason: type: string enum: - invalid_credentials - account_locked - expired_token - token_expired - missing_token - invalid_token - session_expired description: Reason for authentication failure example: token_expired ipAddress: type: string operation: type: string service: type: string userAgent: type: string required: - errorType - type: object properties: actualPermission: type: string errorType: type: string enum: - authorization requiredPermission: type: string resource: type: string resourceId: type: string userId: type: string required: - errorType - type: object properties: constraint: type: string errorType: type: string enum: - database operation: type: string enum: - insert - update - delete - select - batch - transaction - migration description: Type of database operation example: select resourceId: type: string sqlState: type: string table: type: string userId: type: string required: - errorType - type: object properties: endpoint: type: string errorType: type: string enum: - external_service httpStatus: type: number operation: type: string resourceId: type: string responseTime: type: number retryAttempt: type: integer service: type: string serviceName: type: string userId: type: string required: - errorType - type: object properties: errorType: type: string enum: - resource resource: type: string resourceId: type: string service: type: string userId: type: string required: - errorType - type: object properties: errorType: type: string enum: - rate_limit limit: type: number resetTime: type: string windowMs: type: number required: - errorType - type: object properties: configKey: type: string errorType: type: string enum: - configuration operation: type: string service: type: string required: - errorType description: Type-safe error context information example: errorType: validation fieldErrors: - field: email message: Invalid email format details: oneOf: - type: object properties: detailType: type: string enum: - validation validationErrors: type: array items: type: object properties: code: type: string field: type: string message: type: string required: - field - message required: - detailType - validationErrors additionalProperties: false - type: object properties: detailType: type: string enum: - service_error originalError: type: string serviceName: type: string required: - detailType - serviceName additionalProperties: false - type: object properties: currentSize: type: number detailType: type: string enum: - batch originalError: type: string statementCount: type: number required: - detailType additionalProperties: false - type: object properties: detailType: type: string enum: - rate_limit limit: type: number resetTime: type: string windowMs: type: number required: - detailType - limit - resetTime - windowMs additionalProperties: false - type: object properties: conflictingField: type: string detailType: type: string enum: - resource resourceId: anyOf: - type: string - type: number resourceType: type: string required: - detailType additionalProperties: false - type: object properties: detailType: type: string enum: - generic info: type: string required: - detailType additionalProperties: false - type: object properties: currentTokens: type: integer minimum: 0 detailType: type: string enum: - insufficient_tokens requiredTokens: type: integer minimum: 0 required: - currentTokens - detailType - requiredTokens additionalProperties: false message: type: string validation: type: array items: type: object properties: code: type: string field: type: string message: type: string required: - field - message additionalProperties: false required: - code - message additionalProperties: false meta: $ref: '#/components/schemas/ResponseMetadata' success: type: boolean enum: - false required: - error - success additionalProperties: false securitySchemes: BearerAuth: description: 'Session token from signing in to AI Applyd, sent as `Authorization: Bearer `.' scheme: bearer type: http