AgentMail domains API

The domains API from AgentMail — 4 operation(s) for domains.

OpenAPI Specification

agentmail-domains-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference agent domains API
  version: 1.0.0
servers:
- url: https://api.agentmail.to
  description: prod
- url: https://x402.api.agentmail.to
  description: prod-x402
- url: https://mpp.api.agentmail.to
  description: prod-mpp
- url: https://api.agentmail.eu
  description: eu-prod
tags:
- name: domains
paths:
  /v0/domains:
    get:
      operationId: list
      summary: List Domains
      description: '**CLI:**

        ```bash

        agentmail domains list

        ```'
      tags:
      - domains
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/type_:Limit'
      - name: page_token
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/type_:PageToken'
      - name: ascending
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/type_:Ascending'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_domains:ListDomainsResponse'
    post:
      operationId: create
      summary: Create Domain
      description: '**CLI:**

        ```bash

        agentmail domains create --domain example.com

        ```'
      tags:
      - domains
      parameters:
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_domains:Domain'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:ValidationErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_domains:CreateDomainRequest'
  /v0/domains/{domain_id}:
    get:
      operationId: get
      summary: Get Domain
      description: '**CLI:**

        ```bash

        agentmail domains get --domain-id <domain_id>

        ```'
      tags:
      - domains
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_domains:DomainId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_domains:Domain'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:ErrorResponse'
    patch:
      operationId: update
      summary: Update Domain
      description: '**CLI:**

        ```bash

        agentmail domains update --domain-id <domain_id>

        ```'
      tags:
      - domains
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_domains:DomainId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_domains:Domain'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_domains:UpdateDomainRequest'
    delete:
      operationId: delete
      summary: Delete Domain
      description: '**CLI:**

        ```bash

        agentmail domains delete --domain-id <domain_id>

        ```'
      tags:
      - domains
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_domains:DomainId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:ErrorResponse'
  /v0/domains/{domain_id}/zone-file:
    get:
      operationId: get-zone-file
      summary: Get Zone File
      description: '**CLI:**

        ```bash

        agentmail domains get-zone-file --domain-id <domain_id>

        ```'
      tags:
      - domains
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_domains:DomainId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response with status 200
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:ErrorResponse'
  /v0/domains/{domain_id}/verify:
    post:
      operationId: verify
      summary: Verify Domain
      description: '**CLI:**

        ```bash

        agentmail domains verify --domain-id <domain_id>

        ```'
      tags:
      - domains
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_domains:DomainId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:ErrorResponse'
components:
  schemas:
    type_domains:SubdomainsEnabled:
      type: boolean
      description: 'Allow inboxes on any subdomain of this domain. Adds a required wildcard MX

        record (`*.<domain>`) to `records`.'
      title: SubdomainsEnabled
    type_domains:Domain:
      type: object
      properties:
        pod_id:
          $ref: '#/components/schemas/type_pods:PodId'
        domain_id:
          $ref: '#/components/schemas/type_domains:DomainId'
        domain:
          $ref: '#/components/schemas/type_domains:DomainName'
        status:
          $ref: '#/components/schemas/type_domains:Status'
        feedback_enabled:
          $ref: '#/components/schemas/type_domains:FeedbackEnabled'
        subdomains_enabled:
          $ref: '#/components/schemas/type_domains:SubdomainsEnabled'
        records:
          type: array
          items:
            $ref: '#/components/schemas/type_domains:VerificationRecord'
          description: 'A list of DNS records required to verify the domain. Includes a

            wildcard MX record (`*.<domain>`) when `subdomains_enabled` is true.'
        client_id:
          $ref: '#/components/schemas/type_domains:ClientId'
        updated_at:
          type: string
          format: date-time
          description: Time at which the domain was last updated.
        created_at:
          type: string
          format: date-time
          description: Time at which the domain was created.
      required:
      - domain_id
      - domain
      - status
      - feedback_enabled
      - subdomains_enabled
      - records
      - updated_at
      - created_at
      title: Domain
    type_domains:UpdateDomainRequest:
      type: object
      properties:
        feedback_enabled:
          $ref: '#/components/schemas/type_domains:FeedbackEnabled'
        subdomains_enabled:
          $ref: '#/components/schemas/type_domains:SubdomainsEnabled'
      description: 'Provide at least one of `feedback_enabled` or `subdomains_enabled`. Omitted

        fields are left unchanged; an empty body is rejected. Enabling

        `subdomains_enabled` on a verified domain returns it to `PENDING` until the

        newly-required wildcard MX record (`*.<domain>`) is published and verified.'
      title: UpdateDomainRequest
    type_domains:VerificationRecord:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/type_domains:RecordType'
          description: The type of the DNS record.
        name:
          type: string
          description: The name or host of the record.
        value:
          type: string
          description: The value of the record.
        status:
          $ref: '#/components/schemas/type_domains:RecordStatus'
          description: The verification status of this specific record.
        priority:
          type: integer
          description: The priority of the MX record.
      required:
      - type
      - name
      - value
      - status
      title: VerificationRecord
    type_domains:DomainItem:
      type: object
      properties:
        pod_id:
          $ref: '#/components/schemas/type_pods:PodId'
        domain_id:
          $ref: '#/components/schemas/type_domains:DomainId'
        domain:
          $ref: '#/components/schemas/type_domains:DomainName'
        feedback_enabled:
          $ref: '#/components/schemas/type_domains:FeedbackEnabled'
        subdomains_enabled:
          $ref: '#/components/schemas/type_domains:SubdomainsEnabled'
        client_id:
          $ref: '#/components/schemas/type_domains:ClientId'
        updated_at:
          type: string
          format: date-time
          description: Time at which the domain was last updated.
        created_at:
          type: string
          format: date-time
          description: Time at which the domain was created.
      required:
      - domain_id
      - domain
      - feedback_enabled
      - subdomains_enabled
      - updated_at
      - created_at
      title: DomainItem
    type_domains:RecordType:
      type: string
      enum:
      - TXT
      - CNAME
      - MX
      title: RecordType
    type_pods:PodId:
      type: string
      description: ID of pod.
      title: PodId
    type_:Count:
      type: integer
      description: Number of items returned.
      title: Count
    type_:ErrorCode:
      type: string
      description: Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
      title: ErrorCode
    type_domains:Status:
      $ref: '#/components/schemas/type_domains:VerificationStatus'
      description: The verification status of the domain.
      title: Status
    type_domains:RecordStatus:
      type: string
      enum:
      - MISSING
      - INVALID
      - VALID
      title: RecordStatus
    type_domains:ListDomainsResponse:
      type: object
      properties:
        count:
          $ref: '#/components/schemas/type_:Count'
        limit:
          $ref: '#/components/schemas/type_:Limit'
        next_page_token:
          $ref: '#/components/schemas/type_:PageToken'
        domains:
          type: array
          items:
            $ref: '#/components/schemas/type_domains:DomainItem'
          description: Ordered by `created_at` descending.
      required:
      - count
      - domains
      title: ListDomainsResponse
    type_domains:DomainId:
      type: string
      description: The ID of the domain.
      title: DomainId
    type_domains:ClientId:
      type: string
      description: Client ID of domain.
      title: ClientId
    type_domains:DomainName:
      type: string
      description: The name of the domain (e.g., `example.com`).
      title: DomainName
    type_:ValidationErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type_:ErrorName'
        code:
          $ref: '#/components/schemas/type_:ErrorCode'
        message:
          $ref: '#/components/schemas/type_:ErrorMessage'
        errors:
          description: Validation errors. Each entry has a path and a message identifying the invalid field.
        fix:
          $ref: '#/components/schemas/type_:ErrorFix'
        docs:
          $ref: '#/components/schemas/type_:ErrorDocs'
      required:
      - name
      - errors
      title: ValidationErrorResponse
    type_:ErrorFix:
      type: string
      description: The concrete next action that resolves the error.
      title: ErrorFix
    type_:ErrorMessage:
      type: string
      description: Error message.
      title: ErrorMessage
    type_:Limit:
      type: integer
      description: Limit of number of items returned.
      title: Limit
    type_domains:VerificationStatus:
      type: string
      enum:
      - NOT_STARTED
      - PENDING
      - INVALID
      - FAILED
      - VERIFYING
      - VERIFIED
      title: VerificationStatus
    type_domains:CreateDomainRequest:
      type: object
      properties:
        domain:
          $ref: '#/components/schemas/type_domains:DomainName'
        feedback_enabled:
          $ref: '#/components/schemas/type_domains:FeedbackEnabled'
        subdomains_enabled:
          $ref: '#/components/schemas/type_domains:SubdomainsEnabled'
      required:
      - domain
      title: CreateDomainRequest
    type_:PageToken:
      type: string
      description: Page token for pagination.
      title: PageToken
    type_:ErrorName:
      type: string
      description: Name of error.
      title: ErrorName
    type_:ErrorDocs:
      type: string
      description: Link to the error reference entry for this code.
      title: ErrorDocs
    type_:ErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type_:ErrorName'
        code:
          $ref: '#/components/schemas/type_:ErrorCode'
        message:
          $ref: '#/components/schemas/type_:ErrorMessage'
        fix:
          $ref: '#/components/schemas/type_:ErrorFix'
        docs:
          $ref: '#/components/schemas/type_:ErrorDocs'
      required:
      - name
      - message
      title: ErrorResponse
    type_:Ascending:
      type: boolean
      description: Sort in ascending temporal order.
      title: Ascending
    type_domains:FeedbackEnabled:
      type: boolean
      description: Bounce and complaint notifications are sent to your inboxes.
      title: FeedbackEnabled
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer