Ana içeriğe atla

Endpoint

PUT /apiops/projects/{projectName}/connections/{connectionName}/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name (must exist)

Request Body

Full JSON Body Example (Email Connection)

{
  "type": "email",
  "name": "my-email-connection",
  "description": "Updated email connection description",
  "deployToWorker": true,
  "enabled": true,
  "host": "smtp.gmail.com",
  "port": 587,
  "enableStartTls": true,
  "auth": true,
  "username": "[email protected]",
  "password": "new-app-password",
  "defaultEncoding": "UTF-8",
  "from": "[email protected]",
  "additionalProperties": []
}

Request Body Fields

The request body structure is identical to Create Connection. See that documentation for complete field descriptions. Important: Connection name in path parameter must match the existing connection name.
Common Fields
FieldTypeRequiredDefaultDescription
typestringYes-Connection type discriminator field. Must match the existing connection type. Used to identify the connection type in API requests/responses.
namestringYes-Connection name (must match path parameter, or new name if renaming)
descriptionstringNo-Connection description
deployToWorkerbooleanNotrueWhether to deploy to worker
enabledbooleanNotrueWhether connection is enabled
Note: Connection-specific fields vary by connection type. See individual connection type documentation for details.

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
deploymentResultobjectDeployment result (if deployToWorker=true)
deploymentResult.successbooleanDeployment success

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "Connection (name: my-email-connection) was not found!"
}

Common Causes

  • Connection name does not exist
  • Connection name in path does not match name in body (unless renaming)
  • New connection name conflicts with existing connection
  • Invalid connection type (cannot change connection type)
  • Missing required fields for connection type
  • Invalid field values

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

Error Response (404 Not Found)

{
  "error": "not_found",
  "error_description": "Project 'MyProject' not found"
}

cURL Example

Example 1: Update Connection Configuration

curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/my-email-connection/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "email",
    "name": "my-email-connection",
    "description": "Updated email connection",
    "deployToWorker": true,
    "enabled": true,
    "host": "smtp.gmail.com",
    "port": 587,
    "enableStartTls": true,
    "auth": true,
    "username": "[email protected]",
    "password": "new-app-password",
    "defaultEncoding": "UTF-8",
    "from": "[email protected]"
  }'

Example 2: Rename Connection

Rename a connection by providing a new name in the body (path parameter keeps old name).
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/old-connection-name/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "email",
    "name": "new-connection-name",
    "description": "Renamed connection",
    "deployToWorker": true,
    "enabled": true,
    "host": "smtp.gmail.com",
    "port": 587,
    "auth": true,
    "username": "[email protected]",
    "password": "password"
  }'
Note: The new name must not conflict with existing connections.

Example 3: Update and Disable

Update connection configuration and disable it.
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/my-db-connection/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "database",
    "name": "my-db-connection",
    "description": "Updated database connection - disabled",
    "deployToWorker": true,
    "enabled": false,
    "host": "localhost",
    "port": 5432,
    "databaseName": "mydb",
    "username": "dbuser",
    "password": "dbpassword"
  }'

Permissions

  • User must have CONNECTIONS + MANAGE permission in the project

Notes and Warnings

  • Name Matching: Connection name in path parameter must match the existing connection name (or new name if renaming)
  • Type Cannot Change: Connection type (type) cannot be changed. Use Delete and Create to change type.
  • Name Conflicts: If renaming, ensure the new name doesn’t conflict with existing connections
  • Secret Fields: Secret fields can be updated. Ensure you have the correct values.
  • Deployment: If deployToWorker: true, connection is automatically redeployed to workers
  • References: References to certificates or keystores can be updated by providing new names