# Endpoints

## GET /connections

```url
{{baseURL}}/connections
```

Returns a list of all your connection including their ID. Such as the following example data:

```json
{
    "data": [
        {
            "id": 66,
            "name": "Trustpilot",
            "description": "",
            "connector": {
                "id": 5,
                "name": "Trustpilot",
                "descripion": "Trustpilot"
            },
            "databaseId": 1,
            "user": {
                "id": 1,
                "name": "Team Less",
                "email": "admin@less.tech"
            },
            "folder": {
                "id": 8,
                "name": "Test"
            }
        }
    ]
}
```

"folder": null indicates the root workspace folder

## GET /datamodels

```url
{{baseURL}}/datamodels
```

Returns a list of all your models including their ID. Such as the following example data:

```json
{
    "data": [
        {
            "id": 74,
            "name": "Automated Financial Analysis",
            "description": "",
            "user": {
                "id": 1,
                "name": "Team Less",
                "email": "admin@less.tech"
            },
            "folder": null
        }
    ]
}
```

"folder": null indicates the root workspace folder

## GET /datamodels/{id}

```
{{baseURL}}/datamodels/{id}
```

The endpoint returns the full documentation of your model: every configuration of every tool present on the canvas including custom annotations. The response looks like this:

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```json
{
    "data": {
        "id": 74,
        "name": "Automated Financial Analysis",
        "description": "",
        "user": {
            "id": 1,
            "name": "Team Less",
            "email": "admin@less.tech"
        },
        "folder": null,
        "model": {
            "id": 235,
            "nodes": [
                {
                    "id": "0",
                    "name": "Input",
                    "configuration": {
                        "label": "Exercise_accounts",
                        "value": "Exercise_accounts",
                        "type": "Connection",
                        "source": "Exercise: Automated Financial Analysis",
                        "source_id": 137,
                        "db_id": 1,
                        "tableId": "Exercise_accounts",
                        "dbId": 1
                    }
                },
                {
                    "id": "1",
                    "name": "Input",
                    "configuration": {
                        "label": "Exercise_generalLedger",
                        "value": "Exercise_generalLedger",
                        "type": "Connection",
                        "source": "Exercise: Automated Financial Analysis",
                        "source_id": 137,
                        "db_id": 1,
                        "tableId": "Exercise_generalLedger",
                        "dbId": 1
                    }
                },
                {
                    "id": "2",
                    "name": "Change Columns",
                    "configuration": {
                        "dataframe": "1",
                        "columnNames": [
                            {
                                "column": "EntryNo",
                                "id": "EntryNo",
                                "new": false,
                                "select": false,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Decimal (Float)",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Date",
                                "id": "Date",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "String",
                                    "Type": "String"
                                },
                                "format": "Datetime(time_unit='ns', time_zone=None)"
                            },
                            {
                                "column": "Territory_key",
                                "id": "Territory_key",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Integer",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Account_key",
                                "id": "Account_key",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Integer",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Details",
                                "id": "Details",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "String",
                                    "Type": "String"
                                }
                            },
                            {
                                "column": "Amount",
                                "id": "Amount",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Integer",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Payment",
                                "id": "Payment",
                                "new": false,
                                "select": false,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "String",
                                    "Type": "String"
                                }
                            },
                            {
                                "column": "execution_time",
                                "id": "execution_time",
                                "new": false,
                                "select": false,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Datetime",
                                    "Type": "Date"
                                }
                            }
                        ],
                        "customAnnotation": "Testing custom annotation"
                    }
                },
                {
                    "id": "3",
                    "name": "Date Format",
                    "configuration": {
                        "dataframe": "2",
                        "columnName": "Date",
                        "columnNames": {
                            "year": true
                        }
                    }
                },
                {
                    "id": "4",
                    "name": "Group By",
                    "configuration": {
                        "dataframe": "3",
                        "groupby": {
                            "Date_year": true,
                            "Details": true,
                            "Account_key": true
                        },
                        "columnNamesAgg": [
                            {
                                "column": "Amount",
                                "aggregation": "sum",
                                "label": "Aggregation"
                            }
                        ]
                    }
                },
                {
                    "id": "5",
                    "name": "Text Column",
                    "configuration": {
                        "dataframe": "4",
                        "columnName": "Column Name",
                        "columnConfig": "\"Y\"+[Date_year]"
                    }
                },
                {
                    "id": "6",
                    "name": "Pivot",
                    "configuration": {
                        "dataframe": "5",
                        "header": "Column Name",
                        "value": "sum_Amount",
                        "aggfunc": "sum",
                        "keyfields": {
                            "Details": true,
                            "Account_key": true
                        }
                    }
                }
            ],
            "version": 3
        }
    }
}
```

{% endcode %}

That model looks like this on the canvas. As you can see, the response is equivalent to a JSON-based representation of the model. You can use this endpoint for documentation without having to write and update documentation or for testing purposes (for instance by tracking Combine, Stack or Filter input  vs. output dataset)

<div data-full-width="true"><figure><img src="/files/4H1AAIouZ9jBuq1RN9m3" alt=""><figcaption></figcaption></figure></div>

## GET /{assetType}/{id}/execute

```url
{{baseURL}}/{assetType}/{ID}/execution
```

Get connection ID from the GET /connections endpoint. Run/updates the connection.&#x20;

AssetType is either *connections* or *datamodels* whereby your URL could look like this for a connection:

```url
test.less.tech/api/public/connections/54/execute
```

Returns a job status message on in which you can see that the container\_status (i.e. job status) is set to *Pending* whereby it is added to your job queue:

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "data": {
        "id": 1206,
        "connection_id": 66,
        "container_status": "PENDING",
        "run_code": null,
        "records_retrieved": null,
        "error description": null
    }
}
</code></pre>

## GET /{assetType}/status/{task\_id}

```url
{{baseURL}}/{assetType}/status/{task_id}
```

Check the status of a job. Can for instance be used to create your own orchestration workflows.

{task\_id} refers to the id returned in the GET /{assetType}/{id}/execute response. With the example from above the URL would be structured like this:

```
{{baseURL}}/connections/status/1206
```

It returns the status of a specific job at the time of calling the endpoint. In other words, it is an asynchronous call (no promise structure while the asset runs/updates). The response looks identical to the previous call:

```json
{
    "data": {
        "id": 1206,
        "connection_id": 66,
        "container_status": "STOPPED",
        "run_code": 200,
        "records_retrieved": 5484,
        "error description": null
    }
}
```

Note that as the asset runs/updates, the container\_status and the run\_code will change. The container\_status can be either: pending (in queue), running (updating) or stopped (finished). The run\_code can either by 200 (success) or 500 (error).

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://resources.less.tech/less-tech/rest-api-beta/endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
