# get_publish_logs

Source: https://modulify.ai/docs/api/publishing/get-publish-logs

Reads the build output of a publish, which is where the reason for a failed publish actually lives.

- Title: Read the build log of a publish
- Scope: `logs:read`
- Access: Read only
- Endpoint: `POST /v1/get_publish_logs`

`get_publish_status` only says that a publish failed, and this says why. Leave out `deploymentId` for the most recent publish, or name one from `list_deployments`. A failed publish carries its `error` alongside the lines.

At most 200 lines come back per call, with `total` and `hasMore`, so page with `offset`. Only the last 1,000 lines of any build are kept at all. See [When a publish fails](https://modulify.ai/docs/publish/publish-history#when-a-publish-fails).

## Request

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

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

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

Over MCP, the same method is the [get_publish_logs tool](https://modulify.ai/docs/mcp/publishing/get-publish-logs).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `deploymentId` | string | No | A specific publish, from `list_deployments`. Leave it out for the most recent one. |
| `offset` | integer | No | How many lines to skip. The oldest kept line is `0`, which is also the default. |
| `limit` | integer | No | How many lines to return, up to 200. Defaults to 200. |

## 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.