Sending Domains

Sending domains are a core part of Emailit for Marketers On this page, we'll dive into the different sending domain endpoints you can use to manage sending domains programmatically. We'll look at how to query, create, update, and delete sending domains.

The sending domain model

The sending domain model contains all the information about your sending domain.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the sending domain.

  • Name
    name
    Type
    string
    Description

    Domain name of the sending domain. Example: emailit.com.

  • Name
    dns_checked_at
    Type
    date
    Description

    The timestamp of when the DNS was last checked.

  • Name
    spf_status
    Type
    string
    Description

    The status of the SPF record.

  • Name
    spf_error
    Type
    string
    Description

    The error message of the SPF record.

  • Name
    dkim_status
    Type
    string
    Description

    The status of the DKIM record.

  • Name
    dkim_error
    Type
    string
    Description

    The error message of the DKIM record.

  • Name
    mx_status
    Type
    string
    Description

    The status of the MX record.

  • Name
    mx_error
    Type
    string
    Description

    The error message of the MX record.

  • Name
    dmarc_status
    Type
    string
    Description

    The status of the DMARC record.

  • Name
    dmarc_error
    Type
    string
    Description

    The error message of the DMARC record.

  • Name
    return_path_status
    Type
    string
    Description

    The status of the return path.

  • Name
    return_path_error
    Type
    string
    Description

    The error message of the return path.

  • Name
    dns_records
    Type
    array
    Description

    The DNS records of the sending domain.

  • Name
    last_used_at
    Type
    date
    Description

    The timestamp of when the credential was last used.

  • Name
    created_at
    Type
    date
    Description

    The timestamp of when the credential was created.

  • Name
    updated_at
    Type
    date
    Description

    The timestamp of when the credential was last updated.


GET/v1/sending-domains

List all sending domains

This endpoint allows you to retrieve a paginated list of all your sending domains. By default, a maximum of 25 sending domains are shown per page.

Optional attributes

  • Name
    per_page
    Type
    integer
    Description

    Limit the number of sending domains returned.

  • Name
    page
    Type
    integer
    Description

    The page number to retrieve.

  • Name
    filter[name]
    Type
    string
    Description

    Filter sending domains by name.

Request

GET
/v1/sending-domains
curl -G https://api.emailit.com/v1/sending-domains \
   -H 'Authorization: Bearer {api_key}' \
   -H 'Content-Type: application/json' \
   -d $'{
     "per_page": 25,
     "page": 1,
     "filter[name]": "emailit.com",
   }'

Response

{
  "data": [
    {
      "id": "WAz8eIbvDR60rouK",
      "name": "emailit.com",
      "dns_checked_at": "2024-09-26T08:16:03.000000Z",
      "created_at": "2024-09-26T08:16:03.000000Z",
      "updated_at": "2024-09-26T08:16:03.000000Z"
    },
    {
      "id": "hSIhXBhNe8X1d8Et",
      "name": "example.com",
      ...
    }
  ]
}

POST/v1/sending-domains

Create an sending domain

This endpoint allows you to add a new sending domain to your account. To add a sending domain, you must provide its name.

Required attributes

  • Name
    name
    Type
    string
    Description

    The domain name for the sending domain.

Request

POST
/v1/sending-domains
curl https://api.emailit.com/v1/sending-domains \
  -H "Authorization: Bearer {api_key}" \
  -H 'Content-Type: application/json' \
  -d $'{
    "name": "emailit.com"
  }'

Response

{
  "id": "WAz8eIbvDR60rouK",
  "name": "emailit.com",
  "dns_checked_at": "2024-09-26T08:16:03.000000Z",
  "created_at": "2024-09-26T08:16:03.000000Z",
  "updated_at": "2024-09-26T08:16:03.000000Z"
}

GET/v1/sending-domains/:id

Retrieve an sending domain

This endpoint allows you to retrieve a sending domain by providing its id. Refer to the list at the top of this page to see which properties are included with sending domain objects.

Request

GET
/v1/sending-domains/WAz8eIbvDR60rouK
curl https://api.emailit.com/v1/sending-domains/WAz8eIbvDR60rouK \
  -H "Authorization: Bearer {api_key}" \
  -H "Content-Type: application/json"

Response

{
  "id": "WAz8eIbvDR60rouK",
  "name": "emailit.com",
  "dns_checked_at": "2024-09-26T08:16:03.000000Z",
  "created_at": "2024-09-26T08:16:03.000000Z",
  "updated_at": "2024-09-26T08:16:03.000000Z"
}

post/v1/sending-domains/:id/check

Check DNS records of a sending domain

This endpoint allows you to perform a DNS check on an sending domain.

Request

POST
/v1/sending-domains/WAz8eIbvDR60rouK/check
curl -X POST https://api.emailit.com/v1/sending-domains/WAz8eIbvDR60rouK/check \
  -H "Authorization: Bearer {api_key}" \
  -H "Content-Type: application/json"

Response

{
  "id": "WAz8eIbvDR60rouK",
  "name": "emailit.com",
  "dns_checked_at": "2024-09-26T08:16:03.000000Z",
  "spf_status": "ok",
  "spf_error": null,
  "dkim_status": "ok",
  "dkim_error": null,
  "mx_status": "ok",
  "mx_error": null,
  "dmarc_status": "ok",
  "dmarc_error": null,
  "return_path_status": "missing",
  "return_path_error": null,
  "dns_records": []
}

DELETE/v1/sending-domains/:id

Delete a sending domain

This endpoint allows you to delete an sending domain. There always have to be at least one sending domain in your account.

Request

DELETE
/v1/sending-domains/WAz8eIbvDR60rouK
curl -X DELETE https://api.emailit.com/v1/sending-domains/WAz8eIbvDR60rouK \
  -H "Authorization: Bearer {api_key}"
  -H "Content-Type: application/json"

Was this page helpful?