{"openapi":"3.0.3","info":{"title":"iMothership Public API","version":"1.0.0","description":"Integration endpoints and public widgets. For authenticated endpoints, select Authorize and enter a project API key (x-api-key) or bearer token. Use one authentication method at a time. Try it out sends real requests. API and skill payloads depend on your project configuration. Download this specification at /api/docs/openapi.json. Internal application CRUD endpoints are outside this reference."},"externalDocs":{"description":"CLI installation and usage guide","url":"/api/docs/cli"},"servers":[{"url":"/","description":"Current API host"}],"tags":[{"name":"APIs"},{"name":"Skills"},{"name":"Tasks"},{"name":"Logs"},{"name":"Webhooks"},{"name":"Public AI"},{"name":"Marketplace"}],"components":{"securitySchemes":{"ProjectApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"An active project API key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"ApiKeyAuthorization":{"type":"apiKey","in":"header","name":"Authorization","description":"Enter ApiKey followed by a space and your project API key"}}},"paths":{"/api/v1/logs":{"get":{"tags":["Logs"],"operationId":"searchAgentLogs","summary":"Retrieve logs by project, date and keyword","security":[{"ProjectApiKey":[]},{"BearerAuth":[]},{"ApiKeyAuthorization":[]}],"description":"Returns logs, including activity and response text, newest first (date then ID). Searches the agentlogs collection, including task, AI and API logs. Project name is an exact case-insensitive match. Project API keys and agent tokens are restricted to their own project; user tokens require project membership or organization-admin access. Inaccessible and unknown projects both return 404. Dates filter the log start date. Date-only values use UTC: from starts at midnight, to includes the whole day. ISO timestamps must include a timezone and are inclusive. Keyword is a literal case-insensitive substring in agentName, reference, response or activity.description. Omitted date/keyword filters do not restrict results.","parameters":[{"name":"projectName","in":"query","required":true,"description":"Exact project name, ignoring case","schema":{"type":"string","minLength":1,"maxLength":200},"example":"Customer Support"},{"name":"from","in":"query","description":"YYYY-MM-DD or ISO timestamp with timezone","schema":{"type":"string"},"example":"2026-09-01"},{"name":"to","in":"query","description":"YYYY-MM-DD or ISO timestamp with timezone","schema":{"type":"string"},"example":"2026-09-10"},{"name":"keyword","in":"query","schema":{"type":"string","minLength":1,"maxLength":200},"example":"invoice"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"skip","in":"query","description":"Number of matching logs to skip, not page number","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Matching logs; an empty docs array means no matches","content":{"application/json":{"schema":{"type":"object","required":["project","docs","total","limit","skip","hasMore"],"properties":{"project":{"type":"object","required":["_id","name"],"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"docs":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"agentQueueId":{"type":"string"},"projectId":{"type":"string"},"date":{"type":"string","format":"date-time"},"status":{"type":"integer","description":"1 = OK, 2 = failed"},"source":{"type":"string"},"reference":{"type":"string"},"response":{"type":"string"},"activity":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Activity text; may contain HTML"}}}},"runtime":{"type":"number","description":"Runtime in milliseconds"},"isRunning":{"type":"boolean"},"lastUpdatedOn":{"type":"string","format":"date-time"},"completedOn":{"type":"string","format":"date-time"}}}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid filters or date range","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"Invalid project credential scope","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Project not found or not accessible","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"409":{"description":"Multiple accessible projects share this name; use a project API key","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Unable to retrieve agent logs","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/v1/api/{apiPath}":{"get":{"tags":["APIs"],"operationId":"getAPI","summary":"Execute an API","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"BearerAuth":[]},{"ApiKeyAuthorization":[]}],"parameters":[{"name":"apiPath","in":"path","required":true,"description":"API ID or configured path","schema":{"type":"string"}}],"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}},"post":{"tags":["APIs"],"operationId":"postAPI","summary":"Execute an API","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"BearerAuth":[]},{"ApiKeyAuthorization":[]}],"parameters":[{"name":"apiPath","in":"path","required":true,"description":"API ID or configured path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/v1/skill/{skillPath}":{"get":{"tags":["Skills"],"operationId":"getSkill","summary":"Retrieve a skill","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"BearerAuth":[]},{"ApiKeyAuthorization":[]}],"parameters":[{"name":"skillPath","in":"path","required":true,"description":"Skill ID or configured path","schema":{"type":"string"}}],"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}},"post":{"tags":["Skills"],"operationId":"postSkill","summary":"Retrieve a skill","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"BearerAuth":[]},{"ApiKeyAuthorization":[]}],"parameters":[{"name":"skillPath","in":"path","required":true,"description":"Skill ID or configured path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/v1/task/{id}":{"post":{"tags":["Tasks"],"operationId":"queueTask","summary":"Queue a task run","security":[{"ProjectApiKey":[]},{"BearerAuth":[]},{"ApiKeyAuthorization":[]}],"description":"Queues the task and returns immediately. The current handler does not persist request-body data in the queue record; payload delivery to the worker is not supported.","parameters":[{"name":"id","in":"path","required":true,"description":"Task (agent) ID in the authenticated project","schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"responses":{"202":{"description":"Agent queued; this does not indicate completion","content":{"application/json":{"schema":{"type":"object","required":["message","queueJobId","status","trackAt"],"properties":{"message":{"type":"string","example":"Agent queued and running"},"queueJobId":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"status":{"type":"string","enum":["running"]},"trackAt":{"type":"string","example":"/api/agent/queue/0123456789abcdef01234567"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/v1/webhook/{webhookId}":{"post":{"tags":["Webhooks"],"operationId":"receiveWebhook","summary":"Receive an inbound webhook","security":[],"description":"The URL contains an active project key of webhook-endpoint type. Keep the full URL private. An optional resume token continues a waiting agent.","parameters":[{"name":"webhookId","in":"path","required":true,"description":"Webhook endpoint key","schema":{"type":"string"}},{"name":"resume","in":"query","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}},"text/plain":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Webhook recorded","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"410":{"description":"Continuation expired","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/public-ai/message":{"post":{"tags":["Public AI"],"operationId":"publicAiMessage","summary":"Ask the public AI about iMothership","security":[],"description":"Uses a server-configured demo project. Visitor, IP and global quotas apply. The default maximum message length is 1200 characters; deployments can override it. History retains the last eight messages.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","example":"How can I automate a workflow?"},"history":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Guide answer","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string"},"remaining":{"type":"integer"},"agent":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"Demo quota reached","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"502":{"description":"No answer returned","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"Demo unavailable or not configured","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/pack/public":{"get":{"tags":["Marketplace"],"operationId":"listPublicPacks","summary":"List public marketplace packs","security":[],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":100}}],"responses":{"200":{"description":"Public packs","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","additionalProperties":true}},"total":{"type":"integer"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}}}}