Moraya Integration
Configure Moraya to upload images to Picora by pasting a single JSON configuration snippet.
Prerequisites
- Moraya installed
- A Picora account with an API key (see Quickstart or API Keys management)
Configuration Steps
1. Open Moraya Preferences
In Moraya, go to Preferences → Image Upload → Custom Provider.
2. Paste the JSON Config
Copy and paste the following JSON configuration, replacing sk_live_YOUR_KEY with your actual API key:
{ "name": "Picora", "url": "https://api.picora.me/v1/images", "method": "POST", "headers": { "Authorization": "Bearer sk_live_YOUR_KEY" }, "bodyType": "multipart", "fileField": "file", "responseUrlPath": "data.url"}3. Save and Test
Click Save, then drag an image onto the Moraya window to test the upload. The permanent URL will be returned and ready to copy.
Config Field Reference
| Field | Description |
|---|---|
url | The Picora upload endpoint |
method | Always POST for uploads |
headers.Authorization | Your API key in Bearer format |
bodyType | Must be multipart for file uploads |
fileField | The form field name (file) |
responseUrlPath | JSON path to extract the URL from the response |
Notes
- The
data.urlpath extracts theurlfield from the nesteddataobject in Picora’s response - Each uploaded image gets a unique 11-character ID, e.g.,
https://media.picora.me/xK9mR2pQ7vB.webp - Images are permanently stored — URLs never expire
Test Connection (No Placeholder Upload)
Don’t upload a throwaway test image to verify your API key — it pollutes your library and counts against quotas. Instead, send a GET request to /v1/auth/verify:
curl -s https://api.picora.me/v1/auth/verify \ -H "Authorization: Bearer sk_live_YOUR_KEY"Expected response on success:
{ "success": true, "data": { "valid": true, "userId": "V1StGXR8_Z5jdHi6B-myT", "plan": "pro", "authType": "apiKey", "apiKeyId": "k_F7hY3nP0xQ8zJ2vR5aW1" }}200withvalid: true— credentials OK, no upload performed, no storage written401— API key is invalid or has been revoked- Zero database overhead (data is read from middleware cache); safe to call on every client launch or config save
AI Assistant via MCP (v0.13.0+)
Moraya v0.35+ embeds an MCP (Model Context Protocol) bridge so the built-in AI assistant can directly upload, list and manage Picora media — same npm package (@picora/mcp-server) used by Claude Desktop / Cursor.
Enable
Settings → AI Assistant → toggle Picora MCP. The currently bound API Key is used automatically (no extra config).
Recommended scope
When creating the API Key for Moraya, choose the read + write scope (no DELETE) to minimize AI accident potential. Moraya’s UI clearly surfaces the scope so you always see what the AI can do.
What it can do
The 8 tools (upload_image / upload_video / upload_audio / list_media / get_media / update_media / delete_media / get_usage) are available — typical usage:
“Upload all PNGs from this folder to Picora and replace markdown image paths with the cloud URLs.”
“I’m running low on storage — find my 5 biggest videos.”
For full tool reference, prompt templates, troubleshooting and privacy details, see AI Workflows → Moraya or MCP stdio integration.
Knowledge Base Sync (v0.17.0+)
Moraya v0.35.0+ can sync local knowledge bases directly to Picora’s KB namespace, preserving your directory structure and enabling incremental two-way sync.
How it works
- Bind a local KB to a Picora KB — in Moraya’s KB settings, link a local directory to a Picora KB ID (create the KB first at
center.picora.me/kbsor via API) - First sync — Moraya pulls the full manifest, diffs against local files, and pushes changes in a single batch
- Incremental sync — subsequent syncs use
sinceto pull only changed entries; Moraya storesserverTimefrom each manifest response to avoid clock drift
Requirements
- Moraya v0.35.0 or later
- An API Key with read + write scope (no DELETE needed for sync-only use)
- A Picora KB created in advance (one KB per local directory)
Enable in Moraya
Go to Settings → Knowledge Bases → Picora Sync, then for each local KB:
- Select the local directory
- Paste your Picora KB ID (from
center.picora.me/kbsorGET /v1/kbs) - Choose sync mode: manual / on-save / interval / startup+close
Conflict handling
When the same file is modified both locally and remotely before sync, Moraya shows a KbSyncConflictPanel with three options:
| Option | Result |
|---|---|
| Keep local | Local version overwrites remote |
| Accept remote | Remote version replaces local |
| Skip | File left in conflict state until next sync |
Server-side conflict reasons: REMOTE_NEWER, REMOTE_DELETED, BASE_MISSING, LOCAL_HASH_MISMATCH. See the KB API reference for details.
CLI / scripted sync
You can also sync without Moraya using the API directly:
# 1. Pull manifestcurl https://api.picora.me/v1/kbs/{kbId}/manifest \ -H "Authorization: Bearer sk_live_..."
# 2. Push changescurl -X POST https://api.picora.me/v1/kbs/{kbId}/sync \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{"ops": [{"op":"upsert","relativePath":"README.md","content":"...","sourceHash":"...","baseUpdatedAt":null}]}'See the multi-KB workflow guide for the full diff-and-sync pattern.
Related
- AI Workflows → Moraya — combined image-host + MCP workflow
- Multi-KB workflow — directory sync patterns and conflict resolution
- KB API reference — manifest, sync, and raw endpoints
- Image upload guide
- API Keys management
- Tool catalog — all 12 MCP tools