# Get Conversation

`POST /conversations/get`

Fetch a specific conversation using either its unique identifier or by matching sender and recipient details.

## Authentication

Send your API key in the `PINNACLE-API-KEY` header.

## Request body

Required.

Content type: `application/json`.

### Fields

- Variant: Get by ID
- `id` — `string`. Unique identifier of the conversation you want to retrieve. This identifier is a string that always begins with the prefix `conv_`, for example: `conv_1234567890`.
- Variant: Get by Participants
- `recipient` — `string`. The recipient's phone number in E.164 format
- `sender` — `string`. The sender identifier. Can be either:
- A phone number in E.164 format
- An RCS agent ID prefixed with 'agent_'

### Example

```json
{
  "id": "conv_1234567890"
}
```

## Responses

### 200

Returns the full conversation details, or null if not found.

Content type: `application/json`. Schema: `null | object`.

- Variant: variant 1
- Variant: variant 2
- `brandId` — `string`. The unique identifier of the brand associated with this conversation. This identifier is a string that always begins with the prefix `b_`, for example: `b_1234567890`.
- `campaign` — `object`. Campaign information if this conversation is part of a marketing campaign. This is an object that contains the campaign ID and type.
- `campaign.id` — `string`. Unique identifier for the campaign. This identifier is a string that begins with the prefix:
- TOLL_FREE: `tf_` (e.g., `tf_1234567890`)
- 10DLC: `dlc_` (e.g., `dlc_1234567890`)
- RCS: `rcs_` (e.g., `rcs_1234567890`)
- `campaign.type` — `CampaignEnum`, values: `TOLL_FREE`, `10DLC`, `RCS`. The type of campaign:
- TOLL_FREE: Toll-free number campaigns
- 10DLC: 10-digit long code campaigns for A2P messaging
- RCS: Rich Communication Services campaigns
- `contact` — `object`. Contact information for the recipient in a conversation.
- `contact.id` — `string`. Unique ID of the contact. This identifier is a string that always begins with the prefix `co_`, for example: `co_1234567890`.
- `contact.phoneNumber` — `string`. The contact's phone number in E.164 format.
- `createdAt` — `string`. ISO 8601 timestamp when the conversation was created.
- `id` — `string`. Unique identifier for the conversation. This identifier is a string that always begins with the prefix `conv_`, for example: `conv_1234567890`.
- `notes` — `string`. Free-form notes or comments about the conversation.
- `sender` — `null | Phone | Agent`. The sender of messages in this conversation. Can be:
- A phone number with its capabilities and metadata
- An RCS agent with ID and name
- `null` if no sender is associated
- `sender` Variant: variant 1
- `sender` Variant: Phone
- `sender.capabilities` — `object`. Represents the communication capabilities available for a phone number.
- `sender.capabilities.mms` — `boolean`. Whether the phone number supports MMS (multimedia messaging).
- `sender.capabilities.sms` — `boolean`. Whether the phone number supports SMS messaging.
- `sender.capabilities.voice` — `boolean`. Whether the phone number supports voice calls.
- `sender.createdAt` — `string`. ISO 8601 timestamp when the phone sender was created.
- `sender.isSandbox` — `boolean`. Whether this phone number is in sandbox/testing mode.
- `sender.phoneNumber` — `string`. The sender's phone number in E.164 format.
- `sender.updatedAt` — `string`. ISO 8601 timestamp when the phone sender was last updated
- `sender` Variant: Agent
- `sender.agentId` — `string`. Unique identifier for the RCS agent.
- `sender.agentName` — `string`. Display name of the RCS agent.
- `updatedAt` — `string`. ISO 8601 timestamp when the conversation was last updated.

Example:

```json
{
  "id": "conv_1234567890",
  "createdAt": "2024-09-11T00:05:29.434",
  "updatedAt": "2024-08-14T14:19:40.237",
  "contact": {
    "id": "co_1234567890",
    "phoneNumber": "+16509231662"
  },
  "sender": {
    "phoneNumber": "+18445551234",
    "capabilities": {
      "sms": true,
      "mms": true,
      "voice": true
    },
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "isSandbox": false
  },
  "brandId": "b_1234567890",
  "campaign": {
    "type": "TOLL_FREE",
    "id": "tf_1234567890"
  },
  "notes": "Customer inquired about product availability"
}
```

### 400

Validation failed. The payload has missing required fields and/or invalid types.

See https://zod.dev/error-formatting for more information.

Content type: `application/json`. Schema: `object`.

- `description` — `string`. Human-readable summary of validation failures.
- `errors` — `object`. Structured dictionary of issues containing two main sections:
- `errors`: Array of global validation errors not tied to specific fields
- `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array

Example:

```json
{
  "description": "✖ Invalid input: expected string, received number\n  → at example_field",
  "errors": {
    "errors": [
      "Unrecognized key: 'extraKey'"
    ],
    "properties": {
      "example_field": {
        "errors": [
          "Invalid input: expected string, received NaN"
        ]
      }
    }
  }
}
```

### 401

The request lacks valid authentication credentials or the provided credentials are invalid.

Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "Invalid API key."
}
```

### 403

Your subscription does not include access to this feature.

This occurs when attempting to use functionality that requires a higher subscription tier.
Please upgrade your subscription to access this feature.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "Your subscription does not include access to this feature."
}
```

### 500

An unexpected error occurred on Pinnacle's servers while processing your request.

If this error persists, please contact support with the request details.

Content type: `application/json`. Schema: `object`.

- `error` — `string`. Human-readable description of the error that occurred, corresponding to the HTTP status code.

Example:

```json
{
  "error": "An unexpected error occurred while processing your request."
}
```

## SDK examples

### TypeScript

```typescript
import { PinnacleClient } from "rcs-js";

const client = new PinnacleClient({
  apiKey: process.env.PINNACLE_API_KEY!,
});

await client.conversations.get({
    id: "conv_1234567890"
});
```

### Python

```python
import os
from rcs import ConversationByIdParams, Pinnacle

client = Pinnacle(
    api_key=os.environ["PINNACLE_API_KEY"],
)

client.conversations.get(
    request=ConversationByIdParams(
        id="conv_1234567890",
    ),
)
```

### Ruby

```ruby
require "rcs"

client = Pinnacle::Client.new(
  api_key: ENV.fetch("PINNACLE_API_KEY")
)

client.conversations.get(id: "conv_1234567890")
```

## Machine-readable schema

[OpenAPI 3.1 JSON](https://docs.pinnacle.sh/openapi.json)
