API
Agent API
Read and organize a Space's files over HTTP with a bearer token. List and search files, change details, add files from a URL, manage folders and create shares.
The agent API does what agents need from the library: browse and search files, change their details, add files from a URL, sort them into folders and share them. The MCP server runs on it, and /openapi.json describes it.
Signing in
Every request carries a session token from www.obelism.studio as the bearer, the same token Content's agent API takes:
POST https://www.obelism.studio/api/agent/auth/sign-in
Content-Type: application/json
{ "email": "…", "password": "…" }It answers a token. An account with two-factor authentication also sends code, the current code from the authenticator app. Then:
Authorization: Bearer <token>You act as yourself: reads take any role in the Space, changes take an admin, developer or editor role. Agents connected through MCP use OAuth instead and need no token.
Operations
Every path below starts with /api/agent. {org} and {space} are the ids from listOrganizations and listSpaces.
| Operation | Request |
|---|---|
listOrganizations | GET /organizations |
listSpaces | GET /organizations/{org}/spaces |
listFiles | GET /organizations/{org}/spaces/{space}/files |
uploadFile | POST /organizations/{org}/spaces/{space}/files |
getFile | GET …/{space}/files/{assetId} |
updateFile | POST …/{space}/files/{assetId} |
listFolders | GET …/{space}/folders |
createFolder | POST …/{space}/folders |
changeFolder | POST …/{space}/folders/{folderId} |
deleteFolder | POST …/{space}/folders/{folderId}/delete |
moveFiles | POST …/{space}/move-files |
listShares | GET …/{space}/shares |
createShare | POST …/{space}/shares |
listUploadRules | GET …/{space}/rules |
Send and expect JSON.
Files
listFileslists files newest first, 48 at a time (limit, 100 at most;skipto page), withtotal.folderIdkeeps to one folder (empty for the root);query(part of the file name),tagandproduct(a Shopify product GID,gid://shopify/Product/…) search every folder.getFileanswers one file with its details,usages(where Content uses it) andoriginalUrl: the raw file behind a link that lasts 15 minutes.updateFilechangestitleandalt({ "en": "…" }, per language),focalPoint({ x, y }, each 0 to 1, ornull),tags(the whole list) andfolderId(nullfor the root). Leave out what stays.uploadFilefetches a file from anhttpsURL (url, 50 MB at most, of the type it claims), intofolderIdor where the upload rules put it, with optionaltitle,altandtags.
A file's url is its optimized URL on Content, the one sites use.
curl https://media.obelism.studio/api/agent/organizations/$ORG/spaces/$SPACE/files/$FILE \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "alt": { "en": "Two people on a beach at sunset" }, "focalPoint": { "x": 0.4, "y": 0.6 } }'Folders
listFoldersanswers every folder with itsparentIdand how many files it holds, androotFiles.createFoldertakesnameand an optionalparentId.changeFolderrenames (name) and moves (parentId,nullfor the root) a folder, either or both.deleteFolderdeletes an empty folder; one that still holds folders or files answers409.moveFilesmovesassetIds(up to 500) intofolderId(nullfor the root). No URL changes.
Shares and rules
createSharesharesassetIds(up to 100) or afolderId, fromstartsAt(now) toendsAt(a week; a month at most), with apasswordof at least 8 characters, made up when left out. It answers the link and the password, which is never readable again. See shares.listShareslists the Space's shares with their window and openings;assetIdkeeps to the shares holding that file.listUploadRulesanswers the Space's upload rules, in order.
Limits and errors
300 calls a minute per person, across the API and the MCP server. Errors are problem JSON with a code and a hint (errors).
What the agent API doesn't do: replacing, deleting or making files private, uploading from your computer, and ending shares. Use the library for those.