# Get deployment

> Fetch a deployment to poll its status during a deploy.

`GET https://api.zavu.dev/v1/functions/deployments/{deploymentId}`

Fetch a deployment to poll its status during a deploy.

## Parameters

- `deploymentId` (path, string, required): Function deployment ID.

## Responses

### 200

Deployment details.

- `deployment` (object, required)
  - `id` (string, required)
  - `functionId` (string, required)
  - `version` (integer, required): Monotonically increasing deployment version, starting at 1.
  - `status` (string, required): Stage of a function deployment. One of: `pending`, `bundling`, `uploading`, `publishing`, `active`, `failed`, `superseded`.
  - `sourceCodeBytes` (integer, nullable): Total size of the deployed source tree in bytes.
  - `bundleBytes` (integer, nullable): Size of the built bundle in bytes. Null until the build finishes.
  - `errorMessage` (string, nullable): Failure reason when status is 'failed'.
  - `buildLogs` (string, nullable): What the build printed: dependency installation, the bundler's output, and the compiler's message when it failed. Returned when fetching a single deployment, omitted from the list. Read this first when a deploy fails — `errorMessage` is often the outer wrapper's summary, and the line that names the broken import or the syntax error is here.
  - `deployedAt` (string<date-time>, nullable)
  - `createdAt` (string<date-time>, required)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Deployment not found.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/functions/deployments/deployment_abc123" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.functions.getDeployment("deployment_abc123");

console.log(result);
```
