Contacts
Create and manage Contacts through the Resend API.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /contacts | Retrieve a list of contacts |
POST | /contacts | Create a new contact |
GET | /contacts/imports | Retrieve a list of contact imports |
POST | /contacts/imports | Create a contact import |
GET | /contacts/imports/{id} | Retrieve a single contact import |
GET | /contacts/{id} | Retrieve a single contact by ID or email |
PATCH | /contacts/{id} | Update a single contact by ID or email |
DELETE | /contacts/{id} | Remove an existing contact by ID or email |
GET | /contacts/{contact_id}/segments | Retrieve a list of segments for a contact |
POST | /contacts/{contact_id}/segments/{segment_id} | Add a contact to a segment |
DELETE | /contacts/{contact_id}/segments/{segment_id} | Remove a contact from a segment |
GET | /contacts/{contact_id}/topics | Retrieve topics for a contact |
PATCH | /contacts/{contact_id}/topics | Update topics for a contact |
Example
Retrieve a list of contacts, with the TypeScript SDK:
ts
import { Resend } from "@octridev/resend";
const client = new Resend({
// Optional: replaces the default server and any server an operation declares.
baseUrl: "https://api.resend.com",
auth: { bearerAuth: process.env.API_TOKEN! },
});
const result = await client.contacts.list();
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.