# list_deployments

Source: https://modulify.ai/docs/api/publishing/list-deployments

Lists the past publishes of a site, newest first, with their status and timings.

- Title: List past publishes
- Scope: `sites:read`
- Access: Read only
- Endpoint: `POST /v1/list_deployments`

One call returns at most 10 publishes, and the response reports the total, in `count` over the [HTTP API](https://modulify.ai/docs/api) and in its first line over MCP, so page with `offset` 10, 20 and so on. Each row carries its `_id`, `Status`, `Error`, `Build_Id`, `Deployment_Started_At`, `Deployment_Finished_At`, `Created_At` and `DeployHook`.

A row whose `Status` is `ready` went live. `failed` and `cancelled` are the other endings, and any other status belongs to a publish still running or one that never finished.

A publish started through a [deploy hook](https://modulify.ai/docs/automations/deploy-hooks) that still exists carries `DeployHook` with the name of that hook. `DeployHook` is null for every other publish, including one started by a hook that has since been deleted, so a null `DeployHook` does not prove a member started the publish.

Build logs and the file list are deliberately left out. Read the build output of a publish with `get_publish_logs`, and use `get_publish_status` for the publish happening now. See [Publish history](https://modulify.ai/docs/publish/publish-history).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/list_deployments`, sending the inputs below as a JSON object. The token needs the `sites:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/list_deployments \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","workspaceId":"WORKSPACE_ID"}'
```

Over MCP, the same method is the [list_deployments tool](https://modulify.ai/docs/mcp/publishing/list-deployments).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `workspaceId` | string | Yes | The workspace the site belongs to. |
| `offset` | integer | No | How many publishes to skip. Pages are 10 long, so use `0`, then `10`, then `20`. Defaults to `0`. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.