> ## Documentation Index
> Fetch the complete documentation index at: https://docs.royaltyport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Writers

> List and retrieve writers for a project with the SDK.

## list()

Returns a paginated list of root writers for a project. Writers are extracted from contract documents and de-duplicated via merging.

### Signature

```js theme={null}
royaltyport.writers.list(projectId, options?)
```

### Parameters

| Parameter               | Type      | Required | Default | Description                   |
| ----------------------- | --------- | -------- | ------- | ----------------------------- |
| `projectId`             | `string`  | Yes      | —       | The project ID                |
| `options.page`          | `number`  | No       | `1`     | Page number                   |
| `options.perPage`       | `number`  | No       | `20`    | Items per page (max: 100)     |
| `options.includeMerged` | `boolean` | No       | `false` | Include merged writer records |

### Example

```js theme={null}
import { Royaltyport } from '@royaltyport/sdk';

const royaltyport = new Royaltyport({
  apiKey: 'rp_your_token_here',
});

const { data } = await royaltyport.writers.list('project-id', {
  perPage: 100,
  includeMerged: true,
});

for (const writer of data.items) {
  console.log(writer.name);
}
```

***

## get()

Returns a single writer by ID.

### Signature

```js theme={null}
royaltyport.writers.get(projectId, writerId, options?)
```

### Parameters

| Parameter               | Type      | Required | Default | Description                   |
| ----------------------- | --------- | -------- | ------- | ----------------------------- |
| `projectId`             | `string`  | Yes      | —       | The project ID                |
| `writerId`              | `number`  | Yes      | —       | The writer ID                 |
| `options.includeMerged` | `boolean` | No       | `false` | Include merged writer records |

### Example

```js theme={null}
import { Royaltyport } from '@royaltyport/sdk';

const royaltyport = new Royaltyport({
  apiKey: 'rp_your_token_here',
});

const { data: writer } = await royaltyport.writers.get('project-id', 15);

console.log(writer.name);
```

<Note>
  The `merged` array only appears when `includeMerged` is set to `true`.
</Note>
