Use Public APIs for Sparkforge Agent Studio
The Agent Studio Public API lets external software list, inspect, and run production AI agents in Sparkforge without logging in. Authenticate with OAuth 2.0 or a Private Integration Token and target agents that are Active in the Production lifecycle.
Public APIs for Agent Studio let your software call, manage, and run any Sparkforge agent without logging into the dashboard. Requests are scoped to a sub-account (location) and authenticated with OAuth 2.0 or a Private Integration Token (PIT).
What You Can Build
- Embed AI agents inside mobile apps, SaaS products, voice assistants, or internal tools.
- Trigger agent workflows from Zapier, Make, Airflow, or any external automation.
- Centralize security with OAuth 2.0 scoped tokens.
- Use PIT integrations for server-to-server calls inside your own environment.
- Parse rich JSON output without extra NLP work.
Endpoints
List Agents
GET /agent-studio/public-api/agents
- Required:
locationId - Optional:
limit,offset - Returns every active agent for the location — useful for populating a dropdown.
Get Agent
GET /agent-studio/public-api/agents/{agentId}
- Required:
locationId - Returns name, status, tool nodes, variables, and lifecycle stage.
Execute Agent
POST /agent-studio/public-api/agents/{agentId}/execute
- Body:
{ locationId, input, executionId? } - First call omits
executionId. The response returns one so subsequent calls continue the same conversation.
Authentication
OAuth 2.0 bearer tokens or PIT values both ride in the Authorization header:
Authorization: Bearer {access_token}Generate a Private Integration under Settings > Developer, scope it to a sub-account, and you can skip the full OAuth flow for internal apps.
Setup Steps
- Enable AI Agents > Agent Studio in your sub-account and confirm at least one agent is in Production.
- Open Settings > Developer and create a Private Integration or OAuth App.
- Copy the Client ID + Client Secret (OAuth) or PIT value.
- For OAuth, exchange the code at
POST /oauth/tokenwithgrant_type=authorization_code. Store the access token and refresh as needed. - Test with the List Agents endpoint:
curl -H "Authorization: Bearer {token}" \
"https://services.sparkforgehq.com/agent-studio/public-api/agents?locationId={locationId}"- Save the
agentIdvalues you want to run. - Execute an agent:
curl -X POST \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{ "locationId":"abc123", "input":{ "prompt":"Write a Facebook ad for plumbers"} }' \
https://services.sparkforgehq.com/agent-studio/public-api/agents/{agentId}/executeStore the returned executionId if you need multi-turn conversations.
Frequently Asked Questions
Is there a rate limit?
Can I stream partial responses?
Do agents need to be in Production?
Can I call the API from client-side JavaScript?
How long is an executionId valid?
Are PIT tokens limited to a single location?
Was this article helpful?
Thanks for the feedback.