---
title: "List peers"
method: POST
path: "/api/ab/peers"
tags: ["address book"]
---

# List peers

`POST /api/ab/peers`

This function is an API endpoint that lists the peers in an address book. It is tagged with "address book" for OpenAPI documentation.

## Parameters

- `current`: The current page number for pagination. This parameter is currently unused.

- `pageSize`: The number of items per page for pagination. This parameter is currently unused.

- `ab`: The identifier of the address book.

## Returns

If successful, this function returns a `Json<AbPeersResponse>` object containing the peers in the address book.  <br> If the address book does not exist or the user is not authorized to access it, this function returns a `status::Unauthorized` error.  <br>

## Errors

This function will return an error if the system is in maintenance mode, or if the address book does not exist or the user is not authorized to access it.

## Query parameters

- `current` integer, required
- `pageSize` integer, required
- `ab` string, required

## Response `200`

- AbPeersResponse
  - `error` string, nullable
  - `total` integer, required
  - `data` AbPeer[], required
    - `id` string, required
    - `hash` string, nullable
    - `password` string, nullable
    - `username` string, nullable
    - `hostname` string, nullable
    - `platform` string, nullable
    - `alias` string, nullable
    - `tags` string[], nullable
    - `forceAlwaysRelay` boolean, nullable
    - `rdpPort` string, nullable
    - `rdpUsername` string, nullable
    - `loginName` string, nullable
    - `same_server` boolean, nullable

## Other responses

- `401`

## Changes

- **2024-05-31** `12b1b72bc3f3` — 2 breaking, 2 warning
  - for the `query` request parameter `current`, the type/format was changed from `integer`/`int32` to `integer`/`uint32`
  - for the `query` request parameter `pageSize`, the type/format was changed from `integer`/`int32` to `integer`/`uint32`
  - for the `query` request parameter `current`, the min was set to `0.00`
  - for the `query` request parameter `pageSize`, the min was set to `0.00`
- **2024-05-19** `fafd43b82c78` — 2 breaking
  - for the `query` request parameter `current`, the type/format was changed from `integer`/`uint32` to `integer`/`int32`
  - for the `query` request parameter `pageSize`, the type/format was changed from `integer`/`uint32` to `integer`/`int32`

[Change history](https://skmtc.dev/nesaku/apis/sctgdesk-api-server/changes/api/ab/peers/post.md)

---

[API](https://skmtc.dev/nesaku/apis/sctgdesk-api-server.md) · [All operations](https://skmtc.dev/nesaku/apis/sctgdesk-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nesaku/sctgdesk-api-server/revisions/b1c0e7a4434f/schema)
