> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superx.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Update queue settings

> Changes the account's posting schedule. Send `slots`, `timezone`, or both; only what you send changes. `slots` is a FULL REPLACE (max 50 entries, one per unique time, each with at least one weekday, 0 = Sunday); `[]` clears every predefined slot and leaves the queue all-custom.

Changing `slots` also RE-FLOWS the queue the way the app does: a queued post sitting exactly on an occurrence of an old slot moves to the matching new occurrence (Nth old to Nth new), so deliberate gaps are preserved and hand-picked custom times stay put. Scheduled X Articles and chained quote posts never move. Changing only `timezone` never moves posts.

`reflow.bailed: true` means the settings were saved but the queue was deliberately left untouched (a post had nowhere to land, or the move set was too large); the response then carries a `note`. Retrying the same request is safe and idempotent.

Changing the timezone and the slots in one call usually moves nothing, because the existing posts were placed under the old timezone; to re-flow them, change the timezone first, then send the slots in a second call.

This is a per-account write: pass `account_id` for any linked or shared account. Editor-permission shares CAN change queue settings.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /v1/queue-settings
openapi: 3.1.0
info:
  title: SuperX API
  version: 1.0.0
  description: >
    The SuperX public API: your Twitter/X content, analytics, audience and

    scheduling data over REST.


    All endpoints require an API key (`Authorization: Bearer sxk_...`) except

    `GET /v1/docs`. Keys are created in the SuperX app under Account > API / MCP
    / CLI

    and are server-side secrets.


    Timestamps are UTC ISO-8601 in both directions; inputs must carry an
    explicit

    `Z` or numeric offset. Every authenticated response carries

    `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`
    headers.
  contact:
    name: SuperX
    url: https://superx.so
servers:
  - url: https://api.superx.so
security:
  - apiKey: []
tags:
  - name: Identity
  - name: Content
  - name: Analytics
  - name: Inspiration
  - name: Audience
  - name: Contact Lists
  - name: Signals
  - name: Media
  - name: Scheduling
  - name: Tags
  - name: Context
  - name: Queue
  - name: Articles
  - name: Meta
paths:
  /v1/queue-settings:
    patch:
      tags:
        - Queue
      summary: Update queue settings
      description: >-
        Changes the account's posting schedule. Send `slots`, `timezone`, or
        both; only what you send changes. `slots` is a FULL REPLACE (max 50
        entries, one per unique time, each with at least one weekday, 0 =
        Sunday); `[]` clears every predefined slot and leaves the queue
        all-custom.


        Changing `slots` also RE-FLOWS the queue the way the app does: a queued
        post sitting exactly on an occurrence of an old slot moves to the
        matching new occurrence (Nth old to Nth new), so deliberate gaps are
        preserved and hand-picked custom times stay put. Scheduled X Articles
        and chained quote posts never move. Changing only `timezone` never moves
        posts.


        `reflow.bailed: true` means the settings were saved but the queue was
        deliberately left untouched (a post had nowhere to land, or the move set
        was too large); the response then carries a `note`. Retrying the same
        request is safe and idempotent.


        Changing the timezone and the slots in one call usually moves nothing,
        because the existing posts were placed under the old timezone; to
        re-flow them, change the timezone first, then send the slots in a second
        call.


        This is a per-account write: pass `account_id` for any linked or shared
        account. Editor-permission shares CAN change queue settings.
      operationId: updateQueueSettings
      parameters:
        - $ref: '#/components/parameters/AccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                slots:
                  type: array
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/QueueSlot'
                  description: >-
                    Full replace of the predefined posting slots. `[]` clears
                    them all.
                timezone:
                  type: string
                  maxLength: 64
                  description: >-
                    IANA timezone name the slot times run in, for example
                    `Europe/London`.
                account_id:
                  type: string
            example:
              slots:
                - time: '09:00'
                  days:
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                - time: '17:30'
                  days:
                    - 1
                    - 3
                    - 5
              timezone: Europe/London
      responses:
        '200':
          description: The updated settings plus what the reflow did.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/QueueSettings'
                  reflow:
                    $ref: '#/components/schemas/ReflowSummary'
                  note:
                    type: string
                    description: Present only when `reflow.bailed` is true.
              example:
                data:
                  timezone: Europe/London
                  timezone_is_default: false
                  slots:
                    - time: '09:00'
                      days:
                        - 1
                        - 2
                        - 3
                        - 4
                        - 5
                    - time: '17:30'
                      days:
                        - 1
                        - 3
                        - 5
                  slots_are_default: false
                  slot_count: 8
                reflow:
                  moved: 3
                  skipped: 0
                  bailed: false
        '400':
          $ref: '#/components/responses/InvalidParameter'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/QueueWriteForbidden'
        '404':
          $ref: '#/components/responses/AccountNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/UpstreamUnavailable'
components:
  parameters:
    AccountId:
      name: account_id
      in: query
      required: false
      description: >-
        Account to act on, from `GET /v1/accounts`. Defaults to your main
        account. An id outside your accounts returns `404 account_not_found`.
      schema:
        type: string
  schemas:
    QueueSlot:
      type: object
      required:
        - time
        - days
      properties:
        time:
          type: string
          pattern: ^([01][0-9]|2[0-3]):[0-5][0-9]$
          description: 24-hour local time in the account's queue timezone, `HH:MM`.
          example: '09:00'
        days:
          type: array
          minItems: 1
          items:
            type: integer
            minimum: 0
            maximum: 6
          description: >-
            Weekdays this slot runs on, 0 = Sunday. Sorted ascending on read;
            duplicates are deduped on write.
          example:
            - 1
            - 3
            - 5
    QueueSettings:
      type: object
      properties:
        timezone:
          type: string
          description: IANA timezone the slot times run in.
        timezone_is_default:
          type: boolean
          description: >-
            True when the account has never set a timezone and SuperX is using
            its default (UTC).
        slots:
          type: array
          items:
            $ref: '#/components/schemas/QueueSlot'
          description: The predefined posting slots, sorted by time.
        slots_are_default:
          type: boolean
          description: >-
            True when the account has never set a schedule and SuperX is using
            its default slots. A stored empty list is explicit and reports
            false.
        slot_count:
          type: integer
          description: Total number of time and day pairs across all slots.
    ReflowSummary:
      type: object
      description: What changing the slots did to the already-queued posts.
      properties:
        moved:
          type: integer
          description: Queued posts retimed onto the new slots.
        skipped:
          type: integer
          description: >-
            Posts that published or were deleted while the reflow ran; nothing
            was lost.
        bailed:
          type: boolean
          description: >-
            True when the settings were saved but the queue was deliberately
            left untouched (a post had nowhere to land, or the move set was too
            large). Retrying the same request is safe.
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
            message:
              type: string
            retry_after:
              type: integer
              description: Seconds to wait before retrying (rate-limit errors only).
    LegacyErrorEnvelope:
      type: object
      required:
        - error
      description: |
        Legacy shape used ONLY by the shared subscription middleware: a plain
        string `error` field. Seen on `403` when the subscription has lapsed
        (string starts with "subscription_required:") and on `500` when
        subscription verification fails (string starts with "internal_error:").
      properties:
        error:
          type: string
          example: >-
            subscription_required: The SuperX API requires an active
            subscription
  headers:
    X-RateLimit-Limit:
      description: The limit of the rate window closest to exhaustion.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in that window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp (seconds) when that window resets.
      schema:
        type: integer
  responses:
    InvalidParameter:
      description: A parameter is missing, malformed, or out of range.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_parameter
              message: since must be a UTC ISO-8601 timestamp
    Unauthorized:
      description: >-
        Missing/malformed Authorization header (`unauthorized`) or an
        unknown/revoked key (`invalid_api_key`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_api_key
              message: Unknown or revoked API key
    QueueWriteForbidden:
      description: >-
        Read-only key (`insufficient_scope`) or a lapsed subscription (legacy
        string envelope). Queue settings are a per-account write that any linked
        or shared account can use, Editor-permission shares included, so
        `writes_main_account_only` and `editor_restricted` never apply here.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/LegacyErrorEnvelope'
          example:
            error:
              code: insufficient_scope
              message: >-
                This API key is read-only. Create a key with the write scope to
                use this endpoint.
    AccountNotFound:
      description: account_id is not one of your accounts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: account_not_found
              message: No account with that id belongs to this key
    RateLimited:
      description: Rate limit exceeded (limits vary by plan). Honor Retry-After.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: rate_limited
              message: >-
                Rate limit exceeded for the Pro plan (30 requests/min). Upgrade
                for higher limits.
              retry_after: 42
    InternalError:
      description: >-
        Unexpected server error. May also use the legacy string envelope when
        subscription verification fails.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/LegacyErrorEnvelope'
          example:
            error:
              code: internal_error
              message: Failed to fetch posts
    UpstreamError:
      description: A dependent SuperX service returned an unexpected response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: upstream_error
              message: Failed to fetch scheduled posts. Try again shortly.
    UpstreamUnavailable:
      description: >-
        The scheduling service is temporarily unreachable. Safe to retry; reuse
        your Idempotency-Key on POST.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: upstream_unavailable
              message: >-
                The scheduling service is temporarily unavailable. Retry with
                the same Idempotency-Key.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A SuperX API key ("sxk_..."), created in the SuperX app under Account >
        API / MCP / CLI. Keys are server-side secrets.

````