Ana içeriğe atla

General Information

Connection Type

email

UI Documentation

Endpoints

List Connections

GET /apiops/projects/{projectName}/connections/?type=email

Get Connection

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

Create Connection

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

Update Connection

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

Delete Connection

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

List Connections

Endpoint

GET /apiops/projects/{projectName}/connections/?type=email

Request

Headers

HeaderValue
AuthorizationBearer

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
Note: The type query parameter is required to filter connections by type.

cURL Example

curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get Connection

Endpoint

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

Request

Headers

HeaderValue
AuthorizationBearer

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name

Response

Success Response (200 OK)

{
  "success": true,
  "resultList": [
    {
      "type": "email",
      "name": "my-email-connection",
      "description": "Email connection for notifications",
      "deployToWorker": true,
      "enabled": true,
      "host": "smtp.example.com",
      "port": 587,
      "username": "[email protected]",
      "password": "actual-password",
      "enableStartTls": true,
      "auth": true,
      "defaultEncoding": "UTF-8",
      "addressToTest": "[email protected]",
      "from": "[email protected]",
      "additionalProperties": []
    }
  ],
  "resultCount": 1
}
Note: When getting a single connection, password is returned in full.

cURL Example

curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/my-email-connection/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Create Connection

Endpoint

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

Request

Headers

HeaderValue
AuthorizationBearer
Content-Typeapplication/json

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name (must match name in body)

Request Body

Full JSON Body Example
{
  "type": "email",
  "name": "my-email-connection",
  "description": "Email connection for sending notifications",
  "deployToWorker": true,
  "enabled": true,
  "host": "smtp.gmail.com",
  "port": 587,
  "enableStartTls": true,
  "auth": true,
  "username": "[email protected]",
  "password": "app-password",
  "defaultEncoding": "UTF-8",
  "addressToTest": "[email protected]",
  "from": "[email protected]",
  "additionalProperties": []
}
Request Body Fields
Common Fields
FieldTypeRequiredDefaultDescription
typestringYes-Connection type discriminator field. Identifies the connection type in API requests/responses.
namestringYes-Connection name (must match path parameter)
descriptionstringNo-Connection description
deployToWorkerbooleanNotrueWhether to deploy to worker
enabledbooleanNotrueWhether connection is enabled
Email-Specific Fields
FieldTypeRequiredDefaultDescription
hoststringYes-SMTP server hostname
portintegerNo587SMTP server port
enableStartTlsbooleanNofalseEnable STARTTLS
authbooleanNofalseEnable authentication
usernamestringNo*-SMTP username (required if auth=true)
passwordstringNo*-SMTP password (required if auth=true, secret field)
defaultEncodingstringNoUTF-8Default email encoding
addressToTeststringNo-Email address for testing
fromstringNo-Default sender email address
additionalPropertiesarrayNo[]Additional SMTP properties
Note: username and password are required when auth is true.

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Deployment successful"
      }
    ]
  }
}

cURL Example

curl -X POST \
  "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": "Email connection for sending notifications",
    "deployToWorker": true,
    "enabled": true,
    "host": "smtp.gmail.com",
    "port": 587,
    "enableStartTls": true,
    "auth": true,
    "username": "[email protected]",
    "password": "app-password",
    "defaultEncoding": "UTF-8",
    "from": "[email protected]"
  }'

Update Connection

Endpoint

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

Request

Headers

HeaderValue
AuthorizationBearer
Content-Typeapplication/json

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name (must match name in body)

Request Body

Full JSON Body Example
{
  "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": []
}
Note: Request body structure is the same as Create Connection.

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [...]
  }
}

cURL Example

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 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]"
  }'

Delete Connection

Endpoint

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

Request

Headers

HeaderValue
AuthorizationBearer

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [...]
  }
}

cURL Example

curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/my-email-connection/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Secret Fields: password is a secret field. Never commit it to version control
  • List vs Get: In list operations, password is returned as null. Use Get Connection to retrieve the full password
  • Authentication: If auth: true, both username and password are required
  • STARTTLS: Enable enableStartTls for secure SMTP connections (typically port 587)
  • Ports: Common SMTP ports:
    • 25 - Standard SMTP (often blocked)
    • 587 - SMTP with STARTTLS (recommended)
    • 465 - SMTP with SSL/TLS
  • Gmail: For Gmail, use an app password instead of your regular password
  • Deployment: If deployToWorker: true, connection is automatically deployed to workers
  • Name Matching: Path parameter connectionName must match the name field in the request body