Internal use only!
A repository is a collection of files where these files are available to agents (and their LLMs) for data retrieval and other forms of file processing. If you want an agent to be able to answer questions based on the content of a file, you have to include that file in a repository. This helps distinguish between files that AI agents and models should have access to and those they shouldn't. A repository can contain any number of files, but certain AI models may work better with fewer files per repository. It's perfectly normal for a repository to contain only one file.
Create Repository
POST /api/repositories
curl https://management-api.useproteus.ai/api/repositories \
-X POST \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0" \
-d '{
"name": "My Website",
"description": "Repo for data gotten from my website",
"orgId": "6816330b6f46b5afc080fbf7"
}'
You can also create repositories via the orgs API POST: /api/orgs/:orgId/repositories
. You will not be able to supply an orgId
field in the request body.
curl https://management-api.useproteus.ai/api/orgs/6816330b6f46b5afc080fbf7/repositories \
-X POST \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0" \
-d '{
"name": "My Codebase",
"description": "Repo for data gotten from my codebase"
}'
Get Repository
GET /api/repositories/:repositoryId
This endpoint returns a repository.
curl https://management-api.useproteus.ai/api/repositories/682c55645e18601562636966 \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0"
You have to be a member of an organization to view a repository in that organization.
List Org Repositories
GET /api/orgs/:orgId/repositories
This endpoint fetches the repositories in an organization.
curl https://management-api.useproteus.ai/api/orgs/6816330b6f46b5afc080fbf7/repositories \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0"
If the current user is not a member of this organization, an error response is returned.
curl https://management-api.useproteus.ai/api/orgs/6816330b6f46b5afc080fbf7/app-integrations \
-H "Authorization: Bearer user-73dd22b0c07a542d080d48a2.9e0ac60c1472a5f2949f8978e82d2582.dfbaf5a25782b0608e173d295e977259.2a52f18cf2ce3d84872ae7fc73c60822ad6fe0ad7dc21f58"
Add Data Provider to Repository
POST /api/repositories/:repositoryId/data-providers
This endpoint adds a plugin instance as a data provider for a repository. The response of the API is the plugin instance.
A data provider is a plugin instance that listens for repository events. These data providers may also receive tokens that allow them to read or update the contents of files in the repositories to which they are attached.
Let's create a data provider plugin for our use cases.
curl https://management-api.useproteus.ai/api/orgs/6816330b6f46b5afc080fbf7/plugins \
-X POST \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0" \
-d '{
"name": "Openai File Uploader",
"description": "This plugin uploads files to Openai",
"events": ["REPOSITORY_FILE_ADDED", "REPOSITORY_FILE_REMOVED"],
"isPublic": true,
"scopes": ["REPOSITORY_FILES_READ"],
"tags": ["Openai"],
"type": "DATA_PROVIDER",
"webhookUrl": "https://myplugins.com/data-providers/upload-to-openai/webhook"
}'
Remember to verify your plugin's webhook.
curl https://management-api.useproteus.ai/api/plugins/68514c26d3b190e2d8f047d0/verify-webhook \
-X POST \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0"
Now, we add the plugin as a data provider for the repository.
curl https://management-api.useproteus.ai/api/repositories/682c6be95ebe9faa4fb63f55/data-providers \
-X POST \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0" \
-d '{
"name": "Openai File Uploader",
"pluginId": "68514c26d3b190e2d8f047d0",
"events": ["REPOSITORY_FILE_ADDED", "REPOSITORY_FILE_REMOVED"],
"scopes": ["REPOSITORY_FILES_READ"]
}'
This API call dispatches the PLUGIN_INSTALLED
event to the webhook of the plugin as a HTTP POST
request.
List Data Providers in Repository
GET /api/repositories/:repositoryId/data-providers
This endpoint lists the plugin instances acting as data providers for a repository. The repository must be visible to the current user for this API call to succeed.
curl https://management-api.useproteus.ai/api/repositories/682c6be95ebe9faa4fb63f55/data-providers \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0"
Delete Data Provider from Repository
DELETE /api/repositories/:repositoryId/data-providers/:pluginInstanceId
This endpoint deletes a plugin instance acting as a data provider for a repository.
The current user must be a member of the org with a role of OWNER
.
curl https://management-api.useproteus.ai/api/repositories/682c6be95ebe9faa4fb63f55/data-providers/685258b2bf8d49cf73829a64 \
-X DELETE \
-H "Authorization: Bearer user-3a4d80a9c3cca7ffd1bc341f.ede04d00e4b168bed35d9fcde8c2f92f.00d7fecf89201691f94b01e5b294da65.e7ea4c191b2c9a059ce5658deb7349c26a931ed8b7a04bf0"
This API call dispatches the PLUGIN_UNINSTALLED
event to the webhook of the plugin as a HTTP POST
request.