# Craft

> Organize Craft documents and folders, append Markdown, search notes, and manage tasks.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/craft

## Actions

### Add task

Create a task in your inbox, a document, or a daily note.

**Inputs**

- Markdown (`markdown`, text, required): Enter the text or Markdown.
- Location (`location`, text, required): Choose where to create the task. One of: `inbox`, `dailyNote`, `document`.
- Document (`document_id`, text): Choose the document when using document location.
- Daily note date (`daily_note_date`, date): Choose the date when using daily note location.
- Schedule date (`schedule_date`, date): Choose the date to work on the task.
- Deadline date (`deadline_date`, date): Choose when the task is due.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example",
        "location": {},
        "markdown": "example",
        "taskInfo": {}
      }
    ]
  }
}
```

### Append Markdown

Append formatted text to a document or daily note.

**Inputs**

- Markdown (`markdown`, text, required): Enter the text or Markdown.
- Document (`document_id`, text): Choose the document or page to append to.
- Daily note date (`daily_note_date`, date): Choose a daily note date instead of a document.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example",
        "markdown": "example",
        "type": "example"
      }
    ]
  }
}
```

### Create collection

Add a structured table at the end of a document.

**Inputs**

- Document (`document_id`, text, required): Choose the document to hold the collection.
- Name (`name`, text, required): Enter a name for the collection.
- Column names (`column_names`, list): Enter names for additional columns.
- Column type (`column_type`, text): Choose the field type for the additional columns. One of: `text`, `date`, `number`, `checkbox`. Default: `text`.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "collectionBlockId": "example",
    "name": "example",
    "schema": {}
  }
}
```

### Create document

Create a document in the space or in a folder.

**Inputs**

- Title (`title`, text, required): Enter the document title.
- Folder (`folder_id`, text): Choose a folder, or leave empty to create it in Unsorted.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "clickableLink": "example",
        "id": "example",
        "title": "example"
      }
    ]
  }
}
```

### Create folder

Create a folder at the root of the space or inside another folder.

**Inputs**

- Name (`name`, text, required): Enter the folder name.
- Parent folder (`parent_folder_id`, text): Choose the parent folder.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example",
        "name": "example"
      }
    ]
  }
}
```

### Delete blocks

Remove the specified blocks from a document.

**Inputs**

- Block IDS (`block_ids`, list, required): Enter the IDs of the blocks to delete.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example"
      }
    ]
  }
}
```

### Delete folders

Delete the selected folders. Use empty folders for test runs.

**Inputs**

- Folder IDS (`folder_ids`, list, required): Choose the folders to delete.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example"
      }
    ]
  }
}
```

### Delete tasks

Delete the tasks identified by the supplied IDs.

**Inputs**

- Task IDS (`task_ids`, list, required): Enter the IDs from Add task or List tasks.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example"
      }
    ]
  }
}
```

### Get connection details

Get the connected space, its time zone, and link templates.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "space": {
      "id": "example",
      "name": "example",
      "timezone": "example"
    },
    "urlTemplates": {},
    "utc": {}
  }
}
```

### Get document content

Read a document or page and its nested blocks.

**Inputs**

- Document (`document_id`, text, required): Choose a document or enter the ID of a nested page.
- Max depth (`max_depth`, number): Limit how deeply nested blocks are included. At least -1.
- Fetch metadata (`fetch_metadata`, true/false): Include block creation and edit information.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "content": [
      {}
    ],
    "id": "example",
    "markdown": "example",
    "title": "example",
    "type": "example"
  }
}
```

### List collection items

Read the rows and their properties from a collection.

**Inputs**

- Collection ID (`collection_id`, text, required): Enter an ID from List collections.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "properties": {},
        "title": "example"
      }
    ]
  }
}
```

### List collections

Find the collections available in selected documents or across the space.

**Inputs**

- Document IDS (`document_ids`, list): Limit the search to these documents.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example",
        "name": "example"
      }
    ]
  }
}
```

### List documents

List documents in the connected space, a folder, or a built-in location.

**Inputs**

- Location (`location`, text): Choose a built-in document location. One of: `unsorted`, `trash`, `templates`, `daily_notes` (Daily notes).
- Folder (`folder_id`, text): Choose a folder to list.
- Fetch metadata (`fetch_metadata`, true/false): Include creation and last-modified information.
- Start date (`start_date`, date): Include documents created on or after this date.
- End date (`end_date`, date): Include documents created on or before this date.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "createdAt": "example",
        "dailyNoteDate": "example",
        "id": "example",
        "lastModifiedAt": "example",
        "title": "example"
      }
    ]
  }
}
```

### List folders

Get the space's folder tree and built-in document locations.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "folders": [
          {}
        ],
        "id": "example",
        "name": "example"
      }
    ]
  }
}
```

### List tasks

List tasks in a document, the inbox, the logbook, or the space.

**Inputs**

- Scope (`scope`, text, required): Choose where to look for tasks. One of: `active`, `upcoming`, `inbox`, `logbook`, `document`, `all`.
- Document (`document_id`, text): Choose a document when looking in a document.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example",
        "location": {},
        "markdown": "example",
        "taskInfo": {}
      }
    ]
  }
}
```

### Move documents

Move documents to a folder, Unsorted, or Templates. This can restore documents from the trash.

**Inputs**

- Document IDS (`document_ids`, list, required): Choose the documents to move or trash.
- Folder (`folder_id`, text): Choose the destination folder.
- Location (`location`, text): Choose a built-in destination instead of a folder. One of: `unsorted`, `templates`.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "destination": {},
        "id": "example"
      }
    ]
  }
}
```

### Move documents to trash

Move the selected documents into the space's trash.

**Inputs**

- Document IDS (`document_ids`, list, required): Choose the documents to move or trash.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example"
      }
    ]
  }
}
```

### Search in document

Find text in one document, with optional surrounding blocks.

**Inputs**

- Document (`document_id`, text, required): Choose the document to search.
- Pattern (`pattern`, text, required): Enter a search pattern. Regular expressions are supported.
- Case sensitive (`case_sensitive`, true/false): Match uppercase and lowercase exactly.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {}
    ]
  }
}
```

### Update block text

Replace the text of an existing block and keep its other settings.

**Inputs**

- Block ID (`block_id`, text, required): Enter the block ID from Append Markdown or Get document content.
- Markdown (`markdown`, text, required): Enter the text or Markdown.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example",
        "markdown": "example",
        "type": "example"
      }
    ]
  }
}
```

### Update task

Change the task's text, state, schedule date, or deadline.

**Inputs**

- Task ID (`task_id`, text, required): Enter the ID from Add task or List tasks.
- Markdown (`markdown`, text): Enter the text or Markdown.
- State (`state`, text): Choose the new task state. One of: `todo`, `done`, `canceled`.
- Schedule date (`schedule_date`, date): Choose the date to work on the task.
- Deadline date (`deadline_date`, date): Choose when the task is due.

**Outputs**

- `data` (object): The response from Craft.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "id": "example"
      }
    ]
  }
}
```
