monoshiri.ai API (1.0.0)
The external API for monoshiri.ai. Upload internal documents and programmatically access AI-powered search and Q&A features.
POST /v1/auth/token
Content-Type: application/json
{
"grant_type": "password",
"username": "admin@example.com",
"password": "yourpassword",
"team_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Use the access_token from the response in subsequent requests.
GET /v1/teams/{teamId}/folders
Authorization: Bearer <access_token>
X-Team-Id: <team_id>
When the access_token expires (after expires_in seconds), use the refresh_token to obtain a new pair:
POST /v1/auth/token
Content-Type: application/json
{
"grant_type": "refresh_token",
"refresh_token": "<refresh_token>"
}
POST /v1/teams/{teamId}/folders/{folderId}/documents/upload-url
Authorization: Bearer <access_token>
Content-Type: application/json
{
"filename": "manual.pdf",
"mime_type": "application/pdf",
"size_bytes": 1048576,
"sha256_hash": "e3b0c44298fc1c149afb...",
"skip_if_duplicate": true
}
The response contains upload_url (S3 endpoint), upload_fields (form fields), and document_id. If duplicate: true is returned, steps 2 and 3 are not required.
POST <upload_url> Content-Type: multipart/form-data # Include all upload_fields as form fields, then append the file field last key=<s3_key>&Content-Type=application/pdf&...&file=<binary>
POST /v1/teams/{teamId}/folders/{folderId}/documents/{docId}/confirm
Authorization: Bearer <access_token>
A successful confirm triggers the vectorization pipeline. Poll the GET endpoint until the status changes from processing to ready.
| Role | Get Token | List Folders | Upload | View Documents | Delete Documents |
|---|---|---|---|---|---|
| admin | Yes | Yes | Yes | Yes | Yes |
| manager | Yes | Yes | Yes | Yes | Yes |
| member | No (403) | Yes | No (403) | Yes | No (403) |
All error responses use the following format:
{
"statusCode": 400,
"message": "Bad Request",
"timestamp": "2024-01-01T00:00:00.000Z"
}
Authentication errors (401) and permission errors (403) may include OAuth2.0-compatible error / error_description fields in the message field.