{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cavuno-com/json-schema/cavuno-com-distribution-feed-schema.json",
  "title": "DistributionFeed",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cavuno-com-distribution-api-openapi.yml#/components/schemas/DistributionFeed",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the feed."
    },
    "object": {
      "type": "string",
      "enum": [
        "distribution_feed"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "prebuilt",
        "custom"
      ],
      "description": "`prebuilt`: one per aggregator, present on every board, editable but not deletable. `custom`: created by you."
    },
    "name": {
      "type": "string"
    },
    "template": {
      "type": "string",
      "enum": [
        "indeed",
        "jooble",
        "careerjet",
        "jora",
        "jobrapido",
        "custom"
      ]
    },
    "slug": {
      "type": "string",
      "description": "The file name on the board host, `<slug>.xml`. Never changes."
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "The public feed URL to submit to the aggregator, `<board origin>/feeds/<slug>.xml`. It holds no secret. `null` while the board has no public origin (an unpublished Builder board)."
    },
    "submitUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The aggregator's page on submitting a feed. `null` for `custom`."
    },
    "sourceRule": {
      "type": "string",
      "enum": [
        "own",
        "all"
      ]
    },
    "filter": {
      "$ref": "#/$defs/DistributionFeedFilter"
    },
    "customFieldNames": {
      "$ref": "#/$defs/DistributionFeedCustomFieldNames"
    },
    "contactEmail": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "failed",
        "needs_email",
        "not_fetched",
        "active",
        "idle",
        "external"
      ],
      "description": "`failed`: the last build failed. `needs_email`: an Indeed feed with no `contactEmail`. `not_fetched`: no aggregator has fetched the URL yet. `active`: fetched within 14 days, rebuilt as jobs change. `idle`: not fetched for 14 days, rebuilt on its next fetch. `external`: not fetched yet on a board whose frontend is hosted elsewhere (see `GET /v1/distribution/feed-origin`), which must serve `/feeds/<slug>.xml` first."
    },
    "jobCount": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Jobs in the last built file; `null` until the first build."
    },
    "lastBuiltAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 datetime."
    },
    "lastFetchedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When an aggregator last fetched the URL, recorded at most hourly. ISO 8601 datetime."
    },
    "createdAt": {
      "type": "string",
      "description": "ISO 8601 datetime."
    },
    "updatedAt": {
      "type": "string",
      "description": "ISO 8601 datetime."
    }
  },
  "required": [
    "id",
    "object",
    "kind",
    "name",
    "template",
    "slug",
    "url",
    "submitUrl",
    "sourceRule",
    "filter",
    "customFieldNames",
    "contactEmail",
    "status",
    "jobCount",
    "lastBuiltAt",
    "lastFetchedAt",
    "createdAt",
    "updatedAt"
  ],
  "$defs": {
    "DistributionFeedCustomFieldNames": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "root": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `root` (default `source`)."
        },
        "publisher": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `publisher` (default `publisher`)."
        },
        "publisherurl": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `publisherurl` (default `publisherurl`)."
        },
        "lastbuilddate": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `lastbuilddate` (default `lastBuildDate`)."
        },
        "job": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `job` (default `job`)."
        },
        "referencenumber": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `referencenumber` (default `referencenumber`)."
        },
        "title": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `title` (default `title`)."
        },
        "url": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `url` (default `url`)."
        },
        "company": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `company` (default `company`)."
        },
        "date": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `date` (default `date`)."
        },
        "expirationdate": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `expirationdate` (default `expirationdate`)."
        },
        "description": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `description` (default `description`)."
        },
        "location": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `location` (default `location`)."
        },
        "city": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `city` (default `city`)."
        },
        "state": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `state` (default `state`)."
        },
        "country": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `country` (default `country`)."
        },
        "jobtype": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `jobtype` (default `jobtype`)."
        },
        "remotetype": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `remotetype` (default `remotetype`)."
        },
        "seniority": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `seniority` (default `seniority`)."
        },
        "category": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `category` (default `category`)."
        },
        "salary": {
          "type": "string",
          "maxLength": 64,
          "description": "Element name for `salary` (default `salary`)."
        }
      },
      "additionalProperties": false,
      "description": "`custom` template only: element names that replace the defaults. A name starts with a letter or `_` and holds letters, digits, `-`, `_` or `.`; names that share a parent must differ. A blank name keeps the default. Ignored for other templates."
    },
    "DistributionFeedFilter": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "employmentTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "full_time",
              "part_time",
              "contract",
              "internship",
              "temporary",
              "volunteer",
              "other"
            ]
          },
          "maxItems": 50,
          "description": "Only jobs with one of these employment types. At most 50 values."
        },
        "remoteOptions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "on_site",
              "hybrid",
              "remote"
            ]
          },
          "maxItems": 50,
          "description": "Only jobs with one of these workplace types. At most 50 values."
        },
        "seniorityLevels": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "entry_level",
              "associate",
              "mid_level",
              "senior",
              "lead",
              "principal",
              "director",
              "executive"
            ]
          },
          "maxItems": 50,
          "description": "Only jobs with one of these seniority levels. At most 50 values."
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "maxItems": 50,
          "description": "Only jobs with one of these category slugs (normalized the way category URLs are). At most 50 values."
        },
        "featuredOnly": {
          "type": "boolean",
          "description": "Only featured jobs."
        }
      },
      "additionalProperties": false
    }
  }
}