# How do I add a domain using the Vercel API?

**Author:** Sam Ko

---

With the [Vercel API](https://vercel.com/docs/api), you can [add domains](https://vercel.com/docs/rest-api#endpoints/domains/register-or-transfer-in-a-new-domain) to your Vercel accounts by sending a [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request to this endpoint: `https://api.vercel.com/v4/domains`. To test a POST request to this endpoint, you can use the [curl](https://curl.haxx.se/) command in the terminal. You will also need to add a [testing token](https://vercel.com/account/tokens) inside your POST request.

## Personal Account

Here is an example request for adding a domain to a Vercel personal account.

`curl -X POST "https://api.vercel.com/v4/domains" \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "example.com" }'`

## Team Account

First, you will need to obtain the team ID using a GET request to this endpoint: `https://api.vercel.com/v1/teams`.

`curl"https://api.vercel.com/v1/teams"\ -H "Authorization: Bearer TOKEN"`

Here is an example request for adding a domain to a Vercel team account.

`curl -X POST "https://api.vercel.com/v4/domains?teamId=TEAM_ID" \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "example.com" }'`

> **NOTE:** Make sure to completely replace **TOKEN** and **TEAM\_ID** with their respective token and ID before making a Vercel API request.

---

[View full KB sitemap](/kb/sitemap.md)
