Skip to main content
PATCH
/
v1
/
organizations
/
connections
/
{connection_identifier}
Update Storage Connection
curl --request PATCH \
  --url https://api.mixpeek.com/v1/organizations/connections/{connection_identifier} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Updated Drive Name",
  "description": "<string>",
  "metadata": {},
  "status": "PENDING",
  "is_active": true,
  "provider_config": {}
}
'
{
  "internal_id": "<string>",
  "provider_type": "google_drive",
  "provider_config": {
    "credentials": {
      "client_email": "[email protected]",
      "client_id": "123456789012345678901",
      "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
      "private_key_id": "a1b2c3d4e5f6...",
      "project_id": "mixpeek-prod-456",
      "type": "service_account"
    },
    "description": "Service account accessing shared drive",
    "provider_type": "google_drive",
    "shared_drive_id": "0AH-Xabc123def456"
  },
  "name": "<string>",
  "created_by_user_id": "<string>",
  "connection_id": "<string>",
  "description": "Shared drive for marketing team assets and campaign materials",
  "status": "ACTIVE",
  "is_active": true,
  "last_used_at": "2023-11-07T05:31:56Z",
  "last_error": "Authentication failed: Invalid credentials",
  "consecutive_failures": 0,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "metadata": {}
}

Headers

Authorization
string
required

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Path Parameters

connection_identifier
string
required

Connection identifier - either connection ID (conn_...) or name. The system will automatically resolve names to IDs.

Body

application/json

Request payload for updating storage connection metadata.

Allows partial updates to connection metadata without changing credentials. Credentials can be updated via provider_config.

What You Can Update:

  • Connection name and description
  • Metadata tags
  • Status (active/suspended)
  • Provider credentials (via provider_config)

Examples:

# Update name and description
{
"name": "Updated Drive Name",
"description": "New description"
}

# Suspend connection
{
"status": "suspended",
"is_active": False
}

# Refresh credentials
{
"provider_config": {
"credentials": {...}
}
}
name
string | null

OPTIONAL. New name for the connection. Must be unique within the organization if provided. Format: 1-100 characters.

Required string length: 1 - 100
Example:

"Updated Drive Name"

description
string | null

OPTIONAL. New description for the connection. Set to empty string to clear existing description. Format: Up to 500 characters.

Maximum string length: 500
metadata
Metadata · object

OPTIONAL. New metadata dictionary. Replaces existing metadata entirely (partial updates not supported). Set to empty dict {} to clear all metadata.

status
enum<string> | null

OPTIONAL. New operational status. ACTIVE: Connection is healthy and ready for use. SUSPENDED: Temporarily disabled, credentials preserved. FAILED: Health checks failing. ARCHIVED: Permanently retired (cannot be reactivated).

Available options:
PENDING,
IN_PROGRESS,
PROCESSING,
COMPLETED,
COMPLETED_WITH_ERRORS,
FAILED,
CANCELED,
UNKNOWN,
SKIPPED,
DRAFT,
ACTIVE,
ARCHIVED,
SUSPENDED
is_active
boolean | null

OPTIONAL. Quick boolean flag for filtering. True when status is ACTIVE, False otherwise. Automatically maintained when status changes.

provider_config
Provider Config · object

OPTIONAL. Updated provider configuration including credentials. Replaces entire provider_config (partial updates not supported). SECURITY: Sensitive fields are encrypted at rest.

Response

Successful Response

Canonical representation of an external storage provider connection.

Storage connections enable Mixpeek to access external cloud storage providers (Google Drive, S3, etc.) for automated file ingestion and synchronization. Each connection represents a configured integration with credentials, health monitoring, and usage tracking.

Lifecycle States: - ACTIVE: Connection is healthy and ready for sync operations - SUSPENDED: Temporarily disabled by user (credentials preserved) - FAILED: Health checks failing (may need credential refresh) - ARCHIVED: Permanently retired (cannot be reactivated)

Security: - Sensitive credential fields are encrypted at rest using MongoDB client-side field level encryption (CSFLE) - Credentials never appear in API responses or logs - Failed authentication attempts are logged in last_error - Consecutive failures trigger automatic suspension

Use Cases: - Connect to team Google Drive for document ingestion - Sync files from customer S3 buckets - Monitor and process uploaded media files - Schedule periodic sync operations

Health Monitoring: - Automatic health checks validate connectivity and credentials - consecutive_failures tracks authentication/network issues - Auto-disable after 5 consecutive failures to prevent lockout - last_error stores diagnostic information for debugging

internal_id
string
required

REQUIRED. Organization internal identifier for multi-tenancy scoping. All connection operations are scoped to this organization. Format: int_{24-character secure token}.

provider_type
enum<string>
required

REQUIRED. Storage provider implementation to use. Determines which client adapter is loaded for sync operations. Must be one of: google_drive, s3. See StorageProvider enum for full list.

Available options:
google_drive,
s3
provider_config
GoogleDriveConfig · object
required

REQUIRED. Provider-specific configuration payload including credentials. Type depends on provider_type (GoogleDriveConfig, S3Config, etc.). SECURITY: Sensitive credential fields are encrypted at rest via MongoDB client-side field level encryption (CSFLE). Credentials never appear in API responses or logs. See provider_configs.py for detailed schemas.

Example:
{
"credentials": {
"client_email": "[email protected]",
"client_id": "123456789012345678901",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"private_key_id": "a1b2c3d4e5f6...",
"project_id": "mixpeek-prod-456",
"type": "service_account"
},
"description": "Service account accessing shared drive",
"provider_type": "google_drive",
"shared_drive_id": "0AH-Xabc123def456"
}
name
string
required

REQUIRED. Human-readable connection name for identification. Displayed in dashboards, sync logs, and API responses. Must be unique within the organization for clarity. Format: 1-100 characters, descriptive of the connection's purpose.

Required string length: 1 - 100
created_by_user_id
string
required

REQUIRED. User identifier of the user who created this connection. Used for audit trails and permission checks. Format: usr_{15-character alphanumeric}. Immutable after creation.

connection_id
string

Unique identifier for the storage connection. Auto-generated with 'conn_' prefix followed by secure random token. Format: conn_{15-character alphanumeric}. Used for API operations and audit trails.

description
string | null

NOT REQUIRED. Optional description explaining the connection's purpose and scope. Helpful for team collaboration and documentation. Format: Up to 500 characters.

Maximum string length: 500
Example:

"Shared drive for marketing team assets and campaign materials"

status
enum<string>
default:ACTIVE

Operational status of the connection. ACTIVE: Connection is healthy and ready for use in sync operations. SUSPENDED: Temporarily disabled by user, credentials preserved but sync paused. FAILED: Health checks failing, credentials may be invalid or expired. ARCHIVED: Permanently retired, cannot be reactivated. Status transitions automatically based on health checks and user actions.

Available options:
PENDING,
IN_PROGRESS,
PROCESSING,
COMPLETED,
COMPLETED_WITH_ERRORS,
FAILED,
CANCELED,
UNKNOWN,
SKIPPED,
DRAFT,
ACTIVE,
ARCHIVED,
SUSPENDED
is_active
boolean
default:true

Quick boolean flag for filtering active connections in queries. True when status is ACTIVE, False for SUSPENDED/FAILED/ARCHIVED. Maintained automatically when status changes. Use for efficient filtering: db.connections.find({'is_active': True})

last_used_at
string<date-time> | null

NOT REQUIRED. UTC timestamp of the most recent successful sync operation. Updated automatically after each successful file sync/list operation. None if connection has never been used. Useful for identifying stale connections and usage analytics.

last_error
string | null

NOT REQUIRED. Most recent error message from failed health check or sync. Populated when authentication fails, network errors occur, or permissions denied. None when connection is healthy. Format: Error message truncated to 1000 characters. Used for diagnostics and troubleshooting.

Maximum string length: 1000
Example:

"Authentication failed: Invalid credentials"

consecutive_failures
integer
default:0

Counter tracking consecutive failed health checks or sync attempts. Incremented on each failure, reset to 0 on success. Used to implement automatic connection suspension. Auto-suspend after 5 consecutive failures to prevent account lockout. Range: 0 to infinity (typically 0-10).

Required range: x >= 0
created_at
string<date-time>

UTC timestamp when the connection was created. Auto-generated using shared.utilities.helpers.current_time(). Immutable after creation. Format: ISO 8601 datetime.

updated_at
string<date-time>

UTC timestamp of the most recent update to the connection. Updated automatically on any field modification. Tracks configuration changes, status updates, and credential refreshes. Format: ISO 8601 datetime.

metadata
Metadata · object

Arbitrary key-value metadata provided by the user. Useful for tagging, categorization, and custom annotations. NOT REQUIRED - defaults to empty dictionary. Common uses: team tags, cost center codes, project identifiers.