Peeve Contacts API
Everyone Peeve knows about: **users** your product identified, and anonymous **visitors**. Filter with `?kind=`.
Everyone Peeve knows about: **users** your product identified, and anonymous **visitors**. Filter with `?kind=`.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/peeve-ai:peeve-ai-contacts-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Peeve Contacts API
version: '2026-08-17'
description: 'The `/v1` API. Server-to-server only — no CORS headers are sent, no `Origin` is checked, and publishable keys are rejected everywhere.
Most endpoints take a **API token** (`pv_ut_…`), which carries its owner''s live workspace role. `/v1/users` and `/v1/answer` take the **workspace secret key** (`sk_…`). The credential and the required role are stated on every operation — they are not uniform.'
servers:
- url: https://api.peeve.ai
security:
- userToken: []
tags:
- name: Contacts
description: 'Everyone Peeve knows about: **users** your product identified, and anonymous **visitors**. Filter with `?kind=`.'
paths:
/v1/contacts:
get:
operationId: listContacts
summary: List contacts
tags:
- Contacts
description: 'The people Peeve knows about — signed-in users and anonymous visitors.
**Credential:** API token · **Role:** any (`read`)'
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/cursor'
- name: sort
in: query
schema:
type: string
enum:
- created_at
- updated_at
default: created_at
- $ref: '#/components/parameters/order'
- $ref: '#/components/parameters/created_after'
- $ref: '#/components/parameters/created_before'
- name: kind
in: query
schema:
type: string
enum:
- user
- visitor
- name: email
in: query
schema:
type: string
maxLength: 320
description: Exact lookup, resolved through the encrypted-email index. Never written to the audit log.
- name: external_user_id
in: query
schema:
type: string
maxLength: 300
description: Your own id for the user. Never written to the audit log.
responses:
'200':
description: A page of contacts.
content:
application/json:
schema:
$ref: '#/components/schemas/ContactList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
x-mint:
metadata:
description: 'List contacts: the people Peeve knows about, both signed-in users and anonymous visitors. Credential: API token · Role: any (read).'
/v1/contacts/{id}:
get:
operationId: getContact
summary: Get a contact
tags:
- Contacts
description: 'One contact by **Peeve''s contact id** (a UUID), not your `external_user_id`.
**Credential:** API token · **Role:** any (`read`)
Searching by your own id instead: `GET /v1/contacts?external_user_id=…`.'
parameters:
- $ref: '#/components/parameters/contactId'
responses:
'200':
description: The contact.
content:
application/json:
schema:
$ref: '#/components/schemas/ContactObject'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
x-mint:
metadata:
description: Get one contact by Peeve's contact ID, a UUID, not your external_user_id. To look a contact up by your own ID, use GET /v1/contacts?external_user_id=.
/v1/contacts/{id}/token:
patch:
operationId: updateContactToken
summary: Set or revoke a contact's vendor token
tags:
- Contacts
description: 'Rotate or revoke the vendor token Peeve holds for one contact.
**Credential:** API token · **Role:** owner or admin (`grant`)
> **Note**
>
> **`{id}` is Peeve''s contact id — a UUID — not your `external_user_id`.** It is the `id` field on a contact. If you only have your own id, resolve it first with `GET /v1/contacts?external_user_id=…` and read `data[0].id`. Passing an external id returns `400 invalid_id`.
The vendor token is that end user''s credential for **your** API — what the server SDK''s `identify({ token })` supplies, and what Peeve presents when it acts on that user''s account.
This is the narrow operation: one contact, one credential. The alternative is re-pushing the whole user through `POST /v1/users`, which needs the external id and rewrites every identity field as a side effect.
It sits on `grant` — the same capability the contact page requires to issue or revoke a contact''s access, and the same one `POST /v1/users` requires. Writing an end user''s credential is one act, so it answers to one gate whichever door it comes through.
> **Warning**
>
> **The token is never returned** — not on success, not in an error, not in the audit line. The response carries only the resulting status.'
parameters:
- $ref: '#/components/parameters/contactId'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
vendor_token:
type:
- string
- 'null'
description: The token to store, encrypted at rest. `null` revokes.
examples:
set:
summary: Store a new token
value:
vendor_token: REPLACE_WITH_YOUR_USER_TOKEN
revoke:
summary: Revoke
value:
vendor_token: null
responses:
'200':
description: The resulting vendor-token state. Never the token itself.
content:
application/json:
schema:
$ref: '#/components/schemas/VendorTokenObject'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
x-mint:
metadata:
description: Set or revoke the vendor token Peeve holds for one contact, that user's credential for your API. Use Peeve's contact UUID, not your external_user_id.
components:
responses:
RateLimited:
description: Over the per-credential ceiling. Carries `Retry-After`. All `/v1` endpoints share one bucket per credential.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
type: rate_limit_error
code: rate_limit_exceeded
message: Too many requests (key limit). Retry in 60s.
request_id: req_xxx
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait.
Unauthorized:
description: 'Missing, invalid or revoked credential — or the wrong **kind** of credential.
Note the API''s own wording: the code is `user_token_required` and the message says "user token". That is the same thing the dashboard calls an **API token** (`pv_ut_…`), under Settings → API keys.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
wrongKind:
summary: A secret key on a user-token endpoint
value:
error:
type: authentication_error
code: user_token_required
message: This endpoint requires a user token (pv_ut_…), not a workspace secret key. A shared key cannot express a person's role, so it cannot be used to read workspace data or change configuration. Create your own token in Settings → API keys.
request_id: req_xxx
publishable:
summary: A publishable key
value:
error:
type: authentication_error
code: publishable_key_not_allowed
message: Publishable keys (pk_…) are public by construction and can never read or write workspace data.
request_id: req_xxx
invalid:
summary: Revoked, unknown, or the owner left the workspace
value:
error:
type: authentication_error
code: invalid_credential
message: That credential is not valid, has been revoked, or its owner is no longer a member of this workspace.
request_id: req_xxx
NotFound:
description: No such record **in this workspace**. Identical whether the id belongs to another tenant or does not exist — a distinguishable response would be an existence oracle.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
type: not_found_error
code: resource_not_found
message: No lead with id '00000000-0000-4000-8000-000000000000' in this workspace.
param: id
request_id: req_xxx
Forbidden:
description: The credential is valid but its **role** is insufficient. The message names the role it resolved to and the capability it lacked.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
type: invalid_request_error
code: insufficient_role
message: This credential acts as 'viewer', which cannot change workspace settings (owner or admin). An API token carries its owner's workspace role, so this needs a teammate whose role holds 'manage_team'.
request_id: req_xxx
BadRequest:
description: An unknown or duplicated parameter, a bad value, a backwards date window, or a rejected unknown body key. The `param` field names the offender.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
type: invalid_request_error
code: unknown_parameter
message: 'Unknown query parameter ''since''. This endpoint accepts: created_after, created_before, cursor, limit, order, sort.'
param: since
request_id: req_xxx
schemas:
ContactList:
allOf:
- $ref: '#/components/schemas/ListEnvelope'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Contact'
ContactObject:
allOf:
- $ref: '#/components/schemas/ObjectEnvelope'
- type: object
properties:
data:
$ref: '#/components/schemas/Contact'
Contact:
type: object
properties:
id:
type: string
format: uuid
object:
type: string
const: contact
external_user_id:
type:
- string
- 'null'
kind:
type: string
enum:
- user
- visitor
email:
type:
- string
- 'null'
description: Decrypted for this response. Encrypted at rest.
name:
type:
- string
- 'null'
company:
type:
- string
- 'null'
phone:
type:
- string
- 'null'
plan:
type:
- string
- 'null'
description: The user's plan in *your* product. A display name.
account_created_at:
type:
- string
- 'null'
format: date-time
converted_at:
type:
- string
- 'null'
format: date-time
last_seen_at:
type:
- string
- 'null'
format: date-time
country:
type:
- string
- 'null'
region:
type:
- string
- 'null'
city:
type:
- string
- 'null'
vendor_token_status:
type:
- string
- 'null'
vendor_token_set_at:
type:
- string
- 'null'
format: date-time
mcp_url:
type:
- string
- 'null'
description: This contact's per-user MCP endpoint. Present **only** when the contact has a usable vendor token.
mcp_unavailable_reason:
type:
- string
- 'null'
description: Why `mcp_url` is absent.
last_verified_at:
type:
- string
- 'null'
format: date-time
revoked_at:
type:
- string
- 'null'
format: date-time
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
ListEnvelope:
type: object
required:
- object
- data
- has_more
- next_cursor
- request_id
properties:
object:
type: string
const: list
data:
type: array
items:
type: object
additionalProperties: true
has_more:
type: boolean
description: Always present, so a paging loop never branches.
next_cursor:
type:
- string
- 'null'
description: Pass as `cursor` for the next page. `null` on the last page.
request_id:
type: string
ObjectEnvelope:
type: object
required:
- object
- data
- request_id
properties:
object:
type: string
description: The resource type, e.g. `lead`.
data:
type: object
additionalProperties: true
request_id:
type: string
description: Echoed in the `X-Request-Id` header. Quote it to support.
VendorTokenObject:
allOf:
- $ref: '#/components/schemas/ObjectEnvelope'
- type: object
properties:
data:
type: object
properties:
object:
type: string
const: vendor_token
status:
type:
- string
- 'null'
set_at:
type:
- string
- 'null'
format: date-time
revoked_at:
type:
- string
- 'null'
format: date-time
ErrorEnvelope:
type: object
required:
- error
- request_id
properties:
error:
type: object
required:
- type
- code
- message
properties:
type:
type: string
enum:
- authentication_error
- invalid_request_error
- not_found_error
- rate_limit_error
- api_error
description: The coarse family. Branch on this.
code:
type: string
description: The stable machine label.
message:
type: string
param:
type: string
description: The offending query parameter or dotted body path.
request_id:
type: string
parameters:
order:
name: order
in: query
schema:
type: string
enum:
- asc
- desc
default: desc
cursor:
name: cursor
in: query
schema:
type: string
description: An opaque `next_cursor` from a previous page. Do not parse or construct it. Reusing a cursor under a different `sort`/`order` is rejected.
limit:
name: limit
in: query
schema:
type: integer
default: 50
maximum: 200
minimum: 1
description: Page size. Over 200 is a `400`, not a silent clamp.
created_before:
name: created_before
in: query
schema:
type: string
format: date-time
contactId:
name: id
in: path
required: true
schema:
type: string
format: uuid
description: '**Peeve''s id for the contact** — the `id` field on a contact object, a UUID. The code calls it the end-user id.
This is **not** your own `external_user_id`. Passing one returns `400 invalid_id`. To go from your id to this one, look the contact up first: `GET /v1/contacts?external_user_id=user_8412` and read `data[0].id`.'
created_after:
name: created_after
in: query
schema:
type: string
format: date-time
securitySchemes:
userToken:
type: http
scheme: bearer
description: 'An API token (`pv_ut_…`) as `Authorization: Bearer pv_ut_…`. `X-Peeve-Key` is accepted too. **Never a query parameter** — URLs end up in proxy logs and `Referer` headers.
The token carries its owner''s **live** workspace role, re-read on every call.'
secretKey:
type: http
scheme: bearer
description: 'The workspace secret key (`sk_…`) as `Authorization: Bearer sk_…`. `X-Peeve-Key` is accepted too.'