Deployments

Redeploy

Rebuilds an existing deployment using the same branch and project configuration. Use this to refresh a preview after new commits or to provide a fresh repository token.

When to use redeploy vs. create

  • Use redeploy when you want to rebuild from the same deployment record (keeps the same deployment ID and project link).
  • Use create when you want a brand-new deployment record (e.g. for a different branch or a new PR).

Fresh token for private repos

If the original repoUrl embedded a short-lived token (e.g. a GitHub Actions GITHUB_TOKEN), pass a fresh repoUrl with a new token. If omitted and the deployment is linked to a project, the project's GitHub repo is used.

Environment variables

Merged in this order (highest priority last): project env vars → body envVars. PORT is always set to 3000.

post/api/v1/deployments/{id}/redeploy

Request

  • Base URL: https://previewdrop.dev
  • URL: https://previewdrop.dev/api/v1/deployments/{id}/redeploy
  • Auth: HTTP bearer

Path parameters

idstring uuid required
Example:a1b2c3d4-e5f6-7890-abcd-ef1234567890

UUID of the deployment to rebuild.

Request body

repoUrlstring uri

Public HTTPS clone URL on github.com, gitlab.com or bitbucket.org to override the source for this rebuild — credentials embedded in the URL are not supported. If omitted, the URL is derived from the linked project with the workspace's own provider credentials.

envVarsobject

Additional or overriding env vars for this rebuild. Merged on top of project env vars.

ttlMsinteger

Override the preview TTL for this rebuild. Defaults to plan TTL if omitted.

githubTokenstring

A GitHub personal access token or installation token for cloning private repos via repoUrl. The token is embedded in the clone URL sent to the build worker and is never stored.

Example request

{
  "repoUrl": "https://github.com/acme/my-app.git",
  "envVars": {
    "FEATURE_FLAG_X": "true"
  },
  "ttlMs": 3600000,
  "githubToken": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Response

Rebuild triggered. The deployment status resets to building.

Example response

{
  "deployment": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "tenant_id": "f0e1d2c3-b4a5-6789-0abc-def123456789",
    "project_id": "11223344-5566-7788-99aa-bbccddeeff00",
    "pd_projects": {
      "github_repo": "acme/my-app"
    },
    "worker_deploy_id": "abc123def456",
    "url": "https://prv-abc123.previews.previewdrop.dev",
    "status": "ready",
    "framework": "nextjs",
    "branch": "feat/new-checkout",
    "detected_env_vars": [
      "DATABASE_URL",
      "NEXT_PUBLIC_API_URL"
    ],
    "build_log": "[1/4] Installing dependencies...\n[2/4] Building application...",
    "expires_at": "2026-04-09T14:00:00.000Z",
    "created_at": "2026-04-09T10:00:00.000Z",
    "updated_at": "2026-04-09T10:03:42.000Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.