# Source APIs \[Deprecated]

{% hint style="danger" %}
These APIs have been deprecated
{% endhint %}

Tenant Id can be retrieved from the UI as listed [here](broken://pages/-MkOLrNp2rbjIcVtIX6f).

## Create a source

<mark style="color:green;">`POST`</mark> `https://env1.telm.ai/api/backend/{tenant}/configuration/sources`

Create a new source in the tenant

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| tenant<mark style="color:red;">\*</mark> | string | Tenant Id   |

#### Query Parameters

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| name<mark style="color:red;">\*</mark> | string | Name of source        |
| description                            | string | Description of source |

#### Headers

| Name                                             | Type   | Description                                                             |
| ------------------------------------------------ | ------ | ----------------------------------------------------------------------- |
| Content-type                                     | string | application/json                                                        |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer \<access\_token>. Access token retrieved from Authentication API |

{% tabs %}
{% tab title="200 Returns a json representation of the Source Object" %}

```
{
    id = 'id',
    name = 'name',
    description = 'description',
    attributes = [],
    "last_upload_job_id": null
}
```

{% endtab %}
{% endtabs %}

## List all sources for this tenant

<mark style="color:blue;">`GET`</mark> `https://env1.telm.ai/api/backend/{tenant}/configuration/source`

Api to list all sources in a tenant

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| tenant<mark style="color:red;">\*</mark> | string | Tenant Id   |

#### Headers

| Name                                             | Type   | Description                                                                |
| ------------------------------------------------ | ------ | -------------------------------------------------------------------------- |
| Content-type                                     | string | application/json                                                           |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer \<access\_token>. Access token is retrieved from Authentication API |

{% tabs %}
{% tab title="200 A list of source objects" %}

```
[
    {
        id = 'id',
        name = 'name',
        description = 'description',
        attributes = [
            {
                "id": "<id>",
                "name": "<name>",
                "monitored": <true/false>,
                "status": "<status>",
                "model_last_updated": "<date>"
            },
            {
                "id": "<id>",
                "name": "<name>",
                "monitored": <true/false>,
                "status": "<status>",
                "model_last_updated": "<date>"
            }
        ],
        "last_upload_job_id": "<job-id>",
        "scheduled_upload": <scheduled_upload>
    }
]
```

{% endtab %}
{% endtabs %}

## Update a source

<mark style="color:orange;">`PUT`</mark> `https://env1.telm.ai/api/backend/{tenant}/configuration/sources`

Create a new source in the tenant

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| tenant<mark style="color:red;">\*</mark> | string | Tenant Id   |

#### Query Parameters

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| name<mark style="color:red;">\*</mark> | string | Name of source        |
| description                            | string | Description of source |

#### Headers

| Name                                             | Type   | Description                                                             |
| ------------------------------------------------ | ------ | ----------------------------------------------------------------------- |
| Content-type                                     | string | application/json                                                        |
| Authentication<mark style="color:red;">\*</mark> | string | Bearer \<access\_token>. Access token retrieved from Authentication API |

{% tabs %}
{% tab title="200 Returns a json representation of the Source Object" %}

```
{
    id = 'id',
    name = 'name',
    description = 'description',
    attributes = [],
    "last_upload_job_id": null
}
```

{% endtab %}
{% endtabs %}

## Get details of a specific source

<mark style="color:blue;">`GET`</mark> `https://env1.telm.ai/api/backend/{tenant}/configuration/sources/<source-id>`

#### Path Parameters

| Name                                        | Type   | Description                   |
| ------------------------------------------- | ------ | ----------------------------- |
| source-id<mark style="color:red;">\*</mark> | string | Id of source to be retrieved. |
| tenant<mark style="color:red;">\*</mark>    | string | Tenant id                     |

#### Headers

| Name                                            | Type   | Description                                     |
| ----------------------------------------------- | ------ | ----------------------------------------------- |
| Content-type                                    | string | application/json                                |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer \<access\_token from Authentication API> |

{% tabs %}
{% tab title="200 Source details" %}

```
{
    "id": "<source-id>",
    "name": "<source-name>",
    "description": "<source-description>",
    "attributes": [],
    "last_upload_job_id": null,
    "scheduled_upload": null
}
```

{% endtab %}
{% endtabs %}

## Delete Source

<mark style="color:red;">`DELETE`</mark> `https://env1.telm.ai/api/backend/{tenant}/configuration/sources/<source-id>`

Delete a specific source

#### Path Parameters

| Name                                        | Type   | Description                                                                      |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------- |
| source-id<mark style="color:red;">\*</mark> | string | Id of source to be deleted. This can be retrieved by looking up a source by name |
| tenant<mark style="color:red;">\*</mark>    | string | Name of tenant                                                                   |

#### Headers

| Name                                            | Type   | Description                                     |
| ----------------------------------------------- | ------ | ----------------------------------------------- |
| Content-type                                    | string | application/json                                |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer \<access\_token from Authentication API> |

{% tabs %}
{% tab title="200 Source deleted successfully" %}

```
{
    "message": "Source was deleted successfully"
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.telm.ai/telmai/source-apis/list-all-sources.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.
