# get_site_environment_log

Source: https://modulify.ai/docs/api/environment/get-site-environment-log

Returns the full output of one environment build.

- Title: Read an environment build log
- Scope: `config:read`
- Access: Read only
- Endpoint: `POST /v1/get_site_environment_log`

Reach for it when the `Error` and `Excerpt` from `get_site_environment` do not explain why a build failed. The output has three parts, the preview image, the publish build image and the live site image, which are built from the same lines.

## Request

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

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

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

Over MCP, the same method is the [get_site_environment_log tool](https://modulify.ai/docs/mcp/environment/get-site-environment-log).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `buildId` | string | No | The build id from `Latest` or `History` in `get_site_environment`. Leave it out for the last save. |

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