---
title: "Update the business SMTP transport settings"
description: "Omit password to keep the stored one; send an empty string to clear it."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/webhooks/update-the-business-smtp-transport-settings"
---
# Update the business SMTP transport settings

> Omit password to keep the stored one; send an empty string to clear it.

<api-operation method="PATCH" path="/v1/businesses/{biz}/emails/smtp">
<template v-slot:docs="">

Omit `password` to keep the stored one; send an empty string to clear it. Enabling SMTP requires host, port and a password.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
</tbody>
</table>

## Headers

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is **required**.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        enabled
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Whether the business sends email through its own SMTP server.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        host
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The SMTP server's host name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        port
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The SMTP server's port.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        encryption
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The connection's encryption: <code>
        tls
      </code>
      
      , <code>
        starttls
      </code>
      
       or <code>
        none
      </code>
      
      . One of <code>
        tls
      </code>
      
      , <code>
        starttls
      </code>
      
      , <code>
        none
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        username
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The SMTP user name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        password
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The SMTP password. It is stored encrypted and never returned.
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        smtp_settings
      </code>
      
      . One of <code>
        smtp_settings
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        enabled
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      When false, this business sends through the deployment-wide MAILER_PROVIDER.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        host
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The SMTP server's host name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        port
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The SMTP server's port.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        encryption
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      tls = implicit TLS (usually 465); starttls = required upgrade (usually 587); none = unencrypted, local sinks only. One of <code>
        tls
      </code>
      
      , <code>
        starttls
      </code>
      
      , <code>
        none
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        username
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The SMTP user name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        password_configured
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether a password is stored. The password itself is never returned.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        effective_transport
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What will actually carry this business’s mail, after the business setting and the deployment MAILER_PROVIDER are both resolved. One of <code>
        smtp
      </code>
      
      , <code>
        esp
      </code>
      
      , <code>
        console
      </code>
      
      , <code>
        unconfigured
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        delivers
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether mail reaches a real relay. False for the console dev sink, which still marks messages sent.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        effective_from_address
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The From address the engine will actually use: this business’s email_config.fromAddress, or the deployment MAIL_FROM when it is blank.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        effective_from_name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The From display name actually used: email_config.fromName, or the deployment MAIL_FROM_NAME. NOT the business name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        from_source
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Whether the resolved identity came from this business or from the deployment default. One of <code>
        business
      </code>
      
      , <code>
        platform
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Updated
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Invalid SMTP settings
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such business
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X PATCH "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/emails/smtp" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false,
    "host": "smtp.example.com"
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "smtp_settings",
  "enabled": false,
  "host": "smtp.example.com",
  "port": 1,
  "encryption": "tls",
  "username": "billing@example.com",
  "password_configured": false,
  "effective_transport": "smtp",
  "delivers": false,
  "effective_from_address": "billing@example.com",
  "effective_from_name": "Brightwater Analytics",
  "from_source": "business"
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid SMTP settings"
  }
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such business"
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
