How can I link to a GitHub repository while creating Vercel project using API endpoint?

Hi, Iam creating a small project which will allow users to create vercel project using API, I also want to link that project to a github repository at the time of vercel create project. I followed the docs mentioned over here https://vercel.com/docs/rest-api/endpoints/projects#create-a-new-project

https://api.vercel.com/v7/projects
{
  name: title,
  gitRepository: {
    type: 'github',
    repo: 'username/repo_name', //actual username and reponame
  },
  framework: 'nextjs',
}

when iam trying to make a request iam getting the error as shown below

{
  error: {
    code: 'bad_request',
    message: "To link a GitHub repository, you need to install the GitHub integration first. Make sure there aren't any typos and that you have access to the repository if it's private.",
    action: 'Install GitHub App',
    link: 'https://github.com/apps/vercel',
    repo: 'teeproj'
  }
}

what am i doing wrong over here, how do I fix this issue any help would be appreciated.

Thanks

Hi, Iam getting an error when using https://api.vercel.com/v7/projects API

the error i am getting is :

{
  error: {
    code: 'bad_request',
    message: "To link a GitHub repository, you need to install the GitHub integration first. Make sure there aren't any typos and that you have access to the repository if it's private.",
    action: 'Install GitHub App',
    link: 'https://github.com/apps/vercel',
    repo: 'teeproj'
  }
}

past week this api use to work fine, i didn’t have to do any thing additional in the /projects POST API Iam sending the body as shown below

{
  name: title,
  gitRepository: {
    type: 'github',
    repo: 'username/repo_name', //actual username and reponame
    sourceless: true,
  },
  framework: 'nextjs',
}

how do i fix this error any help would be appreciated
Thanks

Hi, @vivekmpuh-gmailcom! Welcome to the Vercel Community :smile:

Let’s first check your integration with Vercel - do you have this set up?

https://github.com/apps/vercel

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