# Softr

> Create and manage Softr databases, tables, fields and records, and search table data.

App · 21 actions. Web page: https://docs.lodol.com/docs/integrations/softr

## Actions

### Create database

Create a new database in the specified workspace.

**Inputs**

- Workspace id (`workspace_id`, text, required): Workspace id.
- Name (`name`, text, required): Name.
- Description (`description`, text): Description.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "description": "example",
      "id": "example",
      "name": "example",
      "tablesCount": 1,
      "updatedAt": "example",
      "workspaceId": "example"
    }
  }
}
```

### Create field

Add a new field to a table.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Name (`name`, text, required): Name.
- Type (`type`, text, required): Type. One of: `SINGLE_LINE_TEXT` (Single line text), `CHECKBOX`, `CURRENCY`, `DATE`, `DATETIME`, `DURATION`, `EMAIL`, `SELECT`, `NUMBER`, `ATTACHMENT`, and 5 more.
- Options (`options`, object): Options.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "aiOptions": {
        "aiFillable": false,
        "aiModel": "example",
        "aiOnly": false,
        "allowWebSearch": false,
        "canBeTriggeredManually": false,
        "prompt": "example",
        "runWhenRecordIsCreated": false,
        "runWhenRecordIsUpdated": false
      },
      "allowMultipleEntries": false,
      "createdAt": "example",
      "defaultValue": "example",
      "description": "example",
      "id": "example",
      "locked": false,
      "name": "example",
      "options": {},
      "readonly": false,
      "required": false,
      "type": "SINGLE_LINE_TEXT",
      "updatedAt": "example"
    }
  }
}
```

### Create record

Create a new record in the specified table.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Field names (`field_names`, true/false): If true, use field names as keys in the response fields object instead of field IDs. Default: `false`.
- Fields (`fields`, object): A map of Field IDs to their values.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "fields": {},
      "id": "example",
      "tableId": "example",
      "updatedAt": "example"
    }
  }
}
```

### Create table

Create a new table in the specified database.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Name (`name`, text): Name.
- Description (`description`, text): Description.
- Primary field name (`primary_field_name`, text): Primary field name.
- Fields (`fields`, list): Fields.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "defaultViewId": "example",
      "description": "example",
      "fields": [],
      "id": "example",
      "name": "example",
      "primaryFieldId": "example",
      "updatedAt": "example"
    }
  }
}
```

### Delete database

Delete a specific database by its ID. It can only be deleted if it is empty, unless the 'force' parameter is used.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Force (`force`, true/false): force. Default: `false`.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {}
}
```

### Delete field

Delete a specific field from a table.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Field (`field_id`, text, required): fieldId.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {}
}
```

### Delete record

Delete a specific record by its ID.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Record (`record_id`, text, required): recordId.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {}
}
```

### Delete table

Delete a specific table by its ID. It can only be deleted if it is empty, unless the 'force' parameter is used.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Force (`force`, true/false): force. Default: `false`.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {}
}
```

### Get database

Retrieve details of a specific database by its ID.

**Inputs**

- Database (`database_id`, text, required): databaseId.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "description": "example",
      "id": "example",
      "name": "example",
      "tablesCount": 1,
      "updatedAt": "example",
      "workspaceId": "example"
    }
  }
}
```

### Get field

Retrieve details of a specific field.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Field (`field_id`, text, required): fieldId.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "aiOptions": {
        "aiFillable": false,
        "aiModel": "example",
        "aiOnly": false,
        "allowWebSearch": false,
        "canBeTriggeredManually": false,
        "prompt": "example",
        "runWhenRecordIsCreated": false,
        "runWhenRecordIsUpdated": false
      },
      "allowMultipleEntries": false,
      "createdAt": "example",
      "defaultValue": "example",
      "description": "example",
      "id": "example",
      "locked": false,
      "name": "example",
      "options": {},
      "readonly": false,
      "required": false,
      "type": "SINGLE_LINE_TEXT",
      "updatedAt": "example"
    }
  }
}
```

### Get record

Retrieve details of a specific record by its ID.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Record (`record_id`, text, required): recordId.
- Field names (`field_names`, true/false): If true, use field names as keys in the fields object instead of field IDs. Default: `false`.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "fields": {},
      "id": "example",
      "tableId": "example",
      "updatedAt": "example"
    }
  }
}
```

### Get table

Retrieve details of a specific table by its ID.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "defaultViewId": "example",
      "description": "example",
      "fields": [],
      "id": "example",
      "name": "example",
      "primaryFieldId": "example",
      "updatedAt": "example"
    }
  }
}
```

### List databases

Retrieve a list of all databases accessible to the authenticated user.

**Inputs**: None.

**Outputs**

- `data` (object): Response.

**Example output**

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

### List records

Retrieve a list of all records in the specified table.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Offset (`offset`, number): offset. Default: `0`.
- Limit (`limit`, number): limit. Default: `10`.
- Field names (`field_names`, true/false): If true, use field names as keys in the fields object instead of field IDs. Default: `false`.
- View id (`view_id`, text): Filter records by a specific view.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": [],
    "metadata": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List tables

Retrieve a list of all tables in the specified database.

**Inputs**

- Database (`database_id`, text, required): databaseId.

**Outputs**

- `data` (object): Response.

**Example output**

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

### List views

Retrieve a list of views for a specific table.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.

**Outputs**

- `data` (object): Response.

**Example output**

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

### Search records

Search for records in the specified table based on filter, sort, and pagination criteria.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Field names (`field_names`, true/false): If true, use field names as keys in the fields object instead of field IDs. Default: `false`.
- Filter (`filter`, object): Filter.
- Sorting (`sorting`, list): Sorting.
- Paging (`paging`, object): Paging.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": [],
    "metadata": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### Update database

Update the details of an existing database.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Name (`name`, text): Name.
- Description (`description`, text): Description.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "description": "example",
      "id": "example",
      "name": "example",
      "tablesCount": 1,
      "updatedAt": "example",
      "workspaceId": "example"
    }
  }
}
```

### Update field

Update the properties of a specific field.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Field (`field_id`, text, required): fieldId.
- Name (`name`, text): Name.
- Type (`type`, text): Type. One of: `SINGLE_LINE_TEXT` (Single line text), `CHECKBOX`, `CURRENCY`, `DATE`, `DATETIME`, `DURATION`, `EMAIL`, `SELECT`, `NUMBER`, `ATTACHMENT`, and 5 more.
- Options (`options`, object): Options.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "aiOptions": {
        "aiFillable": false,
        "aiModel": "example",
        "aiOnly": false,
        "allowWebSearch": false,
        "canBeTriggeredManually": false,
        "prompt": "example",
        "runWhenRecordIsCreated": false,
        "runWhenRecordIsUpdated": false
      },
      "allowMultipleEntries": false,
      "createdAt": "example",
      "defaultValue": "example",
      "description": "example",
      "id": "example",
      "locked": false,
      "name": "example",
      "options": {},
      "readonly": false,
      "required": false,
      "type": "SINGLE_LINE_TEXT",
      "updatedAt": "example"
    }
  }
}
```

### Update record

Partially update a specific record by its ID. Only the fields provided in the request body will be changed.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Record (`record_id`, text, required): recordId.
- Field names (`field_names`, true/false): If true, use field names as keys in the response fields object instead of field IDs. Default: `false`.
- Fields (`fields`, object): A map of Field IDs to their new values.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "fields": {},
      "id": "example",
      "tableId": "example",
      "updatedAt": "example"
    }
  }
}
```

### Update table

Update a table's name and/or description. To modify fields, use the field-specific endpoints.

**Inputs**

- Database (`database_id`, text, required): databaseId.
- Table (`table_id`, text, required): tableId.
- Name (`name`, text): Name.
- Description (`description`, text): Description.

**Outputs**

- `data` (object): Response.

**Example output**

```json
{
  "data": {
    "data": {
      "createdAt": "example",
      "defaultViewId": "example",
      "description": "example",
      "fields": [],
      "id": "example",
      "name": "example",
      "primaryFieldId": "example",
      "updatedAt": "example"
    }
  }
}
```
