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

# Reorder the next-post queue

> Sets the order of the next_post targets waiting on one account. Send every target_id the queue returns, in the new order. If the queue changed since you read it, the request is refused with QUEUE_CHANGED.

Needs an API key with write access.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspaces/{workspace_id}/accounts/{channel}/{account_id}/next-post-queue/reorder
openapi: 3.1.0
info:
  title: Replier API
  version: '1'
servers:
  - url: https://api.usereplier.com
security:
  - apiKey: []
paths:
  /v1/workspaces/{workspace_id}/accounts/{channel}/{account_id}/next-post-queue/reorder:
    post:
      tags:
        - Accounts
      summary: Reorder the next-post queue
      description: >-
        Sets the order of the next_post targets waiting on one account. Send
        every target_id the queue returns, in the new order. If the queue
        changed since you read it, the request is refused with QUEUE_CHANGED.


        Needs an API key with write access.
      operationId: reorder_next_post_queue
      parameters:
        - name: workspace_id
          in: path
          required: true
          description: Workspace ID returned by `GET /v1/workspaces`
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: channel
          in: path
          required: true
          description: >-
            Channel returned with the account by `GET
            /v1/workspaces/{workspace_id}/accounts`
          schema:
            type: string
            enum:
              - instagram
              - facebook
        - name: account_id
          in: path
          required: true
          description: Account ID returned by `GET /v1/workspaces/{workspace_id}/accounts`
          schema:
            type: string
            minLength: 1
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Send the same key when you retry, and the request runs once. Without
            one, every request runs.
          schema:
            type: string
            minLength: 1
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                target_ids:
                  description: Every queued target_id, first in line first.
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - target_ids
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspace:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      name:
                        type: string
                      kind:
                        type: string
                        enum:
                          - personal
                          - agency
                      role:
                        type: string
                        enum:
                          - owner
                          - admin
                          - member
                    required:
                      - id
                      - name
                      - kind
                      - role
                  channel:
                    type: string
                    enum:
                      - instagram
                      - facebook
                  account_id:
                    type: string
                  queue:
                    description: next_post targets waiting on this account, in queue order.
                    type: array
                    items:
                      type: object
                      properties:
                        position:
                          description: >-
                            1 takes the next new post, 2 the one after, and so
                            on.
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        target_id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        automation_id:
                          description: Null when hidden.
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                        automation_name:
                          description: Null when hidden.
                          type:
                            - string
                            - 'null'
                        enabled:
                          description: >-
                            A paused automation keeps its place and still takes
                            its post. Null when hidden.
                          type:
                            - boolean
                            - 'null'
                        hidden:
                          description: >-
                            An automation on a channel you can't access holds
                            this place; it keeps it when you reorder.
                          type: boolean
                      required:
                        - position
                        - target_id
                        - automation_id
                        - automation_name
                        - enabled
                        - hidden
                required:
                  - workspace
                  - channel
                  - account_id
                  - queue
        default:
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: Refused
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: >-
                      Why the request was refused, such as AUTOMATION_NOT_FOUND
                      or VERSION_CONFLICT. Other fields beside it give details.
                  message:
                    type: string
                    description: The same reason, in English.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: A Replier API key (rpl_...).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.