{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/feed-fm/json-schema/feed-fm-session-response-schema.json",
  "title": "SessionResponse",
  "description": "The `POST /session` response. The placement and station blocks are\nemitted only when the corresponding placement exists for the\ncredentials, so a client with no offline placement gets neither\n`offline_placement` nor `offline_stations`.\n",
  "x-generated": "2026-12-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/feed-fm-v3-openapi.yml#/components/schemas/SessionResponse",
  "type": "object",
  "required": [
    "success",
    "session"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Always `true` on this payload."
    },
    "session": {
      "$ref": "#/$defs/Session"
    },
    "placement": {
      "$ref": "#/$defs/Placement"
    },
    "stations": {
      "type": "array",
      "description": "A selected subset of stations available for streaming in this\nplacement. This is meant to return 'global' or 'default' stations\nthat clients would otherwise always make an additional `GET\n/station` call on startup to retrieve.\n",
      "items": {
        "$ref": "#/$defs/Station"
      }
    },
    "offline_placement": {
      "$ref": "#/$defs/Placement"
    },
    "offline_stations": {
      "type": "array",
      "description": "The stations available for offline download. Present only when\n`offline_placement` is. These are the only stations anywhere in the\nAPI that carry `expire_date`.\n",
      "items": {
        "$ref": "#/$defs/Station"
      }
    }
  },
  "$defs": {
    "Placement": {
      "type": "object",
      "description": "A placement — an immutable collection of stations and the playback\noptions that apply across them.\n",
      "required": [
        "id",
        "options"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The placement id. Numeric, but always serialized as a string.\n"
        },
        "options": {
          "type": "object",
          "additionalProperties": true,
          "description": "Free-form, customer-configured placement options, passed through\nverbatim. Contents vary per customer.\n"
        }
      }
    },
    "Session": {
      "type": "object",
      "description": "The session object returned by `POST /session`. There is no session\nresource to fetch or delete afterwards; this reports whether the client\ncan stream, who the client is, and the server's clock.\n",
      "required": [
        "available",
        "client_id",
        "time"
      ],
      "properties": {
        "available": {
          "type": "boolean",
          "description": "`true` when a streaming placement with at least one playable station\nwas found for this client and country. When `false`, no music can be\nplayed and `message` explains why.\n"
        },
        "client_id": {
          "type": "string",
          "description": "The client's uuid. Pass this back on subsequent calls (as a\n`client_id` body property or query parameter) to keep play history,\nlikes and skip limits attached to the same listener. If a\n`client_id` was passed to the call, then this entry will match that\nvalue.\n"
        },
        "time": {
          "type": "integer",
          "description": "The server's current time as a Unix timestamp in **seconds** (not\nmilliseconds).\n"
        },
        "message": {
          "type": "string",
          "description": "Why streaming is unavailable. Present only when `available` is\n`false`.\n"
        }
      }
    },
    "Station": {
      "type": "object",
      "description": "A full station. The optional properties are each emitted only under the\nconditions described below, so their absence carries meaning.\n",
      "required": [
        "id",
        "name",
        "on_demand",
        "pre_gain",
        "options",
        "uuid",
        "crossfade_seconds",
        "single_play",
        "last_updated"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The station id. Numeric, but always serialized as a string. This\nvalue changes with the 'placement id', and so should not be\npersisted - use the `uuid` property instead.\n"
        },
        "name": {
          "type": "string",
          "description": "The station's display name."
        },
        "on_demand": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "Whether the station is an on-demand station: `1` for yes, `0` for\nno.\n"
        },
        "pre_gain": {
          "type": [
            "number",
            "null"
          ],
          "description": "Station-level gain adjustment in dB, to be applied before playback.\n`null` when the station has no adjustment configured.\n"
        },
        "options": {
          "$ref": "#/$defs/StationOptions"
        },
        "uuid": {
          "type": "string",
          "description": "The station's stable external identifier. Unlike `id`, it does not\nchange over time.\n"
        },
        "crossfade_seconds": {
          "type": [
            "number",
            "null"
          ],
          "description": "The station's own crossfade duration in seconds. `null` when unset.\nThis may differ from the customer-configured\n`options.crossfade_seconds`; the two can disagree.\n"
        },
        "single_play": {
          "type": "boolean",
          "description": "`true` when the station is a single-play station — one track, not a\ncontinuous stream.\n"
        },
        "last_updated": {
          "type": "string",
          "format": "date-time",
          "description": "When the station's contents last changed. Clients use this to decide\nwhether a cached offline copy is stale.\n"
        },
        "last_play_start": {
          "type": "string",
          "format": "date-time",
          "description": "When this client last started a play on this station. Emitted only\nwhen such a play exists, so it is absent for new clients and for\nstations the client has never played.\n"
        },
        "expire_date": {
          "type": "string",
          "format": "date-time",
          "description": "When a downloaded offline copy of this station should be considered\nexpired — three weeks from the moment of the response. Emitted\n**only** for entries in `offline_stations` on the session response;\nit never appears on streaming stations, nor on the station-list\nroutes even when those are listing offline stations.\n"
        },
        "country_inclusion_mode": {
          "type": "string",
          "description": "How the `countries` list should be read: `include` means the station\nis available only in those countries, `exclude` means it is\navailable everywhere but those.\n"
        },
        "countries": {
          "type": "array",
          "description": "Two-letter ISO 3166-1 alpha-2 country codes the\n`country_inclusion_mode` applies to. Emitted only when\n`country_inclusion_mode` is exactly `include` or `exclude`, and\nnever `null` in that case — when the property is present it always\ncarries the list. Absent for any other mode.\n",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "StationOptions": {
      "type": "object",
      "description": "Free-form, customer-configured options attached to a station. Contents\nvary per customer; unknown keys should be passed through rather than\nrejected.\n",
      "additionalProperties": true,
      "properties": {
        "crossfade_seconds": {
          "type": "number",
          "description": "Crossfade duration for the station, in seconds.\n"
        }
      }
    }
  }
}