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

# Finding people

> Search people on the platforms and message or invite them

`GET /people` searches people on each platform as one of your account links, like the platform's own search box. It finds people your team has never talked to. Needs the Advanced API add-on.

> [!NOTE]
>
> To find people your team already has a record of, use [`GET
>     /contacts`](https://docs.inboxapp.com/v2/guides/contacts.md#find-a-contact). It never calls the platform.

## Search

```bash Every platform theme={null}
curl "https://inboxapp.com/api/v2/people?q=sarah%20chen" \
  -H "Authorization: Bearer $INBOXAPP_API_TOKEN"
```

```bash One platform theme={null}
curl "https://inboxapp.com/api/v2/people?q=sarah%20chen&platform=linkedin" \
  -H "Authorization: Bearer $INBOXAPP_API_TOKEN"
```

```bash From an account link theme={null}
curl "https://inboxapp.com/api/v2/people?q=sarah%20chen&accountLinkId=df6jbw4h36qm5d9iu2sgn7kx" \
  -H "Authorization: Bearer $INBOXAPP_API_TOKEN"
```

```json theme={null}
{
  "data": [
    {
      "accountLinkId": "df6jbw4h36qm5d9iu2sgn7kx",
      "profile": {
        "id": null,
        "platform": "linkedin",
        "platformId": "urn:li:member:123456789",
        "username": null,
        "handle": "",
        "displayName": "Sarah Chen",
        "avatarUrl": "https://media.licdn.com/dms/image/sarah.jpg",
        "verified": false,
        "isOrganization": false,
        "profileUrl": null,
        "platformData": {
          "_tag": "linkedin",
          "profileUrn": "urn:li:fsd_profile:ACoAABcdEfGh1234567890",
          "kind": "member"
        }
      },
      "contactId": null,
      "threadId": null,
      "canMessage": null,
      "degree": "second",
      "closeness": "near",
      "target": {
        "type": "profile",
        "accountLinkId": "df6jbw4h36qm5d9iu2sgn7kx",
        "platform": "linkedin",
        "username": "ACoAABcdEfGh1234567890"
      }
    }
  ],
  "failures": []
}
```

| Parameter | Notes |
| - | - |
| `q` | Required. A name or username, up to 100 characters |
| `platform` | Repeatable. Searches only these platforms. With `accountLinkId`, keeps the account links on these platforms |
| `accountLinkId` | Repeatable. Searches from these account links. Each platform is searched once, from the oldest one given on it |
| `reach` | `contacts` (default) searches people each account already messages. `network` searches beyond them |
| `enrich` | `true` stores every result and returns full profiles. Slower |

* Without `accountLinkId`, each platform is searched from its oldest active account link that can search (`directory:typeahead`), preferring one that can send messages (`message:send`).
* An `accountLinkId` that matches no account link is ignored.
* Results from every platform come back as one list: closest name or username match first, then people the account already talks to or is connected with, then verified accounts. Not paginated.
* `threadId`, `canMessage`, `degree`, `closeness` and `target` are from the point of view of the result's `accountLinkId`.
* `canMessage` is the platform's hint, or `null` when the platform doesn't say, as on LinkedIn. A send can still fail with `recipientUnavailable`.

## Message or invite a result

Pass the result's `target` unchanged to [`POST /messages`](https://docs.inboxapp.com/v2/guides/messages#send-a-message) or `POST /connection-requests`. It sends from the account link that found the person.

```typescript reach.ts theme={null}
import { randomUUID } from "node:crypto";

const API = "https://inboxapp.com/api/v2";
const headers = {
  Authorization: `Bearer ${process.env.INBOXAPP_API_TOKEN}`,
  "Content-Type": "application/json",
};

async function messageFirstMatch(query: string, content: string) {
  const search = await fetch(`${API}/people?q=${encodeURIComponent(query)}`, {
    headers,
  });
  const { data } = await search.json();
  const [person] = data;

  if (!person) throw new Error(`No one matches "${query}"`);

  const response = await fetch(`${API}/messages`, {
    method: "POST",
    headers: { ...headers, "Idempotency-Key": randomUUID() },
    body: JSON.stringify({ target: person.target, content }),
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(`${error.code}: ${error.message} (${error.requestId})`);
  }

  return response.json();
}
```

Sending to someone who isn't one of your contacts yet creates their contact.

> [!NOTE]
>
> On LinkedIn, `target.username` can be an `ACoA…` profile ID rather than the
> vanity name. Both work as a `username`.

## Stored and new profiles

| `profile.id` | What it is |
| - | - |
| An ID | A profile Inboxapp stores, with every [profile field](https://docs.inboxapp.com/v2/guides/contacts.md#profile-fields) |
| `null` | A profile Inboxapp hasn't stored yet. Only the fields that identify it: name, username, avatar, badge |

With `enrich=true`, every result is stored first and comes back with an ID. A result that can't be fetched or stored is left out. It is slower, so leave it off for search-as-you-type.

## Failures

Each platform is searched separately. When one account link's search fails, the others still return, and `failures` lists it:

```json theme={null}
{
  "data": [],
  "failures": [
    {
      "accountLinkId": "df6jbw4h36qm5d9iu2sgn7kx",
      "code": "accountLinkDisconnected",
      "message": "The account link is disconnected."
    }
  ]
}
```

`code` is the error searching from that account link alone returns. See [Errors](https://docs.inboxapp.com/v2/reference/errors.md). A search that takes longer than 4 seconds is `platformUnavailable`. When every account link fails, the request fails with the first one's error.

## Limits

Each search runs on the platform as your account, so it counts against the account link's [platform call limit](https://docs.inboxapp.com/v2/reference/rate-limits.md#platform-calls): 20 per minute, 300 per hour and 1,500 per day. An account link past its limit is listed in `failures` with `platformRateLimited`.

## Errors

| Code | When |
| - | - |
| `planRequired` | The team doesn't have the Advanced API add-on |
| `platformNotAvailable` | `platform` names a platform your team can't use |
| `platformRateLimited` | Every account link searched is rate limited |
| `capabilityNotSupported` | The only account link searched can't search people |
| `accountLinkDisconnected` | The only account link searched needs to be reconnected |


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