Delete AWS Private Connection
curl --request DELETE \
--url https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid} \
--header 'Authorization: <authorization>'import requests
url = "https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body(Empty response body)
{
"message": "Unauthorized"
}
{
"message": "Connection not found"
}
AWS Integration
Delete AWS Private Connection
Permanently remove an AWS S3 private connection
DELETE
/
pictoryapis
/
v1
/
awsconnections
/
{connectionid}
Delete AWS Private Connection
curl --request DELETE \
--url https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid} \
--header 'Authorization: <authorization>'import requests
url = "https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body(Empty response body)
{
"message": "Unauthorized"
}
{
"message": "Connection not found"
}
Overview
This endpoint allows you to permanently delete an AWS S3 private connection from your Pictory account. Once deleted, the connection cannot be recovered and any video creation workflows using this connection will fail.You need a valid API key to use this endpoint. Get your API key from the API Access page in your Pictory dashboard.
This action is permanent and cannot be undone. Before deleting a connection, ensure:
- No active video projects are using this connection
- You have documented the connection settings if you may need them again
- Consider disabling the connection temporarily instead of deleting it
Use Cases
Remove Unused Connections
Clean up connections that are no longer needed
Security Cleanup
Remove connections for decommissioned AWS accounts
Connection Migration
Delete old connections after migrating to new AWS infrastructure
Account Cleanup
Remove test or development connections
API Endpoint
DELETE https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid}
Request Parameters
Path Parameters
string
required
The unique identifier of the AWS connection you want to delete. This is the
connectionId value returned when you created the connection.Example: 20251217080657842fux3au9kh1p0j5s
Headers
string
required
API key for authentication (starts with Get your API key from the API Access page in your Pictory dashboard.
pictai_)Authorization: YOUR_API_KEY
Response
Success Response
A successful deletion returns 204 No Content with an empty response body. This is the standard HTTP status code for successful deletions. Status Code:204 No Content
Response Body: None (empty)
Response Examples
(Empty response body)
{
"message": "Unauthorized"
}
{
"message": "Connection not found"
}
Code Examples
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 delete# Delete an AWS connection
# Replace YOUR_API_KEY with your actual API key
# Replace YOUR_CONNECTION_ID with your connection ID
curl --request DELETE \
--url https://api.pictory.ai/pictoryapis/v1/awsconnections/YOUR_CONNECTION_ID \
--header 'Authorization: YOUR_API_KEY' | python -m json.tool
// Replace 'YOUR_API_KEY' with your actual API key
// Replace 'YOUR_CONNECTION_ID' with your connection ID
const deleteAwsConnection = async (apiKey, connectionId) => {
const response = await fetch(`https://api.pictory.ai/pictoryapis/v1/awsconnections/${connectionId}`, {
method: 'DELETE',
headers: {
'Authorization': `${apiKey}`
}
});
if (!response.ok) {
const error = await response.json();
throw new Error(`Failed: ${error.message}`);
}
// 204 No Content - successful deletion returns no body
return { success: true, status: response.status };
};
// Usage
try {
const connectionId = 'YOUR_CONNECTION_ID'; // ← Replace with your connection ID
const result = await deleteAwsConnection('YOUR_API_KEY', connectionId); // ← Replace with your API key
console.log('Connection deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
# Replace 'YOUR_API_KEY' with your actual API key
# Replace 'YOUR_CONNECTION_ID' with your connection ID
import requests
def delete_aws_connection(api_key, connection_id):
"""Delete an AWS S3 connection permanently"""
url = f"https://api.pictory.ai/pictoryapis/v1/awsconnections/{connection_id}"
headers = {
"Authorization": api_key
}
response = requests.delete(url, headers=headers)
response.raise_for_status()
# 204 No Content - successful deletion returns no body
return {"success": True, "status": response.status_code}
# Usage
try:
connection_id = "YOUR_CONNECTION_ID" # ← Replace with your connection ID
result = delete_aws_connection("YOUR_API_KEY", connection_id) # ← Replace with your API key
print("Connection deleted successfully")
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
// Replace 'YOUR_API_KEY' with your actual API key
// Replace 'YOUR_CONNECTION_ID' with your connection ID
function deleteAwsConnection($apiKey, $connectionId) {
$url = 'https://api.pictory.ai/pictoryapis/v1/awsconnections/' . $connectionId;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
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 !== 204) {
$error = json_decode($response, true);
throw new Exception($error['message'] ?? 'Request failed');
}
// 204 No Content - successful deletion returns no body
return ['success' => true, 'status' => $httpCode];
}
// Usage
try {
$connectionId = 'YOUR_CONNECTION_ID'; // ← Replace with your connection ID
$result = deleteAwsConnection('YOUR_API_KEY', $connectionId); // ← Replace with your API key
echo "Connection deleted successfully\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
?>
// Replace "YOUR_API_KEY" with your actual API key
// Replace "YOUR_CONNECTION_ID" with your connection ID
package main
import (
"fmt"
"net/http"
)
func deleteAwsConnection(apiKey, connectionId string) error {
url := fmt.Sprintf("https://api.pictory.ai/pictoryapis/v1/awsconnections/%s", connectionId)
req, err := http.NewRequest("DELETE", url, nil)
if err != nil {
return err
}
req.Header.Set("Authorization", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusNotFound {
return fmt.Errorf("connection not found")
}
if resp.StatusCode != http.StatusNoContent {
return fmt.Errorf("request failed (status %d)", resp.StatusCode)
}
// 204 No Content - successful deletion
return nil
}
// Usage
func main() {
connectionId := "YOUR_CONNECTION_ID" // ← Replace with your connection ID
err := deleteAwsConnection("YOUR_API_KEY", connectionId) // ← Replace with your API key
if err != nil {
panic(err)
}
fmt.Println("Connection deleted successfully")
}
Common Use Cases
Safe Deletion with Confirmation
// Check connection exists before deleting
const safeDelete = async (apiKey, connectionId) => {
try {
// First, verify the connection exists
const connection = await getAwsConnectionById(apiKey, connectionId);
console.log(`About to delete: ${connection.name}`);
// Confirm with user (in a real app)
const confirmed = true; // Replace with actual user confirmation
if (confirmed) {
const result = await deleteAwsConnection(apiKey, connectionId);
console.log('Connection deleted successfully');
}
} catch (error) {
console.error('Delete failed:', error.message);
}
};
Delete After Migration
# Delete old connection after creating new one
def migrate_connection(api_key, old_connection_id, new_aws_account, new_region):
# Create new connection
new_connection = create_aws_connection(api_key, {
"name": "MigratedConnection",
"description": "Migrated to new AWS account",
"awsAccountId": new_aws_account,
"awsRegion": new_region,
"enabled": True
})
print(f"New connection created: {new_connection['connectionId']}")
# Delete old connection (returns 204 No Content on success)
delete_aws_connection(api_key, old_connection_id)
print("Old connection deleted successfully")
return new_connection['connectionId']
Bulk Cleanup
// Delete multiple unused connections
const cleanupConnections = async (apiKey, connectionIdsToDelete) => {
const results = [];
for (const connectionId of connectionIdsToDelete) {
try {
await deleteAwsConnection(apiKey, connectionId);
results.push({ connectionId, status: 'deleted' });
} catch (error) {
results.push({ connectionId, status: 'failed', error: error.message });
}
}
return results;
};
// Usage
const toDelete = ['connection-id-1', 'connection-id-2', 'connection-id-3'];
const results = await cleanupConnections(apiKey, toDelete);
console.log('Cleanup results:', results);
Delete with Audit Trail
# Delete connection and log the action
import logging
from datetime import datetime
def delete_with_audit(api_key, connection_id, reason):
# Get connection details before deletion
connection = get_aws_connection_by_id(api_key, connection_id)
# Log deletion
logging.info(f"Deleting connection: {connection['name']}")
logging.info(f"AWS Account: {connection['awsAccountId']}")
logging.info(f"Region: {connection['awsRegion']}")
logging.info(f"Reason: {reason}")
logging.info(f"Timestamp: {datetime.now().isoformat()}")
# Perform deletion (returns 204 No Content on success)
delete_aws_connection(api_key, connection_id)
logging.info("Deletion completed successfully")
return True
Error Handling
404 Not Found
404 Not Found
Cause: The connection ID does not exist or has already been deletedSolution:
- Verify the connection ID is correct
- Use the Get AWS Connections endpoint to list all available connections
- Check if the connection was already deleted
401 Unauthorized
401 Unauthorized
Cause: Invalid or missing API keySolution:
- Verify your API key is correct and starts with
pictai_ - Check the
Authorizationheader is properly formatted:YOUR_API_KEY - Ensure your API key hasn’t expired
- Get a new API key from the API Access page
403 Forbidden
403 Forbidden
Cause: You do not have permission to delete this connectionSolution:
- 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
409 Conflict - Connection In Use
409 Conflict - Connection In Use
Cause: The connection is currently being used by active video projectsSolution:
- Check for active videos using this connection
- Wait for ongoing video rendering to complete
- Update video projects to use a different connection
- Disable the connection instead of deleting it
Important Considerations
Before Deleting a Connection
- Check for active usage: Ensure no videos are currently being processed with this connection
- Document settings: Save the AWS Account ID, Region, and IAM role configuration if you may need to recreate it
- Update workflows: Modify any automated workflows that reference this connection ID
- Consider disabling: Use the Update endpoint to disable instead of delete
Alternative to DeletionInstead of permanently deleting a connection, consider:
- Disabling it: Set
enabled: falseusing the Update endpoint - Renaming it: Add “DEPRECATED” to the name to mark it as inactive
- This preserves the configuration for future reference while preventing its use
When to Delete vs DisableDelete when:
- AWS account has been closed
- Connection was created for testing only
- Security requires removing all traces of the connection
- Temporarily pausing usage
- May need to re-enable later
- Want to preserve configuration for reference
Deletion Impact
When you delete an AWS connection:-
Immediate Effects:
- Connection ID becomes invalid immediately
- Cannot be used in new video creation requests
- Connection appears in no API listings
-
Video Projects:
- Existing videos remain accessible
- New videos cannot be created using this connection
- In-progress videos using this connection may fail
-
Cannot Be Undone:
- Deleted connections cannot be recovered
- Must create a new connection to restore access
- New connection will have a different connection ID
Next Steps
List All Connections
View all connections before deleting
Get Connection Details
Verify connection details before deletion
Get API Key
Access your API key from your Pictory dashboard
Create New Connection
Set up a replacement connection
Was this page helpful?
