{
  "components": {
    "schemas": {
      "AttemptList": {
        "properties": {
          "attempts": {
            "items": {
              "$ref": "#/components/schemas/AttemptResponse"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "AttemptResponse": {
        "properties": {
          "dispatch_time": {
            "format": "date-time",
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "error_kind": {
            "type": "string"
          },
          "error_snippet": {
            "type": "string"
          },
          "number": {
            "type": "integer"
          },
          "response_status": {
            "type": "integer"
          },
          "response_time": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BatchError": {
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "BatchResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/BatchResult"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BatchResult": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/BatchError"
          },
          "index": {
            "type": "integer"
          },
          "task": {
            "$ref": "#/components/schemas/TaskResponse"
          }
        },
        "type": "object"
      },
      "CodeSent": {
        "properties": {
          "sent": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CredentialsBody": {
        "properties": {
          "api_key": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailCodeBody": {
        "properties": {
          "code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Invite": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "InviteCreateBody": {
        "properties": {
          "email": {
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "member",
              "viewer"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "InviteCreated": {
        "properties": {
          "emailed": {
            "description": "SaaS mode: the invitation was emailed.",
            "type": "boolean"
          },
          "invite": {
            "$ref": "#/components/schemas/Invite"
          },
          "path": {
            "description": "Self-hosted: the invite link to send (relative to the server).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "InvitesList": {
        "properties": {
          "invites": {
            "items": {
              "$ref": "#/components/schemas/Invite"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Key": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "last_used_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "KeyCreateBody": {
        "properties": {
          "name": {
            "description": "What uses the key, e.g. billing-service.",
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "writer"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "KeyCreated": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "secret": {
            "description": "The API key itself. Shown only once; store it now.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "KeysList": {
        "properties": {
          "config_keys": {
            "description": "How many more keys are defined in the server config file.",
            "type": "integer"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/Key"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "LastAttempt": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MePatchBody": {
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PasswordChangeBody": {
        "properties": {
          "current_password": {
            "type": "string"
          },
          "new_password": {
            "description": "At least 8 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Perms": {
        "properties": {
          "delete_queue": {
            "type": "boolean"
          },
          "list": {
            "type": "boolean"
          },
          "manage": {
            "type": "boolean"
          },
          "read": {
            "type": "boolean"
          },
          "write": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Problem": {
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "QueueCreate": {
        "properties": {
          "dead_letter_queue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rate_limits": {
            "$ref": "#/components/schemas/RateLimits"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "target": {
            "$ref": "#/components/schemas/Target"
          }
        },
        "type": "object"
      },
      "QueueList": {
        "properties": {
          "next_page_token": {
            "type": "string"
          },
          "queues": {
            "items": {
              "$ref": "#/components/schemas/QueueResponse"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "QueuePatch": {
        "properties": {
          "dead_letter_queue": {
            "type": "string"
          },
          "rate_limits": {
            "$ref": "#/components/schemas/RateLimits"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "state": {
            "type": "string"
          },
          "target": {
            "$ref": "#/components/schemas/TargetPatch"
          }
        },
        "type": "object"
      },
      "QueuePut": {
        "properties": {
          "dead_letter_queue": {
            "type": "string"
          },
          "rate_limits": {
            "$ref": "#/components/schemas/RateLimits"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "target": {
            "$ref": "#/components/schemas/Target"
          }
        },
        "type": "object"
      },
      "QueueResponse": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dead_letter_queue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "purged_at": {
            "format": "date-time",
            "type": "string"
          },
          "rate_limits": {
            "$ref": "#/components/schemas/RateLimitsResponse"
          },
          "retry": {
            "$ref": "#/components/schemas/RetryResponse"
          },
          "state": {
            "type": "string"
          },
          "target": {
            "$ref": "#/components/schemas/TargetResponse"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "QueueStatsResponse": {
        "properties": {
          "dispatched_last_1h": {
            "type": "integer"
          },
          "dispatched_last_1m": {
            "type": "integer"
          },
          "errors_last_1h": {
            "type": "integer"
          },
          "errors_last_1m": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "last_purge": {
            "format": "date-time",
            "type": "string"
          },
          "oldest_due_age_seconds": {
            "type": "number"
          },
          "oldest_due_at": {
            "format": "date-time",
            "type": "string"
          },
          "pending": {
            "type": "integer"
          },
          "running": {
            "type": "integer"
          },
          "scheduled_future": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "succeeded": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RateLimits": {
        "properties": {
          "max_burst_size": {
            "type": "integer"
          },
          "max_concurrent_dispatches": {
            "type": "integer"
          },
          "max_dispatches_per_second": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "RateLimitsResponse": {
        "properties": {
          "max_burst_size": {
            "type": "integer"
          },
          "max_concurrent_dispatches": {
            "type": "integer"
          },
          "max_dispatches_per_second": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "ReadyResponse": {
        "properties": {
          "dialect": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResetLinkCreated": {
        "properties": {
          "link": {
            "$ref": "#/components/schemas/Invite"
          },
          "path": {
            "description": "Single-use link relative to the server, e.g. /invite#token=…",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Retry": {
        "properties": {
          "max_attempts": {
            "type": "integer"
          },
          "max_backoff_seconds": {
            "type": "number"
          },
          "max_doublings": {
            "type": "integer"
          },
          "max_retry_duration_seconds": {
            "type": "number"
          },
          "min_backoff_seconds": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "RetryResponse": {
        "properties": {
          "max_attempts": {
            "type": "integer"
          },
          "max_backoff_seconds": {
            "type": "number"
          },
          "max_doublings": {
            "type": "integer"
          },
          "max_retry_duration_seconds": {
            "type": "number"
          },
          "min_backoff_seconds": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "SessionResponse": {
        "properties": {
          "authenticated": {
            "type": "boolean"
          },
          "key_name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "needs_team": {
            "type": "boolean"
          },
          "permissions": {
            "$ref": "#/components/schemas/Perms"
          },
          "role": {
            "type": "string"
          },
          "setup_required": {
            "type": "boolean"
          },
          "setup_requires_key": {
            "type": "boolean"
          },
          "sso_providers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "team": {
            "$ref": "#/components/schemas/Team"
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/Team"
            },
            "type": "array"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        },
        "type": "object"
      },
      "Target": {
        "properties": {
          "base_url": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "signing_secret": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TargetPatch": {
        "properties": {
          "base_url": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "signing_secret": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TargetResponse": {
        "properties": {
          "base_url": {
            "type": "string"
          },
          "has_signing_secret": {
            "type": "boolean"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TaskBatchCreate": {
        "properties": {
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/TaskCreate"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TaskCreate": {
        "properties": {
          "body_base64": {
            "type": "string"
          },
          "delay_seconds": {
            "type": "number"
          },
          "dispatch_deadline_seconds": {
            "type": "number"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "json_body": {},
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "schedule_time": {
            "format": "date-time",
            "type": "string"
          },
          "task_id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TaskList": {
        "properties": {
          "next_page_token": {
            "type": "string"
          },
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/TaskResponse"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TaskResponse": {
        "properties": {
          "body_base64": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dispatch_count": {
            "type": "integer"
          },
          "dispatch_deadline_seconds": {
            "type": "number"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "first_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "last_attempt": {
            "$ref": "#/components/schemas/LastAttempt"
          },
          "method": {
            "type": "string"
          },
          "queue": {
            "type": "string"
          },
          "response_count": {
            "type": "integer"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "schedule_time": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Team": {
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TeamNameBody": {
        "properties": {
          "name": {
            "description": "1-100 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TeamsList": {
        "properties": {
          "teams": {
            "items": {
              "$ref": "#/components/schemas/Team"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "User": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "last_login_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UserEnvelope": {
        "properties": {
          "user": {
            "$ref": "#/components/schemas/User"
          }
        },
        "type": "object"
      },
      "UserPatchBody": {
        "properties": {
          "name": {
            "description": "Self-hosted only; in SaaS mode names come from WorkOS.",
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "member",
              "viewer"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UsersList": {
        "properties": {
          "users": {
            "items": {
              "$ref": "#/components/schemas/User"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "VerifiedSignIn": {
        "properties": {
          "next": {
            "description": "Where the dashboard should go next.",
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        },
        "type": "object"
      },
      "VerifyPending": {
        "properties": {
          "email": {
            "description": "Where the verification code was sent.",
            "type": "string"
          },
          "pending": {
            "description": "A sign-in is waiting for an email verification code.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "VersionResponse": {
        "properties": {
          "commit": {
            "type": "string"
          },
          "dialect": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "description": "An API key from the dashboard (Settings → API keys) or the server config.",
        "scheme": "bearer",
        "type": "http"
      },
      "session": {
        "description": "Dashboard sign-in session.",
        "in": "cookie",
        "name": "pushq_session",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "pushq is a self-hosted HTTP push task queue: an open-source alternative to Google Cloud Tasks.\nTasks are delivered as HTTP requests to your endpoints with per-queue rate limits, concurrency caps\nand Cloud Tasks-compatible retries.\n\n**Authentication.** Send an API key as `Authorization: Bearer \u003ckey\u003e`. The dashboard uses a\nsession cookie instead; requests that change something with the cookie must also send\n`X-Requested-With: pushq`.\n\n**Queue names** may contain `/` (folders, e.g. `user/instagram`); in paths the whole\nname is one URL-encoded segment (`user%2Finstagram`).\n\n**Errors** are RFC 9457 problem+json with a stable `code`.\n\nThis document is generated from the running server's routes.",
    "title": "pushq API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/docs": {
      "get": {
        "description": "No credentials needed.",
        "operationId": "getDocs",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [],
        "summary": "Interactive API docs (Swagger UI)",
        "tags": [
          "System"
        ]
      }
    },
    "/healthz": {
      "get": {
        "description": "Returns `ok` while the process is up.\n\nNo credentials needed.",
        "operationId": "getHealthz",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [],
        "summary": "Liveness check",
        "tags": [
          "System"
        ]
      }
    },
    "/metrics": {
      "get": {
        "description": "Public when `metrics.public` is set in the server config.\n\n**Access:** admin keys. In SaaS mode, only the operator's config-file keys.",
        "operationId": "getMetrics",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Prometheus metrics",
        "tags": [
          "System"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "description": "Generated from the server's routes at runtime.\n\nNo credentials needed.",
        "operationId": "getOpenapiJson",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [],
        "summary": "This OpenAPI document",
        "tags": [
          "System"
        ]
      }
    },
    "/readyz": {
      "get": {
        "description": "Fails with 503 while the database is unreachable. `role` is `leader` on the replica running the dispatcher.\n\nNo credentials needed.",
        "operationId": "getReadyz",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadyResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Readiness check",
        "tags": [
          "System"
        ]
      }
    },
    "/v1/api-keys": {
      "get": {
        "description": "SaaS mode: the current team's keys.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "getApiKeys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeysList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "List API keys",
        "tags": [
          "API keys"
        ]
      },
      "post": {
        "description": "The key is returned once (`secret`) and stored only as a hash.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "postApiKeys",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyCreated"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Create an API key",
        "tags": [
          "API keys"
        ]
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "description": "Requests using it fail from then on.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "deleteApiKeysId",
        "parameters": [
          {
            "description": "Numeric ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Revoke an API key",
        "tags": [
          "API keys"
        ]
      }
    },
    "/v1/auth/email-code": {
      "post": {
        "description": "A new email gets an account, so this is also sign-up. Doesn't reveal whether the email already had one. Rate-limited.\n\nNo credentials needed.",
        "operationId": "postAuthEmailCode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeSent"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Email a 6-digit sign-in code (SaaS)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/email-code:verify": {
      "post": {
        "description": "Sets the session cookie. May answer 403 `email_verification_required`; finish with POST /v1/auth/email-verification.\n\nNo credentials needed.",
        "operationId": "postAuthEmailCodeVerify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Sign in with the emailed code (SaaS)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/email-verification": {
      "get": {
        "description": "No credentials needed.",
        "operationId": "getAuthEmailVerification",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyPending"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Is a sign-in waiting for an email verification code? (SaaS)",
        "tags": [
          "Sign-in"
        ]
      },
      "post": {
        "description": "No credentials needed.",
        "operationId": "postAuthEmailVerification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifiedSignIn"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Finish a sign-in with the emailed verification code (SaaS)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/invites/{token}": {
      "get": {
        "description": "No credentials needed.",
        "operationId": "getAuthInvitesToken",
        "parameters": [
          {
            "description": "The secret token from an invite or password-reset link.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invite"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Look up an invite or password-reset link (self-hosted)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/invites/{token}:accept": {
      "post": {
        "description": "Creates the account (or sets the new password) and signs in.\n\nNo credentials needed.",
        "operationId": "postAuthInvitesTokenAccept",
        "parameters": [
          {
            "description": "The secret token from an invite or password-reset link.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Accept an invite or reset link (self-hosted)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/login": {
      "post": {
        "description": "Sets the session cookie. Rate-limited.\n\nNo credentials needed.",
        "operationId": "postAuthLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserEnvelope"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Sign in with email and password (self-hosted)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/logout": {
      "post": {
        "description": "No credentials needed.",
        "operationId": "postAuthLogout",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Sign out",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/session": {
      "get": {
        "description": "No credentials needed.",
        "operationId": "getAuthSession",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Who am I, and how does this server sign people in?",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/setup": {
      "post": {
        "description": "Only while no account exists. If the server has config-file API keys, `api_key` must be one of its admin keys. Signs you in.\n\nNo credentials needed.",
        "operationId": "postAuthSetup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserEnvelope"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [],
        "summary": "Create the first admin account (self-hosted)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/workos/callback": {
      "get": {
        "description": "Browser navigation from WorkOS. Redirects into the dashboard, to /login?verify=1 when email verification is needed, or to /login?error=… on failure.\n\nNo credentials needed.",
        "operationId": "getAuthWorkosCallback",
        "responses": {
          "302": {
            "description": "Redirects the browser (see description)."
          }
        },
        "security": [],
        "summary": "Where GitHub sign-in returns (SaaS)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/auth/workos/login": {
      "get": {
        "description": "Browser navigation: redirects to GitHub's consent screen.\n\nNo credentials needed.",
        "operationId": "getAuthWorkosLogin",
        "parameters": [
          {
            "description": "Sign-in provider.",
            "in": "query",
            "name": "provider",
            "schema": {
              "enum": [
                "github"
              ],
              "type": "string"
            }
          },
          {
            "description": "Dashboard path to return to afterwards.",
            "in": "query",
            "name": "next",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirects the browser (see description)."
          }
        },
        "security": [],
        "summary": "Start signing in with GitHub (SaaS)",
        "tags": [
          "Sign-in"
        ]
      }
    },
    "/v1/invites": {
      "get": {
        "description": "**Access:** manage — admin keys; admin users.",
        "operationId": "getInvites",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitesList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Pending invites",
        "tags": [
          "Team members"
        ]
      },
      "post": {
        "description": "Self-hosted: returns a single-use link to send. SaaS mode: WorkOS emails the invitation.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "postInvites",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteCreated"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Invite someone",
        "tags": [
          "Team members"
        ]
      }
    },
    "/v1/invites/{id}": {
      "delete": {
        "description": "**Access:** manage — admin keys; admin users.",
        "operationId": "deleteInvitesId",
        "parameters": [
          {
            "description": "Numeric ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Revoke an invite",
        "tags": [
          "Team members"
        ]
      }
    },
    "/v1/me": {
      "patch": {
        "description": "**Access:** a signed-in dashboard user (session cookie).",
        "operationId": "patchMe",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MePatchBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Change your name",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/me/password": {
      "post": {
        "description": "Signs you out on your other devices.\n\n**Access:** a signed-in dashboard user (session cookie).",
        "operationId": "postMePassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChangeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Change your password (self-hosted)",
        "tags": [
          "Account"
        ]
      }
    },
    "/v1/queues": {
      "get": {
        "description": "**Access:** list — admin keys; any dashboard user. (Writer keys can't list.)",
        "operationId": "getQueues",
        "parameters": [
          {
            "description": "Only names starting with this; `user/` lists a folder.",
            "in": "query",
            "name": "name_prefix",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Items per page.",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "`next_page_token` from the previous page.",
            "in": "query",
            "name": "page_token",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "List queues",
        "tags": [
          "Queues"
        ]
      },
      "post": {
        "description": "Fails with `already_exists` if the name is taken. Use PUT to create-or-update.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueues",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Create a queue",
        "tags": [
          "Queues"
        ]
      }
    },
    "/v1/queues/{queue}": {
      "delete": {
        "description": "**Access:** delete queues — admin keys; member or admin users.",
        "operationId": "deleteQueuesQueue",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Delete a queue and all its tasks",
        "tags": [
          "Queues"
        ]
      },
      "get": {
        "description": "**Access:** read — any role (writer/admin keys; viewer, member, admin users).",
        "operationId": "getQueuesQueue",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Get a queue",
        "tags": [
          "Queues"
        ]
      },
      "patch": {
        "description": "Only the fields you send change. Can also set `state` (including `disabled`).\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "patchQueuesQueue",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueuePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Update some of a queue's settings",
        "tags": [
          "Queues"
        ]
      },
      "put": {
        "description": "Idempotent; never changes the queue's run state. Answers 201 when created, 200 otherwise, with `X-Pushq-Result: created | updated | unchanged`. Omit `target.signing_secret` to keep the stored one; send `\"\"` to clear it.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "putQueuesQueue",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueuePut"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Create or replace a queue's configuration",
        "tags": [
          "Queues"
        ]
      }
    },
    "/v1/queues/{queue}/stats": {
      "get": {
        "description": "**Access:** read — any role (writer/admin keys; viewer, member, admin users).",
        "operationId": "getQueuesQueueStats",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only tasks whose ID starts with this.",
            "in": "query",
            "name": "id_prefix",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueStatsResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Live queue statistics",
        "tags": [
          "Queues"
        ]
      }
    },
    "/v1/queues/{queue}/tasks": {
      "get": {
        "description": "**Access:** read — any role (writer/admin keys; viewer, member, admin users).",
        "operationId": "getQueuesQueueTasks",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only tasks in this state.",
            "in": "query",
            "name": "state",
            "schema": {
              "enum": [
                "pending",
                "running",
                "succeeded",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only IDs starting with this.",
            "in": "query",
            "name": "id_prefix",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`full` includes headers and body.",
            "in": "query",
            "name": "view",
            "schema": {
              "enum": [
                "basic",
                "full"
              ],
              "type": "string"
            }
          },
          {
            "description": "Items per page.",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "`next_page_token` from the previous page.",
            "in": "query",
            "name": "page_token",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "List tasks (newest first)",
        "tags": [
          "Tasks"
        ]
      },
      "post": {
        "description": "Set exactly one of `url` or `path` (resolved against the queue's `target.base_url`). A `task_id` deduplicates: reusing one within the dedup window fails with `already_exists`.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueuesQueueTasks",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Enqueue a task",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/queues/{queue}/tasks/{taskID}": {
      "delete": {
        "description": "The ID stays reserved for the dedup window.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "deleteQueuesQueueTasksTaskID",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Task ID.",
            "in": "path",
            "name": "taskID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Delete a task",
        "tags": [
          "Tasks"
        ]
      },
      "get": {
        "description": "**Access:** read — any role (writer/admin keys; viewer, member, admin users).",
        "operationId": "getQueuesQueueTasksTaskID",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Task ID.",
            "in": "path",
            "name": "taskID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`full` includes headers and body.",
            "in": "query",
            "name": "view",
            "schema": {
              "enum": [
                "basic",
                "full"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Get a task",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/queues/{queue}/tasks/{taskID}/attempts": {
      "get": {
        "description": "**Access:** read — any role (writer/admin keys; viewer, member, admin users).",
        "operationId": "getQueuesQueueTasksTaskIDAttempts",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Task ID.",
            "in": "path",
            "name": "taskID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttemptList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "A task's delivery attempts (newest first)",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/queues/{queue}/tasks/{taskID}:run": {
      "post": {
        "description": "Bypasses rate limits and the paused state.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueuesQueueTasksTaskIDRun",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Task ID.",
            "in": "path",
            "name": "taskID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Dispatch a task now",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/queues/{queue}/tasks:batch": {
      "post": {
        "description": "Not atomic: each item succeeds or fails on its own; results are in request order.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueuesQueueTasksBatch",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskBatchCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Enqueue up to 500 tasks",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/v1/queues/{queue}:pause": {
      "post": {
        "description": "Tasks are still accepted; nothing is delivered until resumed.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueuesQueuePause",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Pause dispatching",
        "tags": [
          "Queues"
        ]
      }
    },
    "/v1/queues/{queue}:purge": {
      "post": {
        "description": "In-flight results are discarded and task IDs become reusable. Tasks created after the purge are unaffected.\n\n**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueuesQueuePurge",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Delete every task created up to now",
        "tags": [
          "Queues"
        ]
      }
    },
    "/v1/queues/{queue}:resume": {
      "post": {
        "description": "**Access:** write — writer/admin keys; member or admin users.",
        "operationId": "postQueuesQueueResume",
        "parameters": [
          {
            "description": "Queue name, URL-encoded as one segment (user/instagram → user%2Finstagram).",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Resume dispatching",
        "tags": [
          "Queues"
        ]
      }
    },
    "/v1/teams": {
      "get": {
        "description": "**Access:** a signed-in dashboard user (session cookie).",
        "operationId": "getTeams",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamsList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Your teams",
        "tags": [
          "Teams"
        ]
      },
      "post": {
        "description": "Creates a WorkOS Organization with you as admin and switches your session to it.\n\n**Access:** a signed-in dashboard user (session cookie).",
        "operationId": "postTeams",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamNameBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Create a team",
        "tags": [
          "Teams"
        ]
      }
    },
    "/v1/teams/current": {
      "patch": {
        "description": "**Access:** manage — admin keys; admin users.",
        "operationId": "patchTeamsCurrent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamNameBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Team"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Rename the current team",
        "tags": [
          "Teams"
        ]
      }
    },
    "/v1/teams/{id}:switch": {
      "post": {
        "description": "**Access:** a signed-in dashboard user (session cookie).",
        "operationId": "postTeamsIdSwitch",
        "parameters": [
          {
            "description": "Numeric ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Switch your session to another of your teams",
        "tags": [
          "Teams"
        ]
      }
    },
    "/v1/users": {
      "get": {
        "description": "SaaS mode: the current team's members, re-synced from WorkOS. `role` is the team role.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "getUsers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersList"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "List members",
        "tags": [
          "Team members"
        ]
      }
    },
    "/v1/users/{id}": {
      "delete": {
        "description": "They lose access immediately. The last admin can't be removed.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "deleteUsersId",
        "parameters": [
          {
            "description": "Numeric ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Remove a member",
        "tags": [
          "Team members"
        ]
      },
      "patch": {
        "description": "The last admin can't be demoted.\n\n**Access:** manage — admin keys; admin users.",
        "operationId": "patchUsersId",
        "parameters": [
          {
            "description": "Numeric ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPatchBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Change a member's role",
        "tags": [
          "Team members"
        ]
      }
    },
    "/v1/users/{id}/reset-link": {
      "post": {
        "description": "**Access:** manage — admin keys; admin users.",
        "operationId": "postUsersIdResetLink",
        "parameters": [
          {
            "description": "Numeric ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetLinkCreated"
                }
              }
            },
            "description": "Created"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Create a password-reset link (self-hosted)",
        "tags": [
          "Team members"
        ]
      }
    },
    "/v1/version": {
      "get": {
        "description": "**Access:** read — any role (writer/admin keys; viewer, member, admin users).",
        "operationId": "getVersion",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Client error (problem+json with a stable `code`)."
          },
          "5XX": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Server error."
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "session": []
          }
        ],
        "summary": "Server version",
        "tags": [
          "System"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Create, configure, pause and purge queues.",
      "name": "Queues"
    },
    {
      "description": "Enqueue, inspect, run and delete tasks.",
      "name": "Tasks"
    },
    {
      "description": "Dashboard sign-in. Self-hosted: local accounts. SaaS mode: email code or GitHub.",
      "name": "Sign-in"
    },
    {
      "description": "The signed-in user.",
      "name": "Account"
    },
    {
      "description": "SaaS mode: teams (WorkOS Organizations) and switching between them.",
      "name": "Teams"
    },
    {
      "description": "Members and invites of the current team (or the server, when self-hosted).",
      "name": "Team members"
    },
    {
      "description": "Keys for apps and scripts.",
      "name": "API keys"
    },
    {
      "description": "Health, readiness, metrics and these docs.",
      "name": "System"
    }
  ]
}