The Import Project endpoint is the starting point for every new application on the platform. It creates a project record linked to a GitHub repository, optionally stores encrypted environment variables, registers a GitHub webhook so future pushes automatically trigger deployments, and then queues an initial deployment against the specified default branch — all in a single atomic request.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/deploy-your-app/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/v1/projects/import
Authentication
This endpoint requires an active session and a connected GitHub account. Your GitHub OAuth access token is retrieved from the database and used to register the webhook on your behalf. See Authentication for details on obtaining a session token.
Request
Body Parameters
Full GitHub repository identifier in
owner/repo format, e.g. "acme/my-nextjs-app". This must be a repository the authenticated GitHub account has access to.The branch to use for production deployments and the initial build, e.g.
"main" or "production".Human-readable display name for the project as it will appear in the dashboard.
Custom build command to override auto-detection, e.g.
"npm run build". If omitted or null, the platform will detect the framework and choose an appropriate build command automatically.Custom start command to override auto-detection, e.g.
"node dist/server.js". If omitted or null, auto-detection is used.Path to the application root within the repository, e.g.
"apps/web". Defaults to the repository root if omitted.List of environment variables to store with the project. Defaults to an empty array if omitted.Each item must have:
key(string) — environment variable name.value(string) — plaintext environment variable value (encrypted before storage — see note below).
Webhook registration: Upon successful project creation, the platform automatically registers a
push event webhook in the GitHub repository using your OAuth access token. This webhook enables automatic deployments whenever commits are pushed to any tracked branch.Environment variable encryption: All
value fields in the envs array are encrypted using the platform’s master encryption key before being written to the database. Values returned from subsequent API calls will be in their encrypted form. Never store plaintext secrets outside of this endpoint’s request body.Response
A successful200 OK response returns both the newly created project and the initial deployment record:
Response Fields
The newly created project record.
The initial deployment record that was queued immediately after project creation.
Example
Error Responses
| Status | Error Message | Description |
|---|---|---|
400 | "Missing required fields" | One or more of repositoryFullName, defaultBranch, or name were absent. |
401 | "Unauthorized" | No valid session cookie was provided. |
401 | "No GitHub access token found" | The authenticated user has not connected a GitHub account. |
500 | "Internal server error" | An unexpected server-side error occurred (e.g. webhook registration failure). |