> This page is for Workforce.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Retrieve Connection

GET https://ah-api.merge.dev/api/v1/connections/{connection_id}/

Retrieves a single connection by ID.

Reference: https://docs.merge.dev/merge-workforce/agent-handler/connections/connections-retrieve

## Authentication

- `Authorization` header (bearer token, required) — Token-based authentication with required prefix "Bearer"

## Request

### Path parameters

- `connection_id` (string, required)

## Response

### 200

- `id` (string, required)
- `connector` (ConnectionConnector, required)
- `organization_id` (string, required)
- `auth_option_name` (string, required, nullable)
- `auth_type` (string, required)
- `auth_scope` (string, required) — The connection's scope: INDIVIDUAL, SHARED, or ORGANIZATION.
- `status` (string, required) — Connection status: ACTIVE (a token refresh succeeded, or the default for a freshly linked connection) or ERROR (a token refresh failed; the connection needs re-linking).
- `retired_at` (datetime, required, nullable) — When set, the connection is retired (out of service) and surfaced as an issue. Null for live connections.
- `owner` (ConnectionOwner, required)
- `excluded_registered_users` (list of string, required) — Registered-user IDs blocked from this SHARED or ORGANIZATION connection. Always empty for INDIVIDUAL connections.
- `created_at` (datetime, required)
- `modified_at` (datetime, required)

## Types

### ConnectionConnector

- `slug` (string, required)
- `name` (string, required)
- `logo_url` (string, required, nullable)

### ConnectionOwner

- `type` (string, required)
- `id` (string, required)
- `name` (string, optional)
- `group` (ConnectionOwnerGroup, optional)

### ConnectionOwnerGroup

- `key` (string, required)
- `value` (string, required)

## Examples

**Response**

```json
{
  "id": "string",
  "connector": {
    "slug": "string",
    "name": "string",
    "logo_url": "string"
  },
  "organization_id": "string",
  "auth_option_name": "string",
  "auth_type": "string",
  "auth_scope": "string",
  "status": "string",
  "retired_at": "2024-01-15T09:30:00Z",
  "owner": {
    "type": "string",
    "id": "string",
    "name": "string",
    "group": {
      "key": "string",
      "value": "string"
    }
  },
  "excluded_registered_users": [
    "string"
  ],
  "created_at": "2024-01-15T09:30:00Z",
  "modified_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://ah-api.merge.dev/api/v1/connections/connection_id/"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://ah-api.merge.dev/api/v1/connections/connection_id/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/connections/connection_id/"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://ah-api.merge.dev/api/v1/connections/connection_id/")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://ah-api.merge.dev/api/v1/connections/connection_id/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://ah-api.merge.dev/api/v1/connections/connection_id/', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/connections/connection_id/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/connections/connection_id/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```