Skip to main content
DELETE
https://api.pictory.ai
/
pictoryapis
/
v1
/
awsconnections
/
{connectionid}
Delete AWS Private Connection
curl --request DELETE \
  --url https://api.pictory.ai/pictoryapis/v1/awsconnections/{connectionid} \
  --header 'Authorization: <authorization>'
(Empty response body)

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

connectionid
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

Authorization
string
required
API key for authentication (starts with pictai_)
Authorization: YOUR_API_KEY
Get your API key from the API Access page in your Pictory dashboard.

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)

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

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

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
Cause: Invalid or missing API keySolution:
  • 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
Cause: You don’t 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
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
  1. Check for active usage: Ensure no videos are currently being processed with this connection
  2. Document settings: Save the AWS Account ID, Region, and IAM role configuration if you may need to recreate it
  3. Update workflows: Modify any automated workflows that reference this connection ID
  4. Consider disabling: Use the Update endpoint to disable instead of delete
Alternative to DeletionInstead of permanently deleting a connection, consider:
  • Disabling it: Set enabled: false using 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
Disable when:
  • Temporarily pausing usage
  • May need to re-enable later
  • Want to preserve configuration for reference

Deletion Impact

When you delete an AWS connection:
  1. Immediate Effects:
    • Connection ID becomes invalid immediately
    • Cannot be used in new video creation requests
    • Connection appears in no API listings
  2. Video Projects:
    • Existing videos remain accessible
    • New videos cannot be created using this connection
    • In-progress videos using this connection may fail
  3. 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