日本語 | English

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.

Authentication Flow

Step 1: Obtain a token (password grant)

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.

Step 2: Make authenticated requests

GET /v1/teams/{teamId}/folders
Authorization: Bearer <access_token>
X-Team-Id: <team_id>

Step 3: Refresh the token

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>"
}

Document Upload Flow (3 Steps)

File uploads use S3 Presigned POST.

Step 1: Get upload URL

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.

Step 2: Upload directly to S3

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>

Step 3: Confirm upload

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.


Roles and Permissions

RoleGet TokenList FoldersUploadView DocumentsDelete Documents
adminYesYesYesYesYes
managerYesYesYesYesYes
memberNo (403)YesNo (403)YesNo (403)

Error Format

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.


Rate Limiting

  • POST /v1/auth/token: 10 requests per 60 seconds (10 req/60s)
  • Authenticated general endpoints: 60 requests per minute (60 req/min)
  • Exceeding these limits returns 429 Too Many Requests.
Servers
Production
https://api.monoshiri.ai