Valimail TLS Configuration API

The TLS Configuration API from Valimail — 2 operation(s) for tls configuration.

OpenAPI Specification

valimail-tls-configuration-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Account Management Accounts TLS Configuration API
  description: ValiMail Integration API
  version: 1.0.0
servers:
- url: https://api.valimail.com
  description: API services
- url: https://api.valimail-staging.com
  description: Stage test server
- url: http://localhost:7001
  description: Local development server
security:
- bearerAuth: []
tags:
- name: TLS Configuration
paths:
  /accounts/{slug}/domains/{domain}/smtp_tls_policy:
    get:
      summary: Returns TLS-RPT (TLS Reporting) policy configuration for a domain
      tags:
      - TLS Configuration
      parameters:
      - name: slug
        in: path
        description: Account slug to be queried.
        required: true
        schema:
          type: string
        example: valimail
      - name: domain
        in: path
        description: Domain name to be queried.
        required: true
        schema:
          type: string
        example: example.com
      responses:
        '200':
          description: Ok - TLS Configuration data is provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TlsRptPolicyResponse'
        '400':
          description: Bad Request - Missing Authorization Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              example:
                request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                message: 'missing Authorization: Bearer header'
                type: ''
                request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                call: api
                status: '400'
        '401':
          description: Unauthorized - Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              examples:
                authenticationFailed:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: Unauthorized
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
                invalidSlug:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: not authorized for slug valimail
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
        '404':
          description: Not Found - Account, domain, or policy not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity - Failed to normalize or parse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultDelegatedAPIErrorResponse'
              example:
                request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                message: Invalid domain
                type: invalid-domain
                call: internal
        '429':
          description: Over Rate - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example: null
        '500':
          description: Internal Server Error - Service, database, or unclassified error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      summary: Creates a new TLS Configuration for a domain
      tags:
      - TLS Configuration
      parameters:
      - name: slug
        in: path
        description: Account slug to create a policy for.
        required: true
        schema:
          type: string
        example: valimail
      - name: domain
        in: path
        description: Domain name to create a policy for.
        required: true
        schema:
          type: string
        example: example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TlsRptPolicyRequest'
      responses:
        '200':
          description: OK - TLS Configuration created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TlsRptPolicyResponse'
        '400':
          description: Bad Request - Missing Authorization Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              example:
                request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                message: 'missing Authorization: Bearer header'
                type: ''
                request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                call: api
                status: '400'
        '401':
          description: Unauthorized - Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              examples:
                authenticationFailed:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: Unauthorized
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
                invalidSlug:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: not authorized for slug valimail
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
        '422':
          description: Unprocessable Entity - Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResponse'
              example:
                errors:
                - message: invalid-rua-format
                  details: rua must be a valid mailto URI format
        '429':
          description: Over Rate - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example: null
        '500':
          description: Internal Server Error - Service, database, or unclassified error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      summary: Updates an existing TLS Configuration for a domain
      tags:
      - TLS Configuration
      parameters:
      - name: slug
        in: path
        description: Account slug to update a policy for.
        required: true
        schema:
          type: string
        example: valimail
      - name: domain
        in: path
        description: Domain name to update a policy for.
        required: true
        schema:
          type: string
        example: example.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TlsRptPolicyUpdateRequest'
      responses:
        '200':
          description: OK - TLS Configuration updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TlsRptPolicyResponse'
        '400':
          description: Bad Request - Missing Authorization Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              example:
                request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                message: 'missing Authorization: Bearer header'
                type: ''
                request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                call: api
                status: '400'
        '401':
          description: Unauthorized - Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              examples:
                authenticationFailed:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: Unauthorized
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
                invalidSlug:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: not authorized for slug valimail
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
        '404':
          description: Not Found - Account, domain, or policy not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity - Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResponse'
              example:
                errors:
                - message: invalid-rua-format
                  details: rua must be a valid mailto URI format
        '429':
          description: Over Rate - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example: null
        '500':
          description: Internal Server Error - Service, database, or unclassified error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /accounts/{slug}/smtp_tls_policies:
    get:
      summary: Returns a list of all TLS-RPT policies for an account
      tags:
      - TLS Configuration
      parameters:
      - name: slug
        in: path
        description: Account slug to be queried.
        required: true
        schema:
          type: string
        example: valimail
      responses:
        '200':
          description: Ok - List of TLS-RPT policies for the account is provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TlsRptPoliciesListResponse'
        '400':
          description: Bad Request - Missing Authorization Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              example:
                request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                message: 'missing Authorization: Bearer header'
                type: ''
                request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                call: api
                status: '400'
        '401':
          description: Unauthorized - Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultOdinErrorResponse'
              examples:
                authenticationFailed:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: Unauthorized
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
                invalidSlug:
                  value:
                    request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                    message: not authorized for slug valimail
                    type: ''
                    request-id: CkmvjqpFKrQzajCScVFHTnokjKKiORRF
                    call: api
                    status: '401'
        '404':
          description: Not Found - Account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity - Failed to normalize or parse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultDelegatedAPIErrorResponse'
              example:
                request: /accounts/{{the_account_slug}}/domains/{{domainSlug}}/
                message: Invalid domain
                type: invalid-domain
                call: internal
        '429':
          description: Over Rate - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example: null
        '500':
          description: Internal Server Error - Service, database, or unclassified error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DefaultOdinErrorResponse:
      type: object
      properties:
        request:
          type: string
        message:
          type: string
        type:
          type: string
        request-id:
          type: string
        call:
          type: string
        status:
          type: string
    TlsRptPoliciesListResponse:
      type: object
      properties:
        domain:
          type: string
          description: Domain name
          example: example.com
        tlsrpt-policy:
          type: object
          properties:
            tlsrpt-version:
              type: string
              enum:
              - TLSRPTv1
              description: TLS-RPT version
              example: TLSRPTv1
            tlsrpt-rua:
              type: array
              description: Reporting URIs for TLS failure reports (mailto format)
              example:
              - mailto:tls-reports@example.com
              items:
                type: string
                format: uri
                pattern: '^mailto:'
        created-at:
          type: string
          format: date-time
          description: Creation timestamp
        updated-at:
          type: string
          format: date-time
          description: Last update timestamp
    TlsRptPolicyUpdateRequest:
      type: object
      properties:
        rua-uris:
          type: array
          description: Reporting URIs for TLS failure reports
          example:
          - mailto:tls-reports@example.com
          - mailto:security@example.com
          items:
            type: string
            format: uri
            pattern: '^mailto:'
    TlsRptPolicyResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            domain:
              type: string
              description: Domain name
              example: example.com
            tlsrpt-policy:
              type: object
              properties:
                tlsrpt-version:
                  type: string
                  enum:
                  - TLSRPTv1
                  description: TLS-RPT version
                  example: TLSRPTv1
                tlsrpt-rua:
                  type: array
                  description: Reporting URIs for TLS failure reports (mailto format)
                  example:
                  - mailto:tls-reports@example.com
                  items:
                    type: string
                    format: uri
                    pattern: '^mailto:'
            created-at:
              type: string
              format: date-time
              description: Creation timestamp
            updated-at:
              type: string
              format: date-time
              description: Last update timestamp
    DefaultDelegatedAPIErrorResponse:
      type: object
      properties:
        request:
          type: string
        message:
          type: string
        type:
          type: string
        call:
          type: string
    TlsRptPolicyRequest:
      type: object
      required:
      - rua
      properties:
        rua-uris:
          type: array
          description: Reporting URIs for TLS failure reports
          example:
          - mailto:tls-reports@example.com
          - mailto:security@example.com
          items:
            type: string
            format: uri
            pattern: '^mailto:'
    ValidationResponse:
      type: object
      properties:
        params:
          $ref: '#/components/schemas/Any'
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationDetail'
    ErrorResponse:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/Any'
        message:
          type: string
        type:
          type: string
        request-id:
          type: string
        call:
          type: string
    Any: {}
    ValidationDetail:
      type: object
      properties:
        field:
          type: string
        value:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT