---
title: "A page of supplier contacts, with the supplier each belongs to"
method: GET
path: "/api/v1/contacts/table"
tags: ["contacts"]
---

# A page of supplier contacts, with the supplier each belongs to

`GET /api/v1/contacts/table`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/contacts/table`
- Auth: HTTP bearer

A page of contacts across every supplier: name, email, phone, city, country, role, department, preferred contact method, the supplier each belongs to by id and name, and `is_primary_contact`. `filtered_max_size` is the size of the filtered set and `max_size` the size of the book.

Page with `limit` (1 to 10,000, default 10) and `offset` (0 to 2,147,483,647). Narrow with `filter_args`, a JSON array of `{key, operation, value, group}`, on `role`, `country`, `city`, `supplier_id` and `department` (eq, in), `preferred_contact_method` (eq) and `missing_fields` (eq, in). Order with `sort_args`, comma-separated, `-` for descending, over name, country, city, role, supplier_name, department, email and preferred_contact_method. `search` matches the name and the email.

`preferred_contact_method` is `email` or `phone` and is never null: a contact with neither recorded reads `email`. `supplier_id` and `supplier_name` are null for a contact attached to no supplier, a contact created against a wholesale account rather than a supplier is one such.

Ask get_contacts_filters for the values these filters can take rather than guessing them.

Scope: `suppliers:read`.

## Query parameters

- `limit` integer
- `offset` integer
- `filter_args` string
- `sort_args` string
- `search` string

## Headers

- `Tightly-Version` string

## Response `200`

One page of contacts, with the offset requested, the number of rows served, the size of the filtered set and the size of the whole book.

- GetContactsTableResponse
  - `data` union
    - ContactsTablePayload
      - `filtered_max_size` integer, required
      - `max_size` integer, required
      - `offset` integer, required
      - `rows` ContactPayload[], required
        - `city` string, nullable
        - `country` string, nullable
        - `department` string, nullable
        - `description` string, nullable
        - `email` string, nullable
        - `id` string, required
        - `is_primary_contact` boolean, nullable
        - `name` string, nullable
        - `phone` string, nullable
        - `preferred_contact_method` string, nullable
        - `role` string, nullable
        - `supplier_id` string, nullable
        - `supplier_name` string, nullable
      - `size` integer, required
    - object, nullable
  - `message` ContactsApiMessage
    - `desc` string
    - `service` string
    - `severity` 'SUCCESS' | 'INFO' | 'ERROR' | 'WARNING'

## Other responses

- `400`: A pagination bound, a filter key, an operation or a value is not one this table takes.
- `401`: No usable key: malformed, unknown, revoked, expired or stopped. One refusal covers all five, telling a caller which is which maps the surface for them. A request with no Authorization header at all is refused 400 before any key is looked for.
- `403`: The key may not reach this operation. `scope_missing` when the key does not hold Suppliers; `ip_not_allowed` when the caller's address is outside the key's allowlist. There is no `organization_mismatch` on this resource: no supplier or contact route names an organisation in its path, so there is nothing for a key to disagree with.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
