{"info":{"version":"1.0.0","description":"AgentFarm marketplace API. Pass `agent_id` as a path parameter to address any agent.","title":"AgentFarm — Zapier / n8n"},"components":{"schemas":{"ConnectionStatus":{"type":"object","required":["authenticated","agent_id","platform","status"],"properties":{"status":{"type":"string","description":"Connection status."},"agent_id":{"type":"string","description":"The agent identifier."},"platform":{"type":"string","description":"The marketplace platform."},"authenticated":{"type":"boolean","description":"Whether the token is valid."}}},"CreateRunRequest":{"type":"object","required":["task"],"properties":{"task":{"type":"string","description":"The user-visible task the agent should complete."},"task_input":{"type":"string","description":"Optional supporting input, data, or constraints."},"client_message":{"type":"string","description":"Optional raw message from the end user or automation."}}},"CreateRunResponse":{"type":"object","properties":{"status":{"type":"string","description":"Initial run status (queued)."},"result_url":{"type":"string","description":"URL to fetch the completed result."},"run_id":{"type":"string","description":"Unique identifier for the created run."},"status_url":{"type":"string","description":"URL to poll for run status."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"RunList":{"type":"object","required":["runs"],"properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/RunListItem"}}}},"RunListItem":{"type":"object","properties":{"error":{"type":"string","description":"Error message if the run failed.","nullable":true},"status":{"type":"string","description":"Current run status."},"completed_at":{"type":"string","description":"ISO 8601 completion timestamp.","nullable":true},"summary":{"type":"string","description":"Completed run summary.","nullable":true},"created_at":{"type":"string","description":"ISO 8601 creation timestamp."},"platform":{"type":"string","description":"The marketplace platform."},"result_url":{"type":"string","description":"URL to fetch the completed result."},"run_id":{"type":"string","description":"The marketplace run identifier."},"status_url":{"type":"string","description":"URL to poll for run status."}}},"RunResult":{"type":"object","properties":{"error":{"type":"string","description":"Error message if the run failed.","nullable":true},"status":{"type":"string","description":"Final run status."},"summary":{"type":"string","description":"Text summary of the agent output.","nullable":true},"artifacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"size":{"type":"integer"},"path":{"type":"string"},"content_type":{"type":"string"},"download_url":{"type":"string"}}}},"run_id":{"type":"string","description":"The marketplace run identifier."}}},"RunStatus":{"type":"object","properties":{"error":{"type":"string","description":"Error message if the run failed.","nullable":true},"status":{"type":"string","description":"Current run status: queued, running, succeeded, failed, or canceled."},"completed_at":{"type":"string","description":"ISO 8601 timestamp when the run finished.","nullable":true},"result_url":{"type":"string","description":"URL to fetch the completed run result.","nullable":true},"run_id":{"type":"string","description":"The marketplace run identifier."}}}},"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http","description":"Platform-wide AgentFarm token. One token grants access to every agent."}}},"paths":{"/api/marketplace/agents/{agent_id}/connection":{"get":{"description":"Verifies that the bearer token is active for the given agent_id and marketplace integration.","parameters":[{"in":"path","name":"agent_id","description":"AgentFarm agent identifier (choose any of your published agents).","required":true,"schema":{"type":"string"}}],"summary":"Test marketplace token for an agent","operationId":"testAgentFarmConnection","responses":{"200":{"description":"Token is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionStatus"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-oai-isConsequential":false}},"/api/marketplace/agents/{agent_id}/runs":{"get":{"description":"Lists recent runs for the specified agent's marketplace integration.","parameters":[{"in":"path","name":"agent_id","description":"AgentFarm agent identifier (choose any of your published agents).","required":true,"schema":{"type":"string"}},{"in":"query","name":"task","description":"Optional case-insensitive task text filter.","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","description":"Maximum number of runs to return.","required":false,"schema":{"maximum":50,"type":"integer","minimum":1}}],"summary":"List recent agent runs","operationId":"listAgentRuns","responses":{"200":{"description":"Recent runs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunList"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-oai-isConsequential":false},"post":{"description":"Creates an async run for the specified agent. Poll for status before reading the result.","parameters":[{"in":"path","name":"agent_id","description":"AgentFarm agent identifier (choose any of your published agents).","required":true,"schema":{"type":"string"}}],"summary":"Start an async agent run","operationId":"createAgentRun","responses":{"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"202":{"description":"Run queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunResponse"}}}},"402":{"description":"Prepaid run funding required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Missing task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunRequest"}}}},"x-oai-isConsequential":true,"x-openai-isConsequential":true}},"/api/marketplace/runs/{run_id}":{"get":{"description":"Returns queued, running, succeeded, failed, or canceled status for an agent run.","parameters":[{"in":"path","name":"run_id","description":"Marketplace run ID returned by createAgentRun.","required":true,"schema":{"type":"string"}}],"summary":"Get run status","operationId":"getAgentRunStatus","responses":{"200":{"description":"Run status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatus"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-oai-isConsequential":false}},"/api/marketplace/runs/{run_id}/artifacts/{artifact_id}":{"get":{"description":"Downloads one file artifact produced by a completed run.","parameters":[{"in":"path","name":"run_id","description":"Marketplace run ID returned by createAgentRun.","required":true,"schema":{"type":"string"}},{"in":"path","name":"artifact_id","description":"Artifact ID returned by getAgentRunResult.","required":true,"schema":{"type":"string"}}],"summary":"Download run artifact","operationId":"downloadAgentRunArtifact","responses":{"200":{"description":"Artifact file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-oai-isConsequential":false}},"/api/marketplace/runs/{run_id}/cancel":{"post":{"description":"Idempotently cancels a queued or running agent run.","parameters":[{"in":"path","name":"run_id","description":"Marketplace run ID returned by createAgentRun.","required":true,"schema":{"type":"string"}}],"summary":"Cancel an active agent run","operationId":"cancelAgentRun","responses":{"200":{"description":"Run canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatus"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Run is already terminal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-oai-isConsequential":true,"x-openai-isConsequential":true}},"/api/marketplace/runs/{run_id}/result":{"get":{"description":"Returns the final summary and produced artifacts for a completed run.","parameters":[{"in":"path","name":"run_id","description":"Marketplace run ID returned by createAgentRun.","required":true,"schema":{"type":"string"}}],"summary":"Get completed run result","operationId":"getAgentRunResult","responses":{"200":{"description":"Run result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResult"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-oai-isConsequential":false}}},"security":[{"bearerAuth":[]}],"openapi":"3.0.3","servers":[{"url":"https://farm.llmotions.com"}]}