> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailchannels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set downstream address

> Sets the list of downstream addreses for the domain. This action deletes any existing
downstream address for the domain before creating new ones. If the 'records' parameter
is an empty array, all downstream address records will be deleted.




## OpenAPI

````yaml /inbound/api-reference/openapi.yaml put /domains/{domain}/downstream-address
openapi: 3.0.3
info:
  title: Inbound API
  description: |
    Manage domains for MailChannels Inbound.

    ### Rate Limits
    This API is limited to 100 queries per second, per customer.
    Queries that exceed this rate may be rejected with the
    `503 Service Temporarily Unavailable` HTTP response.
  version: 1.3.0
servers:
  - url: https://api.mailchannels.net/inbound/v1
security:
  - APIKeyHeader: []
tags:
  - name: Domains
  - name: Lists
  - name: Recipients
  - name: Login links
  - name: Reporting
  - name: Account
paths:
  /domains/{domain}/downstream-address:
    put:
      tags:
        - Domains
      summary: Set downstream address
      description: >
        Sets the list of downstream addreses for the domain. This action deletes
        any existing

        downstream address for the domain before creating new ones. If the
        'records' parameter

        is an empty array, all downstream address records will be deleted.
      parameters:
        - name: domain
          description: The domain name.
          in: path
          required: true
          schema:
            type: string
            format: hostname
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                records:
                  type: array
                  maxItems: 10
                  items:
                    $ref: '#/components/schemas/DownstreamAddress'
      responses:
        '201':
          description: >-
            The list of downstream addresses was set to be the list submitted
            with the request.
          content:
            application/json:
              schema:
                type: object
                required:
                  - records
                properties:
                  records:
                    type: array
                    items:
                      $ref: '#/components/schemas/DownstreamAddress'
        '400':
          description: >
            Bad Request, returned in the case that an error occurs while
            converting an A-label domain to a U-label domain name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: |
            Returned in the case that the domain is associated with an api
            key that is different than the one in the request, the domain is
            associated with a different customer, or the domain in the request
            is an alias domain.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: This domain does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DownstreamAddress:
      type: object
      required:
        - priority
        - weight
        - port
        - target
      properties:
        priority:
          description: >
            The priority of the dowsntream address.  Only addresses with the
            highest priority (the lowest numerical

            value) are selected.
          type: integer
          minimum: 0
        weight:
          description: >
            Downstream addresses are selected in proportion to their weights. 
            For example, if there are two

            downstream addresses, A with weight 40, and B with weight 10, then A
            is selected 80% of the time

            and B is selected 20% of the time.
          type: integer
          minimum: 0
        port:
          description: TCP port on which the downstream mail server is listening.
          type: integer
          minimum: 0
        target:
          description: >-
            The canonical hostname of the host providing the service, ending in
            a dot.
          type: string
          maxLength: 255
    ErrorResponse:
      required:
        - errors
      properties:
        code:
          type: integer
        message:
          type: string
        errors:
          type: array
          items:
            type: string
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````