# List outgoing links

`GET /v1/documents/{id}/links`

Lists the links in this document (body first, then properties, in document order), each with the live document it resolves to or null.

Scope: `docs:read`.

## Request

```bash
curl "https://api.lydie.co/v1/documents/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/links" \
  -H "Authorization: Bearer $LYDIE_TOKEN"
```

## Path parameters

- `id` (ULID, required)

## Response

- `links` (OutgoingLink[], required)
  - `id` (ULID, required)
  - `kind` (string, required): One of: `link`, `embed`.
  - `syntax` (string, required): One of: `wikilink`, `markdown`.
  - `targetRef` (string, required): The link target as written (path or title, without #part).
  - `targetHeading` (string, required, nullable)
  - `targetBlockId` (string, required, nullable)
  - `sourceBlockId` (string, required, nullable)
  - `sourceProperty` (string, optional, nullable)
  - `target` (object, required, nullable): The live document it resolves to; null when it resolves to nothing or to the trash.
    - `id` (ULID, required)
    - `title` (string, required): (1–255 chars)
    - `parentId` (ULID, required, nullable)
    - `workspaceId` (string, required): (1–64 chars)

```json
{
  "links": [
    {
      "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "kind": "link",
      "syntax": "wikilink",
      "targetRef": "string",
      "targetHeading": null,
      "targetBlockId": null,
      "sourceBlockId": null,
      "sourceProperty": null,
      "target": null
    }
  ]
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
