---
updatedAt: 2026-05-26T14:23:39.000Z
agentTools:
  projectIndex: https://docs.getgreenspark.com/llms.txt
---

# Add Domain

Add your domain and receive the DNS records that must be added to your domain.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/v2/email/domains": {
      "post": {
        "description": "Add your domain and receive the DNS records that must be added to your domain.",
        "operationId": "addDomainV2",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomDomainRequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain has been successfully added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request."
          },
          "401": {
            "description": "Provide your API key."
          },
          "403": {
            "description": "Please upgrade to a growth, premium or enterprise plan."
          },
          "404": {
            "description": "Not found."
          }
        },
        "security": [
          {
            "access-key": []
          }
        ],
        "summary": "Add Domain",
        "tags": [
          "Email"
        ]
      }
    }
  },
  "info": {
    "title": "Email",
    "description": "Manage custom email domains and notification templates. Use v2 routes; v1 routes are deprecated. Not exposed via ReadMe MCP v1 route toggles.\n\nAuthentication: `x-api-key` header (required). Create keys in the Greenspark dashboard after registration — separate key per environment.\n\nEnvironments: `https://api.getgreenspark.com` (production key) or `https://sandbox.getgreenspark.com` (sandbox key). Always match host and key.\n\nReadMe MCP (v1): `https://greenspark.readme.io/mcp` — read-only live calls on enabled GET routes. POST/PUT/DELETE are documented for integration building; use `get-endpoint` for schemas, not `execute-request` for writes.\n\nAPI keys: Accepts all standard API key types — individual routes may restrict allowed types.",
    "version": "v1",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.getgreenspark.com",
      "description": "Production environment — use a production API key with this host."
    },
    {
      "url": "https://sandbox.getgreenspark.com",
      "description": "Sandbox environment — use a sandbox API key with this host."
    },
    {
      "url": "https://demo-api.getgreenspark.com",
      "description": "Demo environment — use a demo API key with this host."
    }
  ],
  "components": {
    "securitySchemes": {
      "access-key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "RecordDto": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "The indicator of the DNS record validity.",
            "example": false
          },
          "type": {
            "type": "string",
            "description": "The type of the record that must be added to your domain.",
            "example": "cname"
          },
          "host": {
            "type": "string",
            "description": "The type of the record that must be added to your domain.",
            "example": "em43944.example.com"
          },
          "data": {
            "type": "string",
            "description": "The value of the record that must be added to your domain.",
            "example": "u250887955.wl0466.sendgrid.net"
          }
        },
        "required": [
          "valid",
          "type",
          "host",
          "data"
        ]
      },
      "DnsDto": {
        "type": "object",
        "properties": {
          "mailCname": {
            "description": "Record that must be added to your domain.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordDto"
              }
            ]
          },
          "dkim1": {
            "description": "Record that must be added to your domain.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordDto"
              }
            ]
          },
          "dkim2": {
            "description": "Record that must be added to your domain.",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordDto"
              }
            ]
          }
        },
        "required": [
          "mailCname",
          "dkim1",
          "dkim2"
        ]
      },
      "CustomDomainDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The id of the custom domain object.",
            "example": "63c5857475784b9acf05c919"
          },
          "domain": {
            "type": "string",
            "description": "The domain name.",
            "example": "example.com"
          },
          "dns": {
            "description": "This object contains the DNS records that must be added to your domain.",
            "example": {
              "mailCname": {
                "valid": false,
                "type": "cname",
                "host": "em43944.example.com",
                "data": "u250887955.wl0466.sendgrid.net"
              },
              "dkim1": {
                "valid": false,
                "type": "cname",
                "host": "s1._domainkey.example.com",
                "data": "s1.domainkey.u250887955.wl0466.sendgrid.net"
              },
              "dkim2": {
                "valid": false,
                "type": "cname",
                "host": "s2._domainkey.example.com",
                "data": "s2.domainkey.u250887955.wl0466.sendgrid.net"
              }
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsDto"
              }
            ]
          },
          "valid": {
            "type": "boolean",
            "description": "The indicator of the DNS records validity.",
            "example": false
          }
        },
        "required": [
          "id",
          "domain",
          "dns",
          "valid"
        ]
      },
      "CustomDomainRequestBody": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The domain name.",
            "example": "example.com"
          }
        },
        "required": [
          "domain"
        ]
      }
    }
  }
}
```