> For a complete page index, fetch https://developer.close.com/llms.txt

# Get a single SMS activity

GET https://api.close.com/api/v1/activity/sms/{id}/

Reference: https://developer.close.com/api/resources/activities/sms/get

## Authentication

- `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty.
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required)

### Query parameters

- `_fields` (string, optional) — Comma-separated list of fields to include in the response.

## Response

### 200

Successful response

- `_type` (string, required)
- `activity_at` (datetime, required, nullable)
- `caller_id_mode` (enum, required, nullable) — How a caller's outbound number is chosen. Fixed uses a single configured number; Auto lets Close select the best number per call/SMS (Managed by Close Caller ID).
  - Allowed values: `fixed`, `auto`
- `caller_id_reason` (enum, required, nullable) — Why a number was chosen in Auto mode: reused from a prior communication (context), picked for geographic proximity (local_presence), or the default/oldest fallback.
  - Allowed values: `context`, `local_presence`, `fallback`
- `contact_id` (string, required, nullable)
- `cost` (string, required, nullable)
- `created_by` (string, required, nullable)
- `date_created` (datetime, required)
- `date_scheduled` (datetime, required, nullable)
- `date_sent` (datetime, required, nullable)
- `date_updated` (datetime, required)
- `direction` (enum, required) — Direction of a phone activity, such as a call or an SMS message.
  - Allowed values: `inbound`, `outbound`
- `error_message` (string, required, nullable)
- `id` (string, required)
- `lead_id` (string, required, nullable)
- `local_country_iso` (string, required, nullable)
- `local_phone` (string, required, nullable)
- `local_phone_formatted` (string, required, nullable)
- `organization_id` (string, required)
- `remote_country_iso` (string, required, nullable)
- `remote_phone` (string, required, nullable)
- `remote_phone_formatted` (string, required, nullable)
- `source` (enum, required) — Source of a phone activity. Describes whether the phone activity (such as a call or an SMS) was handled by Close's telephony provider or handled externally by a 3rd party and is merely logged in Close.
  - Allowed values: `Close.io`, `External`
- `status` (enum, required) — Status of a message, such as Email or SMS.
  - Allowed values: `inbox`, `draft`, `scheduled`, `outbox`, `sent`, `error`
- `template_id` (string, required, nullable)
- `text` (string, required, nullable)
- `updated_by` (string, required, nullable)
- `user_id` (string, required, nullable)
- `users` (list of string, required)
- `agent_action_reason` (string, optional, nullable)
- `agent_config_id` (string, optional, nullable)
- `created_by_name` (string, optional, nullable)
- `sequence_id` (string, optional, nullable)
- `sequence_name` (string, optional, nullable)
- `sequence_subscription_id` (string, optional, nullable)
- `updated_by_name` (string, optional, nullable)
- `user_name` (string, optional, nullable)

## Errors

### 400 Bad Request Error

Bad request

- `any`

### 401 Unauthorized Error

Unauthorized

- `any`

### 404 Not Found Error

Not found

- `any`

## Examples

**Response**

```json
{
  "_type": "SMS",
  "activity_at": "2016-10-03T16:06:11.167000+00:00",
  "caller_id_mode": null,
  "caller_id_reason": null,
  "contact_id": "cont_q4xYmlGhA3060dEl0NDJuHRxPMuVjqLn30AFSzh1fRk",
  "cost": "1",
  "created_by": null,
  "date_created": "2016-10-03T16:06:11.167000+00:00",
  "date_scheduled": null,
  "date_sent": null,
  "date_updated": "2016-10-03T16:06:11.167000+00:00",
  "direction": "inbound",
  "error_message": null,
  "id": "acti_12358hIUhaklslYoYSbtozZuUTyB2zO2nhm7iVSpZpp",
  "lead_id": "lead_iuSXNk1x3446ggPVwQS7ynmp8pGRIDieRYiCnuo4yFb",
  "local_country_iso": "US",
  "local_phone": "+16503334444",
  "local_phone_formatted": "+1 650-333-4444",
  "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
  "remote_country_iso": "US",
  "remote_phone": "+18183004000",
  "remote_phone_formatted": "+1 818-300-4000",
  "source": "Close.io",
  "status": "inbox",
  "template_id": null,
  "text": "SMS in Close? HUZZAH!!!",
  "updated_by": null,
  "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "users": [],
  "created_by_name": null,
  "updated_by_name": null,
  "user_name": "Tobias Fuenke",
  "attachments": [
    {
      "content_type": "image/png",
      "filename": "media_1.png",
      "media_id": "media_1GnAWzBfs0SOjTDcUnyyP9",
      "size": 15148,
      "thumbnail_url": "https://app.close.com/go/sms/acti_12358hIUhaklslYoYSbtozZuUTyB2zO2nhm7iVSpZpp/media/media_7Ga8l93XLVvqNsgjPbBuUI/thumbnail/",
      "url": "https://app.close.com/go/sms/acti_12358hIUhaklslYoYSbtozZuUTyB2zO2nhm7iVSpZpp/media/media_7Ga8l93XLVvqNsgjPbBuUI/"
    }
  ]
}
```

**SDK Code**

```python activities.sms_get_example
import requests

url = "https://api.close.com/api/v1/activity/sms/id/"

response = requests.get(url, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript activities.sms_get_example
const url = 'https://api.close.com/api/v1/activity/sms/id/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go activities.sms_get_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.close.com/api/v1/activity/sms/id/"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<CLOSE_API_KEY>", "")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby activities.sms_get_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/activity/sms/id/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")

response = http.request(request)
puts response.read_body
```

```java activities.sms_get_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.close.com/api/v1/activity/sms/id/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .asString();
```

```php activities.sms_get_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.close.com/api/v1/activity/sms/id/', [
  'headers' => [
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

echo $response->getBody();
```

```csharp activities.sms_get_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/activity/sms/id/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```