---
title: "Get a contact"
description: "Returns a single contact, including its notes."
version: "v2"
---

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

Path: touchSMS API › Contacts

`GET /v2/contacts/{contact}`

Returns a single contact, including its notes.

## Authentication

- `basicAuth`, http, header `Authorization`

## Path parameters

- `contact` (`getContact.path.contact`; integer, required) — Contact ID.

## Code samples

### cURL

```bash
curl --request GET \
  --url https://app.touchsms.com.au/api/v2/contacts/4040 \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.touchsms.com.au/api/v2/contacts/4040';
const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.touchsms.com.au/api/v2/contacts/4040"

headers = {"Authorization": "Basic <credentials>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The contact.

#### Example

```json
{
  "data": {
    "id": 4040,
    "user": 5678,
    "firstname": "Sam",
    "surname": "Taylor",
    "email": "sam@example.com",
    "number": "+61412345678",
    "metadata": null,
    "groups": [
      {
        "id": 512,
        "name": "Customers"
      }
    ],
    "updated": "2024-03-11T02:14:07Z",
    "created": "2024-02-02T23:51:19Z"
  }
}
```

- `data` (`getContact.response.200.data`; object, optional)
  - example `{"id":4040,"user":5678,"firstname":"Sam","surname":"Taylor","email":"sam@example.com","number":"+61412345678","metadata":null,"groups":[{"id":512,"name":"Customers"}],"updated":"2024-03-11T02:14:07Z","created":"2024-02-02T23:51:19Z"}`
  - `id` (`getContact.response.200.data.id`; integer, optional)
  - `user` (`getContact.response.200.data.user`; integer, optional) — ID of the user that owns the contact.
  - `firstname` (`getContact.response.200.data.firstname`; string | null, optional)
  - `surname` (`getContact.response.200.data.surname`; string | null, optional)
  - `email` (`getContact.response.200.data.email`; string | null, optional)
  - `number` (`getContact.response.200.data.number`; string, optional)
  - `metadata` (`getContact.response.200.data.metadata`; object | null, optional)
  - `groups` (`getContact.response.200.data.groups`; array<object>, optional)
    - `id` (`getContact.response.200.data.groups.id`; integer, optional)
    - `name` (`getContact.response.200.data.groups.name`; string, optional)
  - `notes` (`getContact.response.200.data.notes`; array<object>, optional) — Notes on the contact. Only returned when getting or updating a single contact.
    - `id` (`getContact.response.200.data.notes.id`; integer, optional)
    - `content` (`getContact.response.200.data.notes.content`; string, optional)
    - `created_at` (`getContact.response.200.data.notes.created_at`; string, optional)
      - format `date-time`
    - `updated_at` (`getContact.response.200.data.notes.updated_at`; string, optional)
      - format `date-time`
  - `updated` (`getContact.response.200.data.updated`; string, optional)
    - format `date-time`
  - `created` (`getContact.response.200.data.created`; string, optional)
    - format `date-time`

### 401

Missing, malformed or invalid API credentials.

#### Example

```json
{
  "message": "Unauthenticated."
}
```

- `message` (`getContact.response.401.message`; string, required)

### 403

The resource exists but does not belong to you, or you lack permission.

#### Example

```json
{
  "message": "This action is unauthorized."
}
```

- `message` (`getContact.response.403.message`; string, required)

### 404

The resource does not exist.

#### Example

```json
{
  "message": "Not Found"
}
```

- `message` (`getContact.response.404.message`; string, required)


Source: https://dev.touchsms.com.au/api/contacts/get/index.md
