Download OpenAPI specification:
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>"
}
File uploads use S3 Presigned POST.
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.
POST /v1/auth/token: 10 requests per 60 seconds (10 req/60s)429 Too Many Requests.OAuth2.0-compatible token issuance endpoint.
Issues a token using email and password.
Restrictions:
admin or manager roles are allowed (member returns 403)mfa_required)After the access_token expires, use the refresh_token to obtain a new token pair.
The refresh token itself is rotated; the old token becomes invalid.
| grant_type required | string Value: "password" |
| username required | string <email> User's email address |
| password required | string User's password |
| team_id required | string <uuid> Team ID (required in multi-tenant environments) |
{- "grant_type": "password",
- "username": "admin@example.com",
- "password": "string",
- "team_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{- "access_token": "string",
- "token_type": "Bearer",
- "expires_in": 3600,
- "refresh_token": "string"
}Returns the list of folders (knowledge units) for the specified team.
Available roles: admin, manager, member
Only folders accessible based on the user's folder access rights (read/edit) are returned.
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
{- "items": [
- {
- "folder_id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
- "name": "Product Manuals",
- "description": "Product manuals and user guides",
- "document_count": 5,
- "created_at": "2024-01-01T00:00:00.000Z",
- "updated_at": "2024-01-02T12:00:00.000Z"
}
]
}Issues an S3 Presigned POST URL. This is Step 1 of the document upload flow.
Available roles: admin, manager
If sha256_hash and skip_if_duplicate: true are specified, the system checks whether a document with the same hash and ready status already exists in the folder.
If a duplicate is detected, duplicate: true is returned, and Steps 2 (S3 upload) and 3 (confirm) are not needed.
| Format | MIME Type |
|---|---|
| application/pdf | |
| Plain Text | text/plain |
| Markdown | text/markdown |
| HTML | text/html |
| Word (.doc) | application/msword |
| Word (.docx) | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| Excel (.xls) | application/vnd.ms-excel |
| Excel (.xlsx) | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| PowerPoint (.ppt) | application/vnd.ms-powerpoint |
| PowerPoint (.pptx) | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| CSV | text/csv |
| JPEG Image | image/jpeg |
| PNG Image | image/png |
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
| folderId required | string <uuid> Example: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Folder ID (UUID format) |
| filename required | string Name of the file to upload |
| mime_type required | string Enum: "application/pdf" "text/plain" "text/markdown" "text/html" "application/msword" "application/vnd.openxmlformats-officedocument.wordprocessingml.document" "application/vnd.ms-excel" "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" "application/vnd.ms-powerpoint" "application/vnd.openxmlformats-officedocument.presentationml.presentation" "text/csv" "image/jpeg" "image/png" MIME type of the file |
| size_bytes | integer File size in bytes. Optional but recommended. |
| sha256_hash | string SHA-256 hash of the file (hex string). Used for duplicate detection. |
| skip_if_duplicate | boolean Default: false Skip upload if a document with the same sha256_hash already exists |
{- "filename": "product-manual-v2.pdf",
- "mime_type": "application/pdf",
- "size_bytes": 1048576,
- "sha256_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
- "skip_if_duplicate": true
}{- "duplicate": false,
- "document_id": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz",
- "upload_fields": {
- "key": "teams/xxx/folders/yyy/zzz/product-manual-v2.pdf",
- "Content-Type": "application/pdf",
- "AWSAccessKeyId": "AKIAIOSFODNN7EXAMPLE",
- "policy": "eyJleHBpcmF0aW9uIjoiMjAy...",
- "signature": "Xxxxxxxxxxxxxxxxxxx="
}, - "s3_key": "teams/xxx/folders/yyy/zzz/product-manual-v2.pdf"
}Notifies the API that the S3 file upload is complete and triggers the vectorization pipeline. This is Step 3 of the document upload flow.
Available roles: admin, manager
The S3 upload (Step 2) must be completed before calling this endpoint.
After a successful confirm, the document status changes from uploading to processing.
Once vectorization is complete, the status becomes ready.
Processing time varies based on file size and content (typically a few seconds to a few minutes).
Poll GET /v1/teams/{teamId}/folders/{folderId}/documents/{docId} to check status.
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
| folderId required | string <uuid> Example: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Folder ID (UUID format) |
| docId required | string <uuid> Example: zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz Document ID (UUID format) |
{- "document_id": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz",
- "status": "processing",
- "message": "Upload confirmed. Vectorization pipeline started."
}Returns documents in the specified folder with cursor-based pagination.
Available roles: admin, manager, member
If next_cursor is not null, there are more pages.
Pass cursor=<next_cursor> in the next request.
Use the sort parameter to specify the sort order (default: created_at_desc).
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
| folderId required | string <uuid> Example: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Folder ID (UUID format) |
| status | string Enum: "uploading" "processing" "ready" "error" Filter by document status |
| q | string Example: q=manual Partial match search on filename |
| cursor | string Pagination cursor (pass |
| limit | integer [ 1 .. 100 ] Default: 20 Number of items per page (1-100, default 20) |
| sort | string Default: "created_at_desc" Enum: "created_at_asc" "created_at_desc" "filename_asc" "filename_desc" "size_bytes_asc" "size_bytes_desc" Sort order |
{- "items": [
- {
- "document_id": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz",
- "folder_id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
- "filename": "product-manual-v2.pdf",
- "mime_type": "application/pdf",
- "size_bytes": 1048576,
- "status": "ready",
- "s3_key": "teams/xxx/folders/yyy/zzz/product-manual-v2.pdf",
- "chunk_count": 24,
- "uploaded_by": "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
- "created_at": "2024-01-01T00:00:00.000Z",
- "updated_at": "2024-01-01T01:00:00.000Z"
}
], - "next_cursor": "eyJpZCI6Inp6enovv..."
}Returns detailed information about the specified document.
Available roles: admin, manager, member
Can also be used for polling while the status changes from processing to ready.
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
| folderId required | string <uuid> Example: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Folder ID (UUID format) |
| docId required | string <uuid> Example: zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz Document ID (UUID format) |
{- "document_id": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz",
- "folder_id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
- "filename": "product-manual-v2.pdf",
- "mime_type": "application/pdf",
- "size_bytes": 1048576,
- "status": "ready",
- "s3_key": "teams/xxx/folders/yyy/zzz/product-manual-v2.pdf",
- "chunk_count": 24,
- "uploaded_by": "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
- "created_at": "2024-01-01T00:00:00.000Z",
- "updated_at": "2024-01-01T01:00:00.000Z"
}Deletes the specified document. The file on S3 and vector data in S3 Vectors are also deleted.
Available roles: admin, manager
This action cannot be undone. AI search results that referenced this document are updated immediately.
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
| folderId required | string <uuid> Example: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Folder ID (UUID format) |
| docId required | string <uuid> Example: zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz Document ID (UUID format) |
{- "statusCode": 400,
- "message": "Bad Request",
- "timestamp": "2024-01-01T00:00:00.000Z"
}Returns all documents across the team with cursor-based pagination. This is a supplementary endpoint for cross-folder searches.
Available roles: admin, manager, member
For folder-specific document operations, use /v1/teams/{teamId}/folders/{folderId}/documents instead.
Uses the same parameters as /v1/teams/{teamId}/folders/{folderId}/documents.
| teamId required | string <uuid> Example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Team ID (UUID format) |
| status | string Enum: "uploading" "processing" "ready" "error" Filter by document status |
| q | string Example: q=manual Partial match search on filename |
| cursor | string Pagination cursor |
| limit | integer [ 1 .. 100 ] Default: 20 Number of items per page (1-100, default 20) |
| sort | string Default: "created_at_desc" Enum: "created_at_asc" "created_at_desc" "filename_asc" "filename_desc" "size_bytes_asc" "size_bytes_desc" Sort order |
{- "items": [
- {
- "document_id": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz",
- "folder_id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
- "filename": "product-manual-v2.pdf",
- "mime_type": "application/pdf",
- "size_bytes": 1048576,
- "status": "ready",
- "s3_key": "teams/xxx/folders/yyy/zzz/product-manual-v2.pdf",
- "chunk_count": 24,
- "uploaded_by": "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
- "created_at": "2024-01-01T00:00:00.000Z",
- "updated_at": "2024-01-01T01:00:00.000Z"
}
], - "next_cursor": "eyJpZCI6Inp6enovdi4uLiJ9"
}