> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pictory.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get AWS Connection by ID

> Retrieve details of a specific AWS S3 private connection

## Overview

This endpoint retrieves detailed information about a specific AWS S3 private connection using its unique connection ID. Use this to verify connection settings, check status, or retrieve configuration details for a particular connection.

> [!NOTE]
>
> You need a valid API key to use this endpoint. Get your API key from the [API Access page](https://app.pictory.ai/api-access) in your Pictory dashboard.

***

## Use Cases

> [card] Verify Connection
>
> Check if a specific connection exists and is properly configured

> [card] Get Connection Details
>
> Retrieve AWS account ID, region, and other configuration details

> [card] Check Status
>
> Verify if a connection is currently enabled or disabled

> [card] Audit Configuration
>
> Review connection settings for compliance or troubleshooting

***

## API Endpoint

```http theme={null}
GET https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}
```

***

## Request Parameters

### Path Parameters

**connectionid** `string` *required*

The unique identifier of the AWS connection you want to retrieve. This is the `connectionId` value returned when you created the connection or from the list connections endpoint.

```
Example: 20251217080657842fux3au9kh1p0j5s
```

### Headers

**Authorization** `string` *required*

API key for authentication (starts with `pictai_`)

```
Authorization: YOUR_API_KEY
```

Get your API key from the [API Access page](https://app.pictory.ai/api-access) in your Pictory dashboard.

***

## Response

Returns the AWS connection object with all configuration details including connection ID, AWS account information, and connection status.

### Response Examples

```json 200 - Success theme={null}
{
  "connectionId": "20251217080657842fux3au9kh1p0j5s",
  "name": "TestAWSConnection",
  "description": "Test AWS Connection for Documentation",
  "awsAccountId": "123456789012",
  "awsRegion": "us-east-2",
  "type": "AWS",
  "enabled": true,
  "createdDate": "2025-12-17T08:06:56.862Z",
  "updatedDate": "2025-12-17T08:06:56.862Z",
  "version": 1
}
```

```json 401 - Unauthorized theme={null}
{
  "message": "Unauthorized"
}
```

```json 404 - Not Found theme={null}
{
  "message": "Connection not found"
}
```

***

## Code Examples

> [!TIP]
>
> Replace `YOUR_API_KEY` with your actual API key that starts with `pictai_`
>
> Replace `YOUR_CONNECTION_ID` with the actual connection ID you want to retrieve

```bash cURL theme={null}
# Retrieve a specific AWS connection by ID
# Replace YOUR_API_KEY with your actual API key
# Replace YOUR_CONNECTION_ID with your connection ID

curl --request GET \
  --url https://api.pictory.ai/pictoryapis/v1/awsconnections/YOUR_CONNECTION_ID \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'accept: application/json' | python -m json.tool
```

```javascript JavaScript / Node.js theme={null}
// Replace 'YOUR_API_KEY' with your actual API key
// Replace 'YOUR_CONNECTION_ID' with your connection ID

const getAwsConnectionById = async (apiKey, connectionId) => {
  const response = await fetch(`https://api.pictory.ai/pictoryapis/v1/awsconnections/${connectionId}`, {
    method: 'GET',
    headers: {
      'Authorization': `${apiKey}`
    }
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(`Failed: ${error.message}`);
  }

  return await response.json();
};

// Usage
try {
  const connectionId = 'YOUR_CONNECTION_ID';  // ← Replace with your connection ID
  const result = await getAwsConnectionById('YOUR_API_KEY', connectionId);  // ← Replace with your API key
  console.log('Connection Details:', result);
  console.log('Connection Name:', result.name);
  console.log('AWS Region:', result.awsRegion);
  console.log('Enabled:', result.enabled);
} catch (error) {
  console.error('Error:', error.message);
}
```

```python Python theme={null}
# Replace 'YOUR_API_KEY' with your actual API key
# Replace 'YOUR_CONNECTION_ID' with your connection ID

import requests

def get_aws_connection_by_id(api_key, connection_id):
    """Retrieve a specific AWS S3 connection by ID"""
    url = f"https://api.pictory.ai/pictoryapis/v1/awsconnections/{connection_id}"

    headers = {
        "Authorization": api_key
    }

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

    return response.json()

# Usage
try:
    connection_id = "YOUR_CONNECTION_ID"  # ← Replace with your connection ID
    result = get_aws_connection_by_id("YOUR_API_KEY", connection_id)  # ← Replace with your API key
    print(f"Connection Details: {result}")
    print(f"Connection Name: {result['name']}")
    print(f"AWS Region: {result['awsRegion']}")
    print(f"Enabled: {result['enabled']}")
except requests.exceptions.HTTPError as e:
    if e.response.status_code == 404:
        print("Error: Connection not found")
    else:
        error = e.response.json()
        print(f"Error: {error.get('message', 'Request failed')}")
```

```php PHP theme={null}
<?php
// Replace 'YOUR_API_KEY' with your actual API key
// Replace 'YOUR_CONNECTION_ID' with your connection ID

function getAwsConnectionById($apiKey, $connectionId) {
    $url = 'https://api.pictory.ai/pictoryapis/v1/awsconnections/' . $connectionId;

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'Authorization: ' . $apiKey
    ]);

    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($httpCode === 404) {
        throw new Exception('Connection not found');
    }

    if ($httpCode !== 200) {
        $error = json_decode($response, true);
        throw new Exception($error['message'] ?? 'Request failed');
    }

    return json_decode($response, true);
}

// Usage
try {
    $connectionId = 'YOUR_CONNECTION_ID';  // ← Replace with your connection ID
    $result = getAwsConnectionById('YOUR_API_KEY', $connectionId);  // ← Replace with your API key
    echo "Connection Details:\n";
    print_r($result);
    echo "Connection Name: " . $result['name'] . "\n";
    echo "AWS Region: " . $result['awsRegion'] . "\n";
    echo "Enabled: " . ($result['enabled'] ? 'Yes' : 'No') . "\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
```

```go Go theme={null}
// Replace "YOUR_API_KEY" with your actual API key
// Replace "YOUR_CONNECTION_ID" with your connection ID

package main

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

type AwsConnection struct {
    ConnectionID string `json:"connectionId"`
    Name         string `json:"name"`
    Description  string `json:"description"`
    Enabled      bool   `json:"enabled"`
    AWSAccountID string `json:"awsAccountId"`
    AWSRegion    string `json:"awsRegion"`
    Type         string `json:"type"`
    CreatedDate  string `json:"createdDate"`
    UpdatedDate  string `json:"updatedDate"`
    Version      int    `json:"version"`
}

func getAwsConnectionById(apiKey, connectionId string) (*AwsConnection, error) {
    url := fmt.Sprintf("https://api.pictory.ai/pictoryapis/v1/awsconnections/%s", connectionId)

    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        return nil, err
    }

    req.Header.Set("Authorization", apiKey)

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        return nil, err
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        return nil, err
    }

    if resp.StatusCode == http.StatusNotFound {
        return nil, fmt.Errorf("connection not found")
    }

    if resp.StatusCode != http.StatusOK {
        return nil, fmt.Errorf("request failed (status %d): %s", resp.StatusCode, string(body))
    }

    var result AwsConnection
    if err := json.Unmarshal(body, &result); err != nil {
        return nil, err
    }

    return &result, nil
}

// Usage
func main() {
    connectionId := "YOUR_CONNECTION_ID"  // ← Replace with your connection ID
    result, err := getAwsConnectionById("YOUR_API_KEY", connectionId)  // ← Replace with your API key
    if err != nil {
        panic(err)
    }

    fmt.Printf("Connection Details: %+v\n", result)
    fmt.Printf("Connection Name: %s\n", result.Name)
    fmt.Printf("AWS Region: %s\n", result.AWSRegion)
    fmt.Printf("Enabled: %v\n", result.Enabled)
}
```

***

## Common Use Cases

### Verify Connection Before Using in Video Creation

Before creating a video with private S3 assets, verify the connection is still active:

```javascript theme={null}
// Check if connection exists and is enabled
const connection = await getAwsConnectionById(apiKey, connectionId);

if (connection.enabled) {
  console.log('Connection is active and ready to use');
  // Proceed with video creation
} else {
  console.log('Connection is disabled. Enable it before creating videos.');
}
```

### Get Connection Configuration Details

```python theme={null}
# Retrieve connection details for troubleshooting
connection = get_aws_connection_by_id(api_key, connection_id)

print(f"AWS Account ID: {connection['awsAccountId']}")
print(f"AWS Region: {connection['awsRegion']}")
print(f"Created: {connection['createdDate']}")
print(f"Last Updated: {connection['updatedDate']}")
```

### Check Connection Status

```javascript theme={null}
// Check if a specific connection is enabled
const connection = await getAwsConnectionById(apiKey, connectionId);
const status = connection.enabled ? 'Active' : 'Disabled';
console.log(`Connection "${connection.name}" is ${status}`);
```

***

## Error Handling

> [accordion] 404 Not Found
>
> **Cause:** The connection ID does not exist or has been deleted
>
> **Solution:**
>
> * Verify the connection ID is correct
> * Use the [Get AWS Connections](https://docs.pictory.ai/api-reference/aws-integration/get-aws-connections.md) endpoint to list all available connections
> * Check if the connection was deleted

> [accordion] 401 Unauthorized
>
> **Cause:** Invalid or missing API key
>
> **Solution:**
>
> * Verify your API key is correct and starts with `pictai_`
> * Check the `Authorization` header is properly formatted: `YOUR_API_KEY`
> * Ensure your API key hasn't expired
> * Get a new API key from the [API Access page](https://app.pictory.ai/api-access)

> [accordion] 403 Forbidden
>
> **Cause:** You do not have permission to access this connection
>
> **Solution:**
>
> * Verify the connection belongs to your account
> * Check that your API key has the necessary permissions
> * Contact support if you believe you should have access

***

## Next Steps

> [card] [List All Connections](https://docs.pictory.ai/api-reference/aws-integration/get-aws-connections.md)
>
> Retrieve all your AWS S3 private connections

> [card] [Create Connection](https://docs.pictory.ai/api-reference/aws-integration/aws-private-connection.md)
>
> Set up a new AWS S3 private connection

> [card] [Get API Key](https://app.pictory.ai/api-access)
>
> Access your API key from your Pictory dashboard

> [card] [Use in Videos](https://docs.pictory.ai/api-reference/video-storyboard/update-storyboard-elements.md)
>
> Learn how to use connection IDs in video creation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.