Resend Domains API

Create and manage domains through the Resend API.

OpenAPI Specification

resend-domains-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Resend Domains API
  version: 1.1.0
  description: '

    Resend is transforming email for developers. Simple interface, easy

    integrations, handy templates. '
servers:
- url: https://api.resend.com
security:
- bearerAuth: []
tags:
- name: Domains
  description: Create and manage domains through the Resend API.
paths:
  /domains:
    post:
      tags:
      - Domains
      summary: Create a new domain
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDomainRequest'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDomainResponse'
    get:
      tags:
      - Domains
      summary: Retrieve a list of domains
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDomainsResponse'
  /domains/{domain_id}:
    get:
      tags:
      - Domains
      summary: Retrieve a single domain
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the domain.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Domain'
    patch:
      tags:
      - Domains
      summary: Update an existing domain
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDomainOptions'
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the domain.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDomainResponseSuccess'
    delete:
      tags:
      - Domains
      summary: Remove an existing domain
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the domain.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteDomainResponse'
  /domains/{domain_id}/verify:
    post:
      tags:
      - Domains
      summary: Verify an existing domain
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          type: string
          description: The ID of the domain.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyDomainResponse'
components:
  schemas:
    CreateDomainRequest:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          description: The name of the domain you want to create.
        region:
          type: string
          enum:
          - us-east-1
          - eu-west-1
          - sa-east-1
          default: us-east-1
          description: The region where emails will be sent from. Possible values are us-east-1' | 'eu-west-1' | 'sa-east-1
    Domain:
      type: object
      properties:
        object:
          type: string
          description: The type of object.
          example: domain
        id:
          type: string
          description: The ID of the domain.
          example: d91cd9bd-1176-453e-8fc1-35364d380206
        name:
          type: string
          description: The name of the domain.
          example: example.com
        status:
          type: string
          description: The status of the domain.
          example: not_started
        created_at:
          type: string
          format: date-time
          description: The date and time the domain was created.
          example: '2023-04-26T20:21:26.347412+00:00'
        region:
          type: string
          description: The region where the domain is hosted.
          example: us-east-1
        records:
          type: array
          items:
            $ref: '#/components/schemas/DomainRecord'
    ListDomainsItem:
      type: object
      properties:
        id:
          type: string
          description: The ID of the domain.
          example: d91cd9bd-1176-453e-8fc1-35364d380206
        name:
          type: string
          description: The name of the domain.
          example: example.com
        status:
          type: string
          description: The status of the domain.
          example: not_started
        created_at:
          type: string
          format: date-time
          description: The date and time the domain was created.
          example: '2023-04-26T20:21:26.347412+00:00'
        region:
          type: string
          description: The region where the domain is hosted.
          example: us-east-1
    VerifyDomainResponse:
      type: object
      properties:
        object:
          type: string
          description: The type of object.
          example: domain
        id:
          type: string
          description: The ID of the domain.
          example: d91cd9bd-1176-453e-8fc1-35364d380206
    UpdateDomainOptions:
      type: object
      properties:
        open_tracking:
          type: boolean
          description: Track the open rate of each email.
        click_tracking:
          type: boolean
          description: Track clicks within the body of each HTML email.
        tls:
          type: string
          description: enforced | opportunistic.
          default: opportunistic
    UpdateDomainResponseSuccess:
      type: object
      properties:
        id:
          type: string
          description: The ID of the updated domain.
          example: d91cd9bd-1176-453e-8fc1-35364d380206
        object:
          type: string
          description: The object type representing the updated domain.
          example: domain
    CreateDomainResponse:
      type: object
      properties:
        id:
          type: string
          description: The ID of the domain.
        name:
          type: string
          description: The name of the domain.
        created_at:
          type: string
          format: date-time
          description: The date and time the domain was created.
        status:
          type: string
          description: The status of the domain.
        records:
          type: array
          items:
            $ref: '#/components/schemas/DomainRecord'
        region:
          type: string
          description: The region where the domain is hosted.
    ListDomainsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ListDomainsItem'
    DomainRecord:
      type: object
      properties:
        record:
          type: string
          description: The type of record.
        name:
          type: string
          description: The name of the record.
        type:
          type: string
          description: The type of record.
        ttl:
          type: string
          description: The time to live for the record.
        status:
          type: string
          description: The status of the record.
        value:
          type: string
          description: The value of the record.
        priority:
          type: integer
          description: The priority of the record.
    DeleteDomainResponse:
      type: object
      properties:
        object:
          type: string
          description: The type of object.
          example: domain
        id:
          type: string
          description: The ID of the domain.
          example: d91cd9bd-1176-453e-8fc1-35364d380206
        deleted:
          type: boolean
          description: Indicates whether the domain was deleted successfully.
          example: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer