Give it a name like "Domain Delete Token or Thanx for Helping Man".
Set the scope to "Full Account Access" - this is important because the token needs to work for team operations.
Set an expiration date (30 days is reasonable).
Click "Create Token".
Copy the token immediately and save it somewhere safe. Vercel only shows it once and you won't be able to see it again.
LISTING PROJECTS AND ALIASES
Once you're logged in, check all aliases (domain connections) under your team.
Run this:npx vercel alias ls
This will show you all domains and subdomains that are currently aliased to deployments.
To see all your active projects, run:npx vercel project ls
Compare the two lists. If you see a domain alias pointing to a deployment that doesn't appear in your active projects list, that means the project was deleted but the alias is still there - that's an orphaned alias.
For example, if "alias ls" shows:some-deployment.vercel.app yourdomain.com 6d
But "project ls" doesn't show a project containing that deployment, the domain is orphaned and needs to be removed via API (next section).
DELETING AN ORPHANED DOMAIN VIA API
Since the CLI commands will fail with "Project not found" on orphaned domains, you need to use the API directly.
Use PowerShell and run this command:
Invoke-RestMethod -Method Delete -Uri "https://api.vercel.com/v6/domains/placeyourdomain.com?teamId=place-your-team-name-here" -Headers @{ Authorization = "Bearer PLACE_YOUR_TOKEN_HERE" }
If successful, you'll get a response like:uid: QmdVGLXhMmP4rERM6EZyi14ejMyAFMra6QXv5i4ubpDRKc
This means the domain has been deleted from your Vercel account(NOTE: This include all projects attached to it now got detached from the domain, but don worry PART 7 will help you add them back)
For the www subdomain, if you try to delete it and get a 404 "not found" response, that's normal - it means www was just an alias attached to the root domain, not a separate domain, and it was automatically removed when the root was deleted.
VERIFY THE DOMAIN IS GONE
Run this to confirm no orphaned aliases remain:npx vercel alias ls | findstr "yourdomain.com"
If nothing appears (only the CLI header and pagination message), the domain is fully removed.
ADD THE DOMAIN TO YOUR CURRENT PROJECT
Now that the domain is freed up, add it to your active project:
npx vercel domains add yourdomain.com place-project-name-here
For teams, add the scope flag:npx vercel domains add yourdomain.com place-your-team-name-here --scope then-your-team-name-here
You'll get a success message like:"Success! Domain yourdomain.com added to project your-project-name-here.""The domain will automatically get assigned to your latest production deployment."
ADDING SUBDOMAINS
For each subdomain, add it to its corresponding project:
npx vercel domains add subdomain.yourdomain.com place-your-team-name-here --scope then-your-team-name-here
If you make a typo in the domain name, first remove the incorrect one:npx vercel domains rm incorrect-domain.com --scope your-team-name
Then add the correct one.
If you get an error saying "Your project's latest production deployment has errored", you need to deploy a successful version of that project first before adding the domain else it won't work or the project should have the successful deployment currently.
Hope That Helps!😊
www.incenar.com