<!-- source: https://secondlayer.tools/docs/api-reference#get-subgraph-docs -->

## Get a subgraph's markdown docs

`GET /v1/subgraphs/{name}/docs.md`

The agent schema rendered as markdown: a section per table with its endpoints, row count, column table, query params, filters, and a curl example. Served as `text/markdown`.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | string, required | Subgraph name, as deployed (the `name` in its definition). |

### Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `server` | string | Base URL written into the document's endpoints and examples. Defaults to this request's origin, honoring `X-Forwarded-Proto`. |

### Responses

- `200` The generated markdown
- `401` This bind requires the instance token, and it was missing or wrong
- `404` No readable subgraph by that name (`SUBGRAPH_NOT_FOUND`). Hosted: another account's private subgraph reads as missing
- `429` Hosted only: rate limited; retry after `Retry-After` seconds. Self-hosted reads are not rate limited

### Example

```bash
curl https://api.secondlayer.tools/v1/subgraphs/{name}/docs.md \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```
