Issue while deploying via REST API

Hi, I am trying to deploy a service using rest API but I am getting below error everytime

error: { code: ‘forbidden’, message: ‘Not authorized’, invalidToken: true }

below is my API structure that I am trying to make via nodejs

const response = await axios.post(
https://api.vercel.com/v13/deployments”,
{
name: “my-instant-deployment”,
gitSource: {
type: “github”,
repo: GITHUB_REPO, // :white_check_mark: Use “username/repo-name”
ref: BRANCH
},
target: “production”
},
{
headers: {
Authorization: Bearer ${VERCEL_API_TOKEN},
“Content-Type”: “application/json”,
}
}
);

I am using node js

Hey there,

Is there a specific reason why you aren’t using @vercel/sdk ? Vercel SDK

1 Like

Thanks @swarnava for letting know about vercel sdk, will definitely try this.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.