Ragcy API Documentation
Node.js Client Documentation
Base URL
Authentication
Routes
Creates a new corpus
Retrieves a list of all corpus
Updates an existing corpus
Deletes a corpus
Query a corpus
Add a data source
Retrieves a list of data sources
Removes a data source
Retrieves a list of sessions
Retrieves a list of requests
Allowed File Extensions
Base URL
https://api.ragcy.com
Authentication
All requests require an API key for authentication.
The API key should be included in the
Authorization
header as a Bearer token.
Routes
Creates a new corpus.
URL
: /corpus
Method
: POST
Headers
:
Authorization: Bearer <API_KEY>
Content-Type: application/json
Parameters
:
category (string): The category of the corpus.
name (string): The name of the corpus.
welcomeMessage (string, optional): An optional welcome message for the corpus.
agentInstruction (string, optional): Optional instructions for the agent.
prompt (string, optional): An optional prompt for the corpus.
Returns
:
success (boolean)
error (string) | optional
corpus: Corpus Object
Retrieves a list of all corpora
URL
: /corpus
Method
: GET
Headers
:
Authorization: Bearer <API_KEY>
Returns
: An array of corpus objects.
Updates an existing corpus.
URL
: /corpus/{id}
Method
: PUT
Headers
:
Authorization: Bearer <API_KEY>
Content-Type: application/json
Parameters
:
id (string): The ID of the corpus to update.
data (object): The data to update the corpus with.
Returns
:
success (boolean)
error (string) | optional
corpus: Corpus Object
Deletes a corpus.
URL
: /corpus/{id}
Method
: DELETE
Headers
:
Authorization: Bearer <API_KEY>
Parameters
:
id (string): The ID of the corpus to delete.
Returns
:
success (boolean)
error (string) | optional
Query a corpus with user input.
URL
: /corpus/query
Method
: GET
Headers
:
Authorization: Bearer <API_KEY>
Parameters
:
corpusId (string): The ID of the corpus to query.
input (string): The user's input query.
sessionId (string, optional): An optional session ID for continuing a conversation.
Returns
:
success (boolean)
error (string) | optional
response (string)
sessionId (integer)
Add a data source to a corpus.
URL
: /datasources
Method
: POST
Headers
:
Authorization: Bearer <API_KEY>
Content-Type: multipart/form-data
Parameters
:
corpusId (string): The ID of the corpus to add the data source to.
filePath (string, optional): The path to the file to upload, if adding a file.
url (string, optional): The URL of the data source, if adding a URL.
Returns
:
success (boolean)
error (string) | optional
datasource: datasource object.
Retrieves a list of data sources for a specific corpus.
URL
: /datasources/{corpusId}
Method
: GET
Headers
:
Authorization: Bearer <API_KEY>
Parameters
:
corpusId (string): The ID of the corpus to get data sources for.
Returns
:
success (boolean)
error (string) | optional
datasources: An array of data source objects.
Removes a data source.
URL
: /datasources/{id}
Method
: DELETE
Headers
:
Authorization: Bearer <API_KEY>
Parameters
:
id (string): The ID of the data source to remove.
Returns
:
success (boolean)
error (string) | optional
Retrieves a list of sessions for a specific corpus.
URL
: /sessions/corpus/{corpusId}
Method
: GET
Headers
:
Authorization: Bearer <API_KEY>
Parameters
:
corpusId (string): The ID of the corpus to get sessions for.
Returns
:
success (boolean)
error (string) | optional
sessions: An array of session objects.
Retrieves a list of requests for a specific session.
URL
: /requests/session/{sessionId}
Method
: GET
Headers
:
Authorization: Bearer <API_KEY>
Parameters
:
sessionId (string): The ID of the session to get requests for.
order (string): The order of the requests (asc or desc).
Returns
:
success (boolean)
error (string) | optional
requests: An array of request objects.
Allowed File Extensions
json, xls, xlsx, mkv, mp4, mp3, wav, pdf, txt, csv, docx, doc