Skip to main content

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.

The Get Project endpoint retrieves a single project by its ID alongside two related datasets: the complete deployment history (ordered from newest to oldest) and all environment variable keys associated with the project. This is the primary endpoint for building a project detail view or monitoring deployment progress. GET /api/v1/projects/:id

Authentication

This endpoint requires an active session. Include your session cookie with every request. See Authentication for details on obtaining a session token.

Request

Path Parameters

id
string
required
The unique project ID (cuid). Obtain this from the List Projects endpoint.

Response

A successful 200 OK response returns the project with its deployments and environment variables embedded:
{
  "message": "Project fetched successfully",
  "data": {
    "project": Project & { deployments: Deployment[], envs: Env[] }
  }
}

Response Fields

message
string
Human-readable status message — "Project fetched successfully".
data
object
Wrapper object containing the result payload.

Deployment Status Reference

StatusDescription
PENDINGDeployment has been queued but not yet started.
CLONINGThe repository is being cloned from GitHub.
DETECTINGThe framework and runtime are being auto-detected.
ALLOCATINGA container port is being reserved.
BUILDINGThe application is being built inside the container.
DEPLOYINGThe built container is being started and routed.
SUCCESSDeployment completed successfully and is live.
FAILEDDeployment encountered an unrecoverable error.

Example

curl -X GET https://your-domain.com/api/v1/projects/clx4z2k0e0000abc123def456 \
  -H 'Content-Type: application/json' \
  -b 'better-auth.session_token=YOUR_SESSION_TOKEN'
Example response:
{
  "message": "Project fetched successfully",
  "data": {
    "project": {
      "id": "clx4z2k0e0000abc123def456",
      "userId": "user_01hxyz",
      "name": "My Next.js App",
      "repositoryFullName": "acme/my-nextjs-app",
      "defaultBranch": "main",
      "buildCommand": null,
      "startCommand": null,
      "rootDirectory": null,
      "deploymentUrl": "https://my-nextjs-app.your-domain.com",
      "customDomain": null,
      "customDomainVerified": false,
      "createdAt": "2024-06-01T12:00:00.000Z",
      "updatedAt": "2024-06-10T09:30:00.000Z",
      "deployments": [
        {
          "id": "clx5a3b1c0001xyz789ghi012",
          "projectId": "clx4z2k0e0000abc123def456",
          "branch": "main",
          "commitHash": "a1b2c3d4e5f6...",
          "status": "SUCCESS",
          "url": "https://my-nextjs-app.your-domain.com",
          "port": 3001,
          "logs": "Build completed in 42s...",
          "error": null,
          "createdAt": "2024-06-10T09:00:00.000Z",
          "updatedAt": "2024-06-10T09:30:00.000Z",
          "completedAt": "2024-06-10T09:30:00.000Z"
        }
      ],
      "envs": [
        {
          "id": "clx5d4e2f0002pqr345stu678",
          "key": "DATABASE_URL",
          "value": "enc:v1:...",
          "projectId": "clx4z2k0e0000abc123def456",
          "createdAt": "2024-06-01T12:00:00.000Z",
          "updatedAt": "2024-06-01T12:00:00.000Z"
        }
      ]
    }
  }
}

Error Responses

StatusError MessageDescription
401"Unauthorized"No valid session cookie was provided.
404"project not found"No project with the given ID exists, or it belongs to another user.
500"failed to fetch project"An unexpected server-side error occurred.

Build docs developers (and LLMs) love