Move a project domain
POST
https://api.vercel.com/v1/projects/{idOrName}/domains/{domain}/moveMove one project's domain to another project. Also allows the move of all redirects pointed to that domain in the same project.
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.projects.moveProjectDomain({ idOrName: "<value>", domain: "www.example.com", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", requestBody: { projectId: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA", gitBranch: null, redirect: "foobar.com", redirectStatusCode: 307, }, });
console.log(result);}
run();Response
{ "apexName": "Example Name", "createdAt": "123", "customEnvironmentId": "example_id", "gitBranch": "string", "name": "Example Name", "projectId": "example_id", "redirect": "string", "redirectStatusCode": "301", "updatedAt": "123", "verification": [ { "domain": "string", "reason": "Customer requested refund", "type": "string", "value": "string" } ], "verified": "false"}AuthorizationbearerToken
Default authentication mechanism
200The domain was updated successfuly
A list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete
POST /projects/:idOrName/domains/:domain/verify to verify the domain. Possible challenges: - If verification.type = TXT the verification.domain will be checked for a TXT record matching verification.value.400One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.
The domain redirect is not valid
401The request is not authorized.
403You do not have permission to access this resource.
404Error
409The project is currently being transferred
410Error