# Retrieve contact

> GET /contacts/:id — fetch a contact by id or email.

`GET /contacts/:id`

Retrieve a single contact. The `:id` segment accepts either the contact `id` or its `email`. An id is exact; when addressing by **email**, pass `?domain=` to say which of your sending domains the contact lives on (each domain keeps its own contact records).

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The contact’s `id` *or* its `email` — either value is accepted in this path segment. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | No | The sending domain the contact belongs to. Needed when addressing by email; an id is exact, so `domain` is not required then. |

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.get({ id: 'steve@example.com', domain: 'yourdomain.com' });
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Contacts.get({
  "id": "steve@example.com",
  "domain": "yourdomain.com"
})
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->contacts->get([
  'id' => "steve@example.com",
  'domain' => "yourdomain.com"
]);
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Contacts.get({
  "id": "steve@example.com",
  "domain": "yourdomain.com"
})
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

contact, err := client.Contacts.Get(&sendping.GetContactRequest{
    Id:     "steve@example.com",
    Domain: "yourdomain.com",
})
```

**Rust**

```rust
use sendping::{ContactLookup, SendPing};

let mb = SendPing::new("mb_xxxxxxxxx");

let params = ContactLookup::new("steve@example.com").with_domain("yourdomain.com");
let _contact = mb.contacts.get(params).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.contacts().get(
        "steve@example.com",
        "yourdomain.com");
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.ContactRetrieveAsync("steve@example.com", "yourdomain.com");
```

**cURL**

```bash
curl -X GET 'https://www.sendping.co/api/contacts/steve@example.com?domain=yourdomain.com' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping contacts get steve@example.com \
  --domain yourdomain.com
```

**Response (200)**

```json
{
  "object": "contact",
  "id": "479e3145-dd0e-4f64-bf48-1d4b6d4cd8f6",
  "email": "steve@example.com",
  "first_name": "Steve",
  "last_name": "Wozniak",
  "unsubscribed": false,
  "properties": {
    "company_name": "Acme Corp",
    "department": "Engineering"
  },
  "created_at": "2026-06-23T17:30:11.000Z"
}
```

The `properties` map is always present and includes every registered contact property — the contact's own value wins; if a property has no value set, the property's `fallback_value` is used instead. An unknown contact returns `404 not_found`. See [Errors](https://www.sendping.co/docs/api/errors).

## Audience-scoped variant

The nested route `GET /audiences/:audience_id/contacts/:id` still works and scopes the lookup to one audience (no `domain` query needed):

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.get({ audienceId: 'AUDIENCE_ID', id: 'steve@example.com' });
console.log({ data, error });
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://www.sendping.co/api/audiences/AUDIENCE_ID/contacts/steve@example.com')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer mb_xxxxxxxxx'
res = http.request(req)
puts res.body
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->contacts->get([
  'audienceId' => "AUDIENCE_ID",
  'id' => "steve@example.com"
]);
```

**Python**

```python
import requests

res = requests.get(
    "https://www.sendping.co/api/audiences/AUDIENCE_ID/contacts/steve@example.com",
    headers={"Authorization": "Bearer mb_xxxxxxxxx"},
)
print(res.json())
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

contact, err := client.Contacts.Get(&sendping.GetContactRequest{
    AudienceId: "AUDIENCE_ID",
    Id:         "steve@example.com",
})
```

**Rust**

```rust
use sendping::{ContactLookup, SendPing};

let mb = SendPing::new("mb_xxxxxxxxx");

let params = ContactLookup::new("steve@example.com").with_audience_id("AUDIENCE_ID");
let _contact = mb.contacts.get(params).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.contacts().getByAudience(
        "AUDIENCE_ID",
        "steve@example.com");
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.ContactRetrieveAsync(
    audienceId: "AUDIENCE_ID",
    contactIdOrEmail: "steve@example.com");
```

**cURL**

```bash
curl -X GET 'https://www.sendping.co/api/audiences/AUDIENCE_ID/contacts/steve@example.com' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```
