{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postproxy-dev/json-schema/postproxy-dev-queue-schema.json",
  "title": "Queue",
  "description": "A posting queue that automatically schedules posts into recurring weekly timeslots, with priority-based ordering.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postproxy-dev-queues-api-openapi.yml#/components/schemas/Queue",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Queue identifier (ID)"
    },
    "name": {
      "type": "string",
      "description": "Queue name"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional description"
    },
    "timezone": {
      "type": "string",
      "description": "IANA timezone name (e.g. America/New_York)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether the queue is active. When paused (false), posts in the queue will not be published even if their scheduled time arrives"
    },
    "jitter": {
      "type": "integer",
      "description": "Random offset in minutes (+/-) applied to scheduled times (0-60, default: 0)",
      "minimum": 0,
      "maximum": 60,
      "default": 0
    },
    "profile_group_id": {
      "type": "string",
      "description": "Associated profile group (ID)"
    },
    "timeslots": {
      "type": "array",
      "description": "Weekly timeslot definitions",
      "items": {
        "$ref": "#/$defs/QueueTimeslot"
      }
    },
    "posts_count": {
      "type": "integer",
      "description": "Number of currently scheduled posts"
    }
  },
  "$defs": {
    "QueueTimeslot": {
      "type": "object",
      "description": "A weekly timeslot: a day of the week plus a time, interpreted in the queue's timezone.",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Timeslot ID (used for deletion)"
        },
        "day": {
          "type": "integer",
          "description": "Day of the week: 0=Sunday, 1=Monday, ..., 6=Saturday",
          "minimum": 0,
          "maximum": 6
        },
        "time": {
          "type": "string",
          "description": "Time in 24-hour HH:MM format"
        }
      }
    }
  }
}