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

# Manifest.json reference

# Properties

## Root

<ParamField path="id" type="string">
  **App ID** - It should be prefixed with `appx_` for private apps and `app_` for public apps. It should be unique across all apps. Your app ID can only contain letters & numbers. Example: `appx_myapp123`.
</ParamField>

<ParamField path="name" type="string">
  **App name** - The name of your app. Example: `My App`.
</ParamField>

<ParamField path="homepage" type="string">
  **Homepage** - The URL of your app's homepage of your own documentation. Example: `https://myapp.com`.
</ParamField>

<ParamField path="author" type="string">
  **Author** - The name of the author of the app. Example: `ACME Organization`.
</ParamField>

<ParamField path="icon_url" type="string">
  **Icon URL** - The URL of the icon of your app. Example: `https://myapp.com/icon.png`.
</ParamField>

<ParamField path="short_description" type="string">
  **Short description** - A short description of your app. Example: `My App is a great app that does great things`.
</ParamField>

<ParamField path="description" type="string">
  **Description** - A detailed description of your app. Example: `My App is a great app that does great things. It's the best app ever!`.
</ParamField>

<ParamField path="version" type="string">
  **Version** - The version of your app. Example: `1.0.0`.
</ParamField>

<ParamField path="ui_endpoint" type="string">
  **UI endpoint** - The URL of your app's UI that will be embedded as an `iframe` in the Ridiam Console. Example: `https://myapp.com`.
</ParamField>

<ParamField path="webhook_endpoint" type="string">
  **Webhook endpoint** - The URL of your app's webhook endpoint. Example: `https://myapp.com/api/webhooks`.
</ParamField>

<ParamField path="tasks" type="array">
  **Tasks** - An array of tasks that your app can perform. See [Task properties](#task) for more details.
</ParamField>

<ParamField path="data_hooks" type="array">
  **Data hooks** - An array of data hooks that your app can listen to.See [Data hook properties](#data-hook) for more details.
</ParamField>

<ParamField path="sql_access" type="object">
  **SQL access** - An object containing your app's SQL access. See [SQL access properties](#sql-access) for more details.
</ParamField>

<ParamField path="extra_columns" type="array">
  **Extra columns** - An array of extra columns that your app can add to the user table. See [Extra column properties](#extra-column) for more details.
</ParamField>

<ParamField path="app_tables" type="array">
  **App tables** - An array of extra tables that your app can add to the database. See [App table properties](#app-table) for more details.
</ParamField>

<ParamField path="cube_schemas" type="object">
  **Cube schemas** - A object containing your app tables Cube schemas. See [Cube schemas properties](#cube-schemas) for more details.
</ParamField>

## Task

<ParamField path="id" type="string">
  **Task ID** - The ID of the task, prefixed by your app ID. Example: `appx_myapp123_task_1`.
</ParamField>

<ParamField path="name" type="string">
  **Task name** - The name of the task. Example: `Task 1`.
</ParamField>

<ParamField path="description" type="string">
  **Task description** - A description of the task. Example: `Example of task`.
</ParamField>

<ParamField path="is_cron" type="boolean">
  **Is cron** - Whether the task is a periodic cron job. Example: `true`.
</ParamField>

<ParamField path="minutes_interval" type="integer">
  **Minutes interval** - The interval in minutes for the cron job. Example: `720`.
</ParamField>

<ParamField path="on_multiple_exec" type="enum">
  **On multiple exec** - What to do when the task is executed multiple times concurently. Values: `allow`, `discard_new`, `retry_later`, `abort_existing`.
</ParamField>

## Data hook

<ParamField path="id" type="string">
  **Data hook ID** - The ID of the data hook, prefixed by your app ID. Example: `appx_myapp123_on_create_user`.
</ParamField>

<ParamField path="name" type="string">
  **Data hook name** - The name of the data hook. Example: `On create`.
</ParamField>

<ParamField path="on" type="enum">
  **On** - When the data hook should be triggered. Values: `on_validation`, `on_success`.
</ParamField>

<ParamField path="for" type="array">
  **For** - The kind of data and actions that the data hook should listen to. See [Data hook for](#app-table) for more details.
</ParamField>

### Data hook for

<ParamField path="kind" type="string">
  **Data kind** - The kind of data that the data hook should listen to. Values: `user`, `segment`, `order`, `order_item`, `cart`, `cart_item`, `session`, `custom_event`, `pageview`, `appx_myapp_custom_table`...
</ParamField>

<ParamField path="action" type="string">
  **Action** - Only for `on_success` hooks. The action that the data hook should listen to. Values: `create`, `update`. For `kind == segment` values are `exit`, `enter`.
</ParamField>

## SQL access

<ParamField path="predefined_queries" type="array">
  **Predefined queries** - An array of predefined SQL queries that your app can perform. See [SQL query properties](#sql-query) for more details.
</ParamField>

<ParamField path="tables_permissions" type="array">
  **Tables permissions** - An array of tables that your app can access. See [SQL tables permissions](#sql-tables-permissions) for more details.
</ParamField>

### SQL predefined-query

<ParamField path="id" type="string">
  **SQL query ID** - The ID of the SQL query, prefixed by your app ID. Example: `appx_myapp123_sql_query_1`.
</ParamField>

<ParamField path="type" type="enum">
  **SQL query type** - The type of the SQL query. Values: `select`.
</ParamField>

<ParamField path="name" type="string">
  **SQL query name** - The name of the SQL query. Example: `SQL query 1`.
</ParamField>

<ParamField path="description" type="string">
  **SQL query description** - A description of the SQL query. Example: `Example of predefined SQL query`.
</ParamField>

<ParamField path="query" type="string">
  **SQL query** - Use `*` to get full access or provide the specific query like ``SELECT * FROM `user` WHERE external_id = ?``.
</ParamField>

<ParamField path="test_args" type="array">
  **Test arguments** - An array of test arguments for the SQL query. Example: `["user_123"]`.
</ParamField>

### SQL tables permissions

<ParamField path="table" type="string">
  **Table** - The name of the table. Values: `user`, `segment`, `order`, `order_item`, `cart`, `cart_item`, `session`, `custom_event`, `pageview`, `appx_myapp_custom_table`...
</ParamField>

<ParamField path="read" type="boolean">
  **Read** - Whether the app can read the table. Example: `true`.
</ParamField>

<ParamField path="write" type="boolean">
  **Write** - Whether the app can write to the table. Example: `true`.
</ParamField>

## Extra column

<ParamField path="kind" type="string">
  **Kind** - The kind of data that the extra column should be added to. Example: `user`, `order`, `order_item`, `session`, `pageview`, `custom_event`, `cart`, `cart_item`.
</ParamField>

<ParamField path="columns" type="array">
  **Columns** - An array of columns that should be added to the kind. See [Column properties](#table-column) for more details.
</ParamField>

## App table

<ParamField path="name" type="string">
  **Table name** - The name of the table prefixed by your app ID. Example: `appx_myapp123_table_1`.
</ParamField>

<ParamField path="description" type="string">
  **Table description** - A description of the table. Example: `Example of extra table`.
</ParamField>

<ParamField path="shard_key" type="array">
  **Shard key** - An array of columns that should be used as the shard key. Example: `["user_id"]`.
</ParamField>

<ParamField path="unique_key" type="array">
  **Unique key** - An array of columns that should be used as the unique key. The `unique_key` should at least contain all columns defined in `shard_key`.  Example: `["id", "user_id"]`.
</ParamField>

<ParamField path="sort_key" type="array">
  **Sort key** - An array of columns that should be used to store the data in a specific order in the database. Example: `["created_at"]`.
</ParamField>

<ParamField path="columns" type="array">
  **Columns** - An array of columns that should be added to the table. See [Column properties](#table-column) for more details.
</ParamField>

<ParamField path="indexes" type="array">
  **Indexes** - An array of indexes that should be added to the table. See [Index properties](#table-index) for more details.
</ParamField>

### Table column

<ParamField path="name" type="string">
  **Column name** - The name of the column. For [extra columns](#extra-column), it should be prefixed by your app ID. Example: `appx_myapp123_column_a`.
</ParamField>

<ParamField path="type" type="enum">
  **Column type** - The type of the column. Values: `boolean`, `number`, `date`, `datetime`, `timestamp`, `varchar`, `longtext`, `json`.
</ParamField>

<ParamField path="size" type="integer">
  **Column size** - The size of the column. Required for `varchar` types. Example: `128`.
</ParamField>

<ParamField path="is_required" type="boolean">
  **Is required** - Whether the column is required when inserting records. Example: `true`.
</ParamField>

<ParamField path="description" type="string">
  **Column description** - A description of the column. Example: `Example of extra column`.
</ParamField>

<ParamField path="default_boolean" type="boolean">
  **Default boolean** - The default value for the column. Example: `true`.
</ParamField>

<ParamField path="default_number" type="number">
  **Default number** - The default value for the column. Example: `123`.
</ParamField>

<ParamField path="default_date" type="string">
  **Default date** - The default value for the column. Example: `2022-01-01`.
</ParamField>

<ParamField path="default_datetime" type="string">
  **Default datetime** - The default value for the column. Example: `2022-01-01T00:00:00Z`.
</ParamField>

<ParamField path="default_timestamp" type="string">
  **Default timestamp** - The default value for the column. Example: `CURRENT_TIMESTAMP`.
</ParamField>

<ParamField path="default_text" type="string">
  **Default text** - The default value for the column. Example: `Hello world`.
</ParamField>

<ParamField path="default_json" type="object">
  **Default JSON** - The default value for the column. Example: `{"key": "value"}`.
</ParamField>

<ParamField path="extra_definition" type="string">
  **Extra definition** - The extra definition for the column. Example: `ON UPDATE CURRENT_TIMESTAMP`.
</ParamField>

<ParamField path="hide_in_analytics" type="boolean">
  **Hide in analytics** - Whether the column should be hidden in analytics. Example: `true`.
</ParamField>

### Table index

<ParamField path="name" type="string">
  **Index name** - The name of the index. Example: `index_column_varchar`.
</ParamField>

<ParamField path="columns" type="array">
  **Columns** - An array of columns that should be used for the index. Example: `["column_varchar"]`.
</ParamField>

## Cube schemas

Please refer to the [Cube schemas documentation](/apps-development/cube-schemas) for more details.

## Full example

```json theme={null}
{
  "id": "appx_default",
  "name": "Default Rimdian app template",
  "homepage": "https://yourwebsite.com",
  "author": "Your Organization",
  "icon_url": "https://eu.rimdian.com/images/apps/custom_app.png",
  "short_description": "Default Rimdian app template.",
  "description": "Default Rimdian app template.",
  "version": "1.0.0",
  "ui_endpoint": "https://localhost:3000",
  "webhook_endpoint": "https://localhost:3000/api/webhooks",
  "tasks": [
    {
      "id": "appx_default_task_1",
      "name": "Task 1",
      "description": "Example of manual task",
      "is_cron": false,
      "on_multiple_exec": "abort_existing"
    },
    {
      "id": "appx_default_task_2",
      "name": "Task 2",
      "description": "Example of cron task",
      "is_cron": true,
      "minutes_interval": 720,
      "on_multiple_exec": "discard_new"
    }
  ],
  "data_hooks": [
    {
      "id": "appx_default_on_create_user",
      "name": "On create",
      "on": "on_success",
      "for": [
        {
          "kind": "user",
          "action": "create"
        }
      ]
    },
    {
      "id": "appx_default_on_update_user",
      "name": "On update",
      "on": "on_success",
      "for": [
        {
          "kind": "user",
          "action": "update"
        }
      ]
    },
    {
      "id": "appx_default_on_exit_segment",
      "name": "On exit segment",
      "on": "on_success",
      "for": [
        {
          "kind": "segment",
          "action": "exit"
        }
      ]
    }
  ],
  "sql_access": {
    "predefined_queries": [
      {
        "id": "appx_default_sql_query_1",
        "type": "select",
        "name": "SQL query 1",
        "description": "Example of predefined SQL query. For security reasons, use predefined queries to just fetch the data you needs",
        "query": "SELECT * FROM `user` WHERE external_id = ?",
        "test_args": ["auth-54-22"]
      }
    ],
    "tables_permissions": [
      {
        "table": "user",
        "read": true,
        "write": false
      },
      {
        "table": "session",
        "read": true,
        "write": false
      }
    ]
  },
  "extra_columns": [
    {
      "kind": "user",
      "columns": [
        {
          "name": "appx_default_column_1",
          "type": "varchar",
          "size": 128,
          "is_required": false,
          "description": "Example of extra column"
        }
      ]
    }
  ],
  "app_tables": [
    {
      "name": "appx_default_table_1",
      "description": "Example of extra table",
      "shard_key": ["id"],
      "unique_key": ["id"],
      "sort_key": ["created_at"],
      "indexes": [
        {
          "name": "index_column_varchar",
          "columns": ["column_varchar"]
        }
      ],
      "columns": [
        {
          "name": "id",
          "type": "varchar",
          "size": 64,
          "description": "id",
          "is_required": true
        },
        {
          "name": "external_id",
          "type": "varchar",
          "size": 256,
          "description": "external_id",
          "is_required": true
        },
        {
          "name": "created_at",
          "type": "datetime",
          "description": "created_at",
          "is_required": true
        },
        {
          "name": "updated_at",
          "type": "datetime",
          "description": "updated_at",
          "is_required": false,
          "hide_in_analytics": true
        },
        {
          "name": "user_id",
          "type": "varchar",
          "size": 64,
          "description": "user_id",
          "is_required": true,
          "hide_in_analytics": true
        },
        {
          "name": "merged_from_user_id",
          "type": "varchar",
          "size": 64,
          "description": "merged_from_user_id",
          "is_required": false,
          "hide_in_analytics": true
        },
        {
          "name": "fields_timestamp",
          "type": "json",
          "description": "fields_timestamp",
          "is_required": true,
          "hide_in_analytics": true
        },
        {
          "name": "db_created_at",
          "type": "timestamp",
          "size": 6,
          "default_timestamp": "CURRENT_TIMESTAMP(6)",
          "description": "db_created_at",
          "is_required": true,
          "hide_in_analytics": true
        },
        {
          "name": "db_updated_at",
          "type": "timestamp",
          "size": 6,
          "default_timestamp": "CURRENT_TIMESTAMP(6)",
          "extra_definition": "ON UPDATE CURRENT_TIMESTAMP",
          "description": "db_created_at",
          "is_required": true,
          "hide_in_analytics": true
        },
        {
          "name": "column_varchar",
          "type": "varchar",
          "size": 128,
          "description": "Example of varchar column",
          "is_required": false
        },
        {
          "name": "column_number",
          "type": "number",
          "description": "Example of number column",
          "is_required": false
        },
        {
          "name": "column_boolean",
          "type": "boolean",
          "description": "Example of boolean column",
          "is_required": false
        },
        {
          "name": "column_datetime",
          "type": "datetime",
          "description": "Example of datetime column",
          "is_required": false
        },
        {
          "name": "column_json",
          "type": "json",
          "description": "Example of json column",
          "is_required": false
        }
      ]
    }
  ],
  "cube_schemas": {
    "Appx_default_table_1": {
      "sql": "SELECT * FROM appx_default_table_1",
      "title": "App table 1",
      "description": "App table 1 description",
      "joins": {
        "Appx_myapp_table_2": {
          "relationship": "one_to_many",
          "sql": "${CUBE}.external_id = ${Appx_myapp_table_2}.table1_external_id"
        }
      },
      "measures": {
        "count": {
          "title": "Count",
          "type": "count",
          "sql": "id",
          "description": "The number of lines"
        }
      },
      "dimensions": {
        "id": {
          "title": "ID",
          "type": "string",
          "sql": "id",
          "primaryKey": true,
          "description": "ID (sha1 of external_id)"
        },
        "external_id": {
          "title": "External ID",
          "type": "string",
          "sql": "external_id",
          "description": "External ID"
        },
        "created_at": {
          "title": "Created at",
          "type": "datetime",
          "sql": "created_at",
          "description": "Created at"
        },
        ...
      }
    },
    "Appx_default_table_2": { 
      ...
    }
  }
}
```
