API

Manage Data Sources

Getting data sources

The getSources is designed to retrieve all unique data sources for a specific project.

POST /api.mendable.ai/v1/getSources

Request

Here is an example request using cURL. The api_key must be a server-side API key which you can create in the Mendable dashboard.

curl -X POST https://api.mendable.ai/v1/getSources \
  -H "Content-Type: application/json" \
  -d '{
        "api_key": "YOUR_API_KEY"
      }'

Response

The response will be an array of unique sources for the specified project containing an id,source,metadata,date_added:

[
  {
    "id": 52,
    "source": "https://mendable.ai"
    "metadata": []
    "date_added": "2023-06-28T20:43:21.908499+00:00"
  }
]

Request Parameters

FieldTypeRequiredDescription
api_keystringYesYour Mendable API key

Deleting a data source

The deleteSource is designed to delete a specific data source or all data sources for a specific project. The api_key must be a server-side API key which you can create in the Mendable dashboard.

POST /api.mendable.ai/v1/deleteSource

Request

Here is an example request using cURL:

curl -X POST https://api.mendable.ai/v1/deleteSource \
  -H "Content-Type: application/json" \
  -d '{
        "api_key": "YOUR_API_KEY",
        "source": "SOURCE_TO_DELETE",
        "delete_all": false
      }'

Response

The response will be a confirmation message indicating that the source(s) have been deleted.

Request Parameters

FieldTypeRequiredDescription
api_keystringYesYour Mendable API key
sourcestringNoThe source to delete
delete_allbooleanNoWhether to delete all sources, defaults to false

If the delete_all parameter is set to true, all sources for the specified project will be deleted, except those manually added through the "Teach Model". If it's set to false or not provided, only the specified source will be deleted. If the source parameter is not provided and delete_all is set to false, an error will be returned.

Previous
Data Ingestion