import { Resend } from 'resend';

const resend = new Resend('re_123456789');

// Get by contact id
resend.contacts.get({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});

// Get by contact email
resend.contacts.get({
  email: 'steve.wozniak@gmail.com',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});
{
  "object": "contact",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
  "email": "steve.wozniak@gmail.com",
  "first_name": "Steve",
  "last_name": "Wozniak",
  "created_at": "2023-10-06T23:47:56.678Z",
  "unsubscribed": false
}

Path Parameters

audienceId
string
required

The Audience ID.

Either id or email must be provided.

id
string

The Contact ID.

email
string

The Contact Email.

import { Resend } from 'resend';

const resend = new Resend('re_123456789');

// Get by contact id
resend.contacts.get({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});

// Get by contact email
resend.contacts.get({
  email: 'steve.wozniak@gmail.com',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});
{
  "object": "contact",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
  "email": "steve.wozniak@gmail.com",
  "first_name": "Steve",
  "last_name": "Wozniak",
  "created_at": "2023-10-06T23:47:56.678Z",
  "unsubscribed": false
}