> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# get_next_member

> Retrieve the next member in the queue.

Retrieve the next member in the queue (the member at the front).

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/relay/rest/queues/{queue_id}/members/next:
    get:
      operationId: retrieve_next_queue_member
      summary: Get next queue member
      description: >-
        Retrieves the next member in the queue without dequeuing.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Voice_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_queueMembers
      parameters:
        - name: queue_id
          in: path
          description: Unique ID of the queue.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueueMemberResponse'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    QueueMemberResponse:
      type: object
      properties:
        call_id:
          $ref: '#/components/schemas/uuid'
          description: The call ID of the queue member.
        project_id:
          type: string
          description: The ID of the project associated with this queue member.
        queue_id:
          type: string
          description: The ID of the queue associated with this queue member.
        position:
          type: integer
          description: Queue member position in the queue.
        uri:
          type: string
          description: The URL of this queue member.
        wait_time:
          type: integer
          description: >-
            Wait time in seconds since the member was enqueued. If not yet
            enqueued, it will be null.
        date_enqueued:
          type: string
          format: date-time
          description: When the queue member was last enqueued.
      required:
        - call_id
        - project_id
        - queue_id
        - position
        - uri
      description: Response containing a single queue member.
      title: QueueMemberResponse
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    TypesStatusCodesStatusCode404Error:
      type: string
      enum:
        - Not Found
      title: TypesStatusCodesStatusCode404Error
    Types.StatusCodes.StatusCode404:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode404Error'
      required:
        - error
      description: The server cannot find the requested resource.
      title: Types.StatusCodes.StatusCode404
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "call_id": "596e2dea-a269-4765-a0b4-01b82d11c120",
  "project_id": "d421473b-d696-449a-a1a1-4ddd83d2d0e5",
  "queue_id": "596e2dea-a269-4765-a0b4-01b82d11c120",
  "position": 2,
  "uri": "/api/relay/rest/queues/596e2dea-a269-4765-a0b4-01b82d11c120/members/596e2dea-a269-4765-a0b4-01b82d11c120",
  "wait_time": 172975,
  "date_enqueued": "2024-01-15T09:30:00Z"
}
```

## **Example**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

next_member = client.queues.get_next_member("queue-id")
print("Next caller:", next_member.get("call_id"))
```