The MKA1 API provides resource-level role-based access control (RBAC) through the authorization endpoints. Use these endpoints to grant, check, and revoke permissions on LLM resources for specific users.Documentation Index
Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
Use this file to discover all available pages before exploring further.
How resource authorization works
Every LLM resource (completion, file, vector store, conversation, response, or skill) can have per-user roles assigned to it. Three roles form a strict hierarchy:| Role | Can do |
|---|---|
| owner | Grant and revoke roles, plus everything writer can do |
| writer | Modify the resource, plus everything reader can do |
| reader | Read the resource |
conv_ ID, creating a response returns a resp_ ID, and uploading a file returns a file_ ID.
The authenticated caller (or the end user specified via X-On-Behalf-Of) automatically becomes the owner of that resource.
Use the returned resource ID with the authorization endpoints below to manage access for other users.
Only owners can grant or revoke roles.
If a non-owner attempts to grant or revoke, the API returns 403 Forbidden.
These authorizations are enforced by the MKA1 backend on every request.
Any attempt to read, modify, or delete a resource that the caller does not have access to is rejected with an appropriate error response.
You can also grant public access by using "*" as the user ID, but only for writer or reader roles.
Grant a role to a user
UsePOST /api/v1/authorization/llm/grant to assign a role to a user on a resource.
The caller must be the resource owner.
204 No Content.
The resourceType must be one of: completion, file, vector_store, conversation, response, or skill.
The role must be one of: owner, writer, or reader.
Check a user’s permission
UseGET /api/v1/authorization/llm/check to verify whether the authenticated caller has a specific role on a resource.
The response contains an allowed boolean.
reader or writer check.
Revoke a role
UsePOST /api/v1/authorization/llm/revoke to remove a role from a user.
Only the resource owner can revoke.
204 No Content.
Grant public access
Grant a role to all authenticated users by settinguserId to "*".
Public access is restricted to writer and reader roles — you cannot make someone a public owner.
Handle authorization errors
When a non-owner attempts to grant or revoke, the API returns403 Forbidden:
End-to-end example: two users with different roles
This walkthrough demonstrates distinct user profiles with differentiated permissions. Alice creates a conversation (becoming its owner), then grants read access to Bob. We verify that Bob can read but cannot write, and that Bob cannot grant permissions to others.Next steps
- Review the Authentication guide for API key and JWT usage.
- API Reference for the authorization endpoints:
POST /api/v1/authorization/llm/grant— Grant a rolePOST /api/v1/authorization/llm/revoke— Revoke a roleGET /api/v1/authorization/llm/check— Check permission