adaline.ink API Reference
Complete REST API documentation for the Adaline platform.
Base URL
https://api.adaline.ink
Authentication
All API requests require a Bearer token in the Authorization header. Obtain tokens via the login endpoint.
Authorization: Bearer <access_token>
Access tokens expire after 15 minutes. Use the refresh endpoint to obtain a new one.
Error Format
All errors return JSON with an error or detail field:
{
"detail": "Document not found"
}
HTTP status codes: 400 (validation), 401 (unauthorized), 403 (forbidden), 404 (not found), 429 (rate limited), 500 (server error).
Rate Limits
API requests are rate-limited per IP. If you exceed the limit, you'll receive a 429 response. Wait and retry.
Auth
POST /api/v1/auth/register
Create a new account.
| Field | Type | Required |
|---|---|---|
| string | Yes | |
| password | string | Yes |
| full_name | string | Yes |
| invite_token | string | No |
Returns: { user, tokens: { access_token, refresh_token } }
POST /api/v1/auth/login
| Field | Type | Required |
|---|---|---|
| string | Yes | |
| password | string | Yes |
Returns: { access_token, refresh_token, token_type }
POST /api/v1/auth/refresh
| Field | Type | Required |
|---|---|---|
| refresh_token | string | Yes |
Returns: { access_token, refresh_token, token_type }
POST /api/v1/auth/logout
| Field | Type | Required |
|---|---|---|
| refresh_token | string | Yes |
Users
GET /api/v1/users/me
Returns the current user profile including onboarding state and survey responses.
PATCH /api/v1/users/me
Update user settings.
| Field | Type |
|---|---|
| show_badge | boolean |
GET /api/v1/users/me/onboarding
Returns: { step, completed }
PATCH /api/v1/users/me/onboarding
| Field | Type |
|---|---|
| step | number |
| completed | boolean |
| skipped | boolean |
GET /api/v1/users/me/survey
Returns: { responses }
PUT /api/v1/users/me/survey
Replace all survey responses.
| Field | Type |
|---|---|
| responses | object |
Organizations
GET /api/v1/orgs/
List organizations the current user belongs to.
POST /api/v1/orgs/
Create a new organization.
| Field | Type | Required |
|---|---|---|
| name | string | Yes |
GET /api/v1/orgs/:org_id
Get organization details.
GET /api/v1/orgs/:org_id/members
List organization members with roles.
POST /api/v1/orgs/:org_id/invitations
Invite a user to the organization.
| Field | Type | Required |
|---|---|---|
| string | Yes | |
| role | string | No (default: member) |
Documents
GET /api/v1/documents/?org_id=:org_id
List documents for an organization. Returns uploaded_by_name and tags.
POST /api/v1/documents/upload?org_id=:org_id
Upload a document. Send as multipart/form-data with a file field.
Supported formats: PDF, DOCX, PPTX, HTML, Markdown, LaTeX, PNG, JPG.
Max sizes: PDF/PPTX 100MB, DOCX 50MB, HTML/MD/LaTeX 10MB, Images 20MB.
Returns: { id, filename, content_type, size_bytes, doc_type }
GET /api/v1/documents/:id
Get document details including tags and uploader name.
GET /api/v1/documents/:id/preview
Get a presigned URL to preview/download the document. URL expires in 1 hour.
Returns: { preview_url, content_type, filename }
DELETE /api/v1/documents/:id
Delete a document and all associated data (versions, shares, tags, jobs).
Document Sharing
POST /api/v1/documents/:id/shares
Share a document with a user or organization.
| Field | Type |
|---|---|
| user_email | string |
| org_id | string |
| permission | string (view, score, full) |
GET /api/v1/documents/:id/shares
List shares for a document.
DELETE /api/v1/documents/:id/shares/:share_id
Revoke a share.
POST /api/v1/documents/:id/public-share
Create a public read-only link (adaline.observer).
| Field | Type |
|---|---|
| expires_in_days | number (optional) |
Returns: { id, token, url, expires_at }
GET /api/v1/public/:token
View a public share (no authentication required). Returns document metadata and presigned preview URL.
Conversions
POST /api/v1/conversions/
Start a document conversion job.
| Field | Type | Required |
|---|---|---|
| document_id | string | Yes |
Returns: { job_id, document_id, status }
GET /api/v1/conversions/:job_id
Get conversion job status with pipeline steps.
Returns: { id, status, steps: [{ step_name, status, duration_ms }] }
Compliance
POST /api/v1/compliance/test
Run a compliance check on a document.
| Field | Type | Required |
|---|---|---|
| document_id | string | Yes |
| tiers | number[] | No (default: [1]) |
Returns: { overall_score, grade, compliant, categories, checks }
GET /api/v1/compliance/reports/:document_id
List compliance reports for a document.
GET /api/v1/compliance/reports/:document_id/:report_id
Get a specific compliance report with full check details.
Tags
GET /api/v1/tags?org_id=:org_id
List tags for an organization.
POST /api/v1/tags
Create a tag.
| Field | Type | Required |
|---|---|---|
| name | string | Yes |
| color | string | No |
| org_id | string | Yes |
DELETE /api/v1/tags/:tag_id
Delete a tag.
POST /api/v1/tags/:tag_id/documents/:document_id
Add a tag to a document.
DELETE /api/v1/tags/:tag_id/documents/:document_id
Remove a tag from a document.
Analytics
GET /api/v1/analytics/dashboard?org_id=:org_id
Dashboard analytics: document counts, storage, upload trends, compliance scores, job statuses.
GET /api/v1/analytics/org/:org_id
Per-user analytics for organization overview.
GET /api/v1/analytics/onboarding
Onboarding funnel analytics (staff only). Returns completion rate, drop-off by step, survey completion, time to first upload.