# Roam Research

> Read, add and reorganise the pages and blocks of a Roam Research graph, and run Datalog queries over it.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/roam-research

## Actions

### Create block

Add a block of text under a page or another block, at the position you choose.

**Inputs**

- Parent uid (`parent_uid`, text, required): Parent uid.
- Order (`order`, number, required): Order. At least 0.
- Text (`text`, text, required): Text.
- Uid (`uid`, text): Leave empty to generate a unique ID.
- Open (`open`, true/false): Open.
- Heading (`heading`, number): Heading. One of: `0`, `1`, `2`, `3`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```

### Create page

Add a page with a title.

**Inputs**

- Title (`title`, text, required): Title.
- Uid (`uid`, text): Leave empty to generate a unique ID.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```

### Delete block

Delete a block and the blocks nested under it.

**Inputs**

- Uid (`uid`, text, required): Uid.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```

### Delete page

Delete a page and all of its blocks.

**Inputs**

- Uid (`uid`, text, required): Uid.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```

### List blocks

List every block in your graph.

**Inputs**: None.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "result": []
  },
  "next_cursor": ""
}
```

### List pages

List every page in your graph.

**Inputs**: None.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "result": []
  },
  "next_cursor": ""
}
```

### Move block

Move a block to a new parent or position.

**Inputs**

- Uid (`uid`, text, required): Uid.
- Parent uid (`parent_uid`, text, required): Parent uid.
- Order (`order`, number, required): Order. At least 0.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```

### Pull

Get one page or block by its UID, with the attributes you choose.

**Inputs**

- Page or block (`uid`, text, required): Pick a page or enter a page or block UID.
- Selector (`selector`, text): Roam pull pattern. Leave empty to retrieve every attribute. Default: `[*]`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "result": {}
  },
  "next_cursor": ""
}
```

### Pull many

Get several pages or blocks by their UIDs, with the attributes you choose.

**Inputs**

- Pages or blocks (`uids`, list, required): Pick pages or enter page or block UIDs.
- Selector (`selector`, text): Roam pull pattern. Leave empty to retrieve every attribute. Default: `[*]`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "result": {}
  },
  "next_cursor": ""
}
```

### Query

Run a Datalog query over your graph and get the results.

**Inputs**

- Query (`query`, text, required): Query.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "result": {}
  },
  "next_cursor": ""
}
```

### Update block

Change a block's text, heading level or whether it is expanded.

**Inputs**

- Uid (`uid`, text, required): Uid.
- Text (`text`, text): Text.
- Open (`open`, true/false): Open.
- Heading (`heading`, number): Heading. One of: `0`, `1`, `2`, `3`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```

### Update page

Rename a page.

**Inputs**

- Uid (`uid`, text, required): Uid.
- Title (`title`, text): Title.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "accepted": false,
    "uid": "example"
  },
  "next_cursor": ""
}
```
