# List function deployments

> List a function's deployment history, newest first. Source code is omitted; fetch a single deployment via GET /v1/functions/deployments/{deploymentId} for full details.

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

List a function's deployment history, newest first. Source code is omitted; fetch a single deployment via GET /v1/functions/deployments/{deploymentId} for full details.

## Parameters

- `functionId` (path, string, required): Zavu Function ID.
- `limit` (query, integer)

## Responses

### 200

Deployment history.

- `deployments` (object[], required)
  - `id` (string)
  - `version` (integer)
  - `status` (string): Stage of a function deployment. One of: `pending`, `bundling`, `uploading`, `publishing`, `active`, `failed`, `superseded`.
  - `bundleSizeBytes` (integer, nullable)
  - `errorMessage` (string, nullable)
  - `isActive` (boolean)
  - `deployedAt` (string<date-time>, nullable): When the deployment went live. Null for a deployment that failed or is still building.
  - `createdAt` (string<date-time>)

### 401

Unauthorized.

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

### 404

Function not found.

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

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/functions/function_abc123/deployments" \
  -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.listDeployments("function_abc123");

console.log(result);
```
