{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usetrackly-app/json-schema/usetrackly-app-job-list-schema.json",
  "title": "JobList",
  "description": "Response envelope for `/api/v1/jobs`. Keyword totals cover the complete eligible cohort when totalIsLowerBound is false. True marks a lower bound; null totals are unknown or omitted by design. countGuidance describes the count state; hasMore and pagination describe continuation.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usetrackly-app-openapi.json#/components/schemas/JobList",
  "type": "object",
  "required": [
    "success",
    "jobs",
    "total",
    "hasMore",
    "pagination"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "jobs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Job"
      }
    },
    "total": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Complete eligible keyword cohort count regardless of page size when totalIsLowerBound is false; only a lower bound when true. Null means unknown or omitted by design; countGuidance describes the state."
    },
    "totalIsLowerBound": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True means total is a lower bound; false means exact; null means the total is unknown."
    },
    "hasMore": {
      "type": "boolean"
    },
    "countStatus": {
      "type": "string",
      "enum": [
        "unavailable"
      ],
      "description": "Present when a bounded legacy count cannot be computed; total and pagination.total are null."
    },
    "countGuidance": {
      "type": "string",
      "description": "Guidance for exact, lower-bound, unavailable or by-design omitted totals, including pagination."
    },
    "autoApplyDevEnabled": {
      "type": "boolean",
      "const": false,
      "description": "Retired compatibility field that is always false."
    },
    "servedFromCache": {
      "type": "boolean"
    },
    "dataFreshnessMs": {
      "type": "integer",
      "description": "Age of the served payload in milliseconds. 0 when freshly computed."
    },
    "postedRecencyMode": {
      "type": "string",
      "enum": [
        "legacy_discovery",
        "unified_posted",
        "display_date"
      ],
      "description": "Active feed-ordering contract; display_date orders by the verified original posted date, then the truthful legacy posted date, then firstSeenAt. Repost evidence remains timeline-only."
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "scoreSource": {
      "type": "string",
      "enum": [
        "local",
        "engine",
        "local_fallback"
      ],
      "description": "Which source served the match scores on this page. local is the default; engine means each job is served the recommendation engine's stored score where the engine has a usable score for that job (matchScore and matchLabel are the engine's own, scoreModel is engine) and the local score otherwise (scoreModel says which, per job); local_fallback means the user is in the engine cohort but has no usable engine score yet, so local scores were served. Absent on responses that predate the field."
    }
  },
  "$defs": {
    "Company": {
      "type": "object",
      "description": "Nested company object embedded in job responses.",
      "required": [
        "id",
        "name",
        "domain"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "logoUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "logoUrls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "companyStage": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. seed, enterprise, decacorn"
        },
        "fundingStage": {
          "type": [
            "string",
            "null"
          ]
        },
        "fundingSeries": {
          "type": [
            "string",
            "null"
          ]
        },
        "valuationMillions": {
          "type": [
            "number",
            "null"
          ]
        },
        "lastFinancingDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "ycBatch": {
          "type": [
            "string",
            "null"
          ],
          "description": "Y Combinator batch (e.g. S09, W21) if applicable."
        },
        "sponsorshipHistory": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/RoleSponsorshipHistory"
            }
          ],
          "description": "US-only company sponsorship history for this job's function plus a cross-function counter-signal. null for non-US roles or companies that have never explicitly stated a policy. Clients render `signal` directly."
        }
      }
    },
    "DimensionScore": {
      "type": "object",
      "description": "Per-dimension contribution to the overall match score.",
      "properties": {
        "dimension": {
          "type": "string"
        },
        "score": {
          "type": "number"
        },
        "weight": {
          "type": "number"
        }
      }
    },
    "Job": {
      "type": "object",
      "description": "Job posting as returned in list responses.",
      "required": [
        "id",
        "externalId",
        "title",
        "companyName",
        "companyId",
        "companyDomain",
        "jobUrl",
        "jobFunction",
        "firstSeenAt"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "externalId": {
          "type": "string",
          "description": "ID assigned by the source ATS."
        },
        "title": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "companyId": {
          "type": "integer"
        },
        "companyDomain": {
          "type": "string"
        },
        "companyLogoUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "companyLogoUrls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "jobUrl": {
          "type": "string",
          "format": "uri"
        },
        "atsSource": {
          "type": [
            "string",
            "null"
          ],
          "description": "ATS vendor slug (e.g. greenhouse, lever, ashby)."
        },
        "autoApplySupported": {
          "type": "boolean",
          "const": false,
          "description": "Retired compatibility field. Full auto-apply is not supported; use Assisted Apply."
        },
        "isPM": {
          "type": "boolean"
        },
        "isStrategyOps": {
          "type": "boolean"
        },
        "isPartnership": {
          "type": "boolean"
        },
        "jobFunction": {
          "allOf": [
            {
              "$ref": "#/$defs/JobFunction"
            }
          ],
          "description": "Display function for the applied list filter. Primary wins when requested; otherwise the first requested eligible function. Detail retains primary."
        },
        "primaryJobFunction": {
          "type": [
            "string",
            "null"
          ],
          "description": "Stored primary classification, independent of the list filter."
        },
        "jobFunctionSecondary": {
          "type": [
            "string",
            "null"
          ],
          "description": "Stored secondary classification; it does not confer general discovery eligibility."
        },
        "postedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "firstSeenAt": {
          "type": "string",
          "format": "date-time"
        },
        "originalPostedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Verified original source posting time. Omitted when provenance is unavailable so live payloads stay unchanged."
        },
        "repostedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Latest verified source repost time. Never copied into postedAt."
        },
        "displayDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Verified original posted date when available, otherwise the trustworthy legacy posted date, then firstSeenAt. Repost evidence is timeline-only in repostedAt."
        },
        "displayDateKind": {
          "type": "string",
          "enum": [
            "posted",
            "reposted",
            "found"
          ]
        },
        "sourceDateObservedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "sourceDateMeta": {
          "$ref": "#/$defs/JobSourceDateBundle"
        },
        "sourceReference": {
          "oneOf": [
            {
              "$ref": "#/$defs/JobSourceReference"
            },
            {
              "type": "null"
            }
          ]
        },
        "isNew": {
          "type": "boolean"
        },
        "isActive": {
          "type": "boolean"
        },
        "sponsorshipStatus": {
          "type": [
            "string",
            "null"
          ],
          "description": "yes, no, or unknown."
        },
        "sponsorshipEvidence": {
          "type": [
            "string",
            "null"
          ]
        },
        "sponsorshipClassifier": {
          "type": [
            "string",
            "null"
          ],
          "description": "Which classifier produced the sponsorship tag (regex, llm, reused)."
        },
        "region": {
          "oneOf": [
            {
              "$ref": "#/$defs/RegionTag"
            },
            {
              "type": "null"
            }
          ]
        },
        "seniorityLevel": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. junior, mid, senior, staff, director."
        },
        "salaryMin": {
          "type": [
            "number",
            "null"
          ]
        },
        "salaryMax": {
          "type": [
            "number",
            "null"
          ]
        },
        "salaryCurrency": {
          "type": [
            "string",
            "null"
          ]
        },
        "salaryPeriod": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. annual, hourly, monthly."
        },
        "salaryRange": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "min": {
                  "type": "number"
                },
                "max": {
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "period": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "salaryText": {
          "type": "string"
        },
        "compensation": {
          "type": "string"
        },
        "compensationText": {
          "type": "string"
        },
        "visaSponsorship": {
          "type": [
            "string",
            "null"
          ]
        },
        "userStatus": {
          "oneOf": [
            {
              "$ref": "#/$defs/JobStatus"
            },
            {
              "type": "null"
            }
          ]
        },
        "applyStartedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "appliedConfirmedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "statusUpdatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "timeToApplyMinutes": {
          "type": [
            "number",
            "null"
          ]
        },
        "matchScore": {
          "type": [
            "number",
            "null"
          ],
          "description": "Personalized match score 0 to 100 on the display scale named by scoreModel. Ranking uses the underlying stored score, so the display scale never reorders jobs; matchLabel is derived from this displayed number with the same 75/55/40/25 cut-offs clients color it with. Null when resume not uploaded or not yet scored."
        },
        "matchScoreStatus": {
          "type": "string",
          "enum": [
            "scored",
            "pending",
            "not_scored"
          ],
          "description": "Scored means a saved real score exists; pending means owned waiting parse or score work; not_scored means no score is available now. Pending carries no completion deadline."
        },
        "matchScoreReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "not_scored",
            "description_unavailable",
            "outside_scoring_window",
            "inactive",
            "parse_required",
            "score_required",
            null
          ],
          "description": "Null accompanies a saved score. parse_required and score_required name missing prerequisites, without asserting queued work. outside_scoring_window means outside the automatic 30-day window, description_unavailable means no usable description, inactive means a closed posting, and not_scored means unknown."
        },
        "scoreModel": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display model that produced matchScore (scoring_model_2026_09_22 for the display curve, raw when the curve is switched off, engine when the recommendation engine produced the number and its own display scale applies). Null when matchScore is null."
        },
        "matchReasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "matchLabel": {
          "type": [
            "string",
            "null"
          ]
        },
        "matchConfidence": {
          "oneOf": [
            {
              "$ref": "#/$defs/MatchConfidence"
            },
            {
              "type": "null"
            }
          ]
        },
        "matchConfidenceReasons": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "missingSkills": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dimensionScores": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DimensionScore"
          }
        },
        "matchExplanation": {
          "type": [
            "string",
            "null"
          ]
        },
        "company": {
          "$ref": "#/$defs/Company"
        }
      }
    },
    "JobFunction": {
      "type": "string",
      "description": "Canonical job function. Matches the `job_function` column in the database.",
      "enum": [
        "product",
        "engineering",
        "design",
        "data",
        "marketing",
        "sales",
        "partnerships",
        "finance",
        "strategy",
        "operations",
        "people",
        "legal",
        "support",
        "other"
      ]
    },
    "JobSourceDateBundle": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "original": {
          "oneOf": [
            {
              "$ref": "#/$defs/JobSourceDateMeta"
            },
            {
              "type": "null"
            }
          ]
        },
        "repost": {
          "oneOf": [
            {
              "$ref": "#/$defs/JobSourceDateMeta"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "JobSourceDateMeta": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "precision": {
          "type": "string",
          "enum": [
            "timestamp",
            "day",
            "unknown"
          ]
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ]
        },
        "calendarDay": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      }
    },
    "JobSourceReference": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "label",
        "value",
        "disambiguatesTitle"
      ],
      "properties": {
        "label": {
          "type": "string",
          "const": "Req"
        },
        "value": {
          "type": "string"
        },
        "disambiguatesTitle": {
          "type": "boolean"
        }
      }
    },
    "JobStatus": {
      "type": "string",
      "description": "The authenticated user's application-pipeline state for a job.",
      "enum": [
        "new",
        "applied_confirmed",
        "check_later",
        "not_interested",
        "all"
      ]
    },
    "MatchConfidence": {
      "type": "string",
      "description": "Confidence level for a per-user match score.",
      "enum": [
        "high",
        "medium",
        "low"
      ]
    },
    "Pagination": {
      "type": "object",
      "required": [
        "total",
        "limit",
        "offset",
        "hasMore"
      ],
      "properties": {
        "total": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Complete eligible keyword cohort count regardless of page size when totalIsLowerBound is false; only a lower bound when true. Null means unknown or omitted by design; countGuidance describes the state."
        },
        "totalIsLowerBound": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "True means total is a lower bound; false means exact; null means the total is unknown."
        },
        "limit": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        },
        "hasMore": {
          "type": "boolean"
        }
      }
    },
    "RegionTag": {
      "type": "string",
      "description": "Region tag used for location filtering.",
      "enum": [
        "us",
        "europe",
        "latam",
        "middle_east",
        "asia",
        "africa",
        "canada",
        "oceania",
        "remote",
        "unknown"
      ]
    },
    "RoleSponsorshipHistory": {
      "type": "object",
      "description": "Company sponsorship history for a single US job (see Company.sponsorshipHistory).",
      "properties": {
        "function": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "description": "Counts + latest-of-each for the viewed job's own function.",
              "required": [
                "jobFunction",
                "noCount",
                "yesCount"
              ],
              "properties": {
                "jobFunction": {
                  "type": "string"
                },
                "noCount": {
                  "type": "integer"
                },
                "yesCount": {
                  "type": "integer"
                },
                "latestNo": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/$defs/SponsorshipExample"
                    }
                  ]
                },
                "latestYes": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/$defs/SponsorshipExample"
                    }
                  ]
                }
              }
            }
          ]
        },
        "signal": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "required": [
                "primary",
                "counter",
                "tone",
                "applicableRegion"
              ],
              "properties": {
                "primary": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/$defs/SponsorshipFacet"
                    }
                  ]
                },
                "counter": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/$defs/SponsorshipFacet"
                    }
                  ]
                },
                "tone": {
                  "type": "string",
                  "enum": [
                    "caution",
                    "positive",
                    "mixed"
                  ]
                },
                "applicableRegion": {
                  "type": "string",
                  "enum": [
                    "us"
                  ]
                }
              }
            }
          ]
        }
      }
    },
    "SponsorshipExample": {
      "type": "object",
      "description": "A past posting that explicitly stated a visa-sponsorship policy.",
      "required": [
        "jobId",
        "jobFunction"
      ],
      "properties": {
        "jobId": {
          "type": "integer",
          "description": "Trackly job id — deep-link via /jobs/{jobId} (resolves even if the posting was later removed)."
        },
        "anchorAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Visible recency timestamp — valid vendor posted_at, otherwise Trackly first_seen_at."
        },
        "postedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "evidence": {
          "type": [
            "string",
            "null"
          ],
          "description": "Exact quote from the posting."
        },
        "jobFunction": {
          "type": "string"
        }
      }
    },
    "SponsorshipFacet": {
      "type": "object",
      "description": "One side of the sponsorship signal (the primary stance or its counter).",
      "required": [
        "polarity",
        "scope",
        "jobFunction",
        "example",
        "message"
      ],
      "properties": {
        "polarity": {
          "type": "string",
          "enum": [
            "no",
            "yes"
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "same_function",
            "other_function"
          ]
        },
        "jobFunction": {
          "type": "string"
        },
        "message": {
          "type": "string",
          "description": "Backend-rendered copy — clients display directly."
        }
      }
    }
  }
}