SignalArc REST API
Live production API base URL:http://localhost:4000. Local-only references such as ngrok tunnels are development conveniences, not production endpoints.
The production API is live on GCP Cloud Run service signalarc-backend-api behind the custom domain api.signalarc.fun. Agent execution is backend-managed; the current production direction is Circle Developer-Controlled Wallet API or direct Circle API integration, not a production dependency on Circle CLI. Phase 6 deployment requires the production database to be migrated through schema version 20 before the Agent API durable intent, execution, portfolio, and activity surfaces are considered current.
API Status
| Item | Status |
|---|---|
| Production API | Live at https://api.signalarc.fun. |
| Local API | Implemented by the Go backend on http://localhost:4000. |
| Authentication | Not enforced. |
| API keys | Schema exists, but request enforcement is not implemented. |
| Content type | application/json. |
| Request ID | X-Request-ID is echoed when supplied or generated by middleware. |
| CORS | Production frontend https://signalarc.fun is allowed. Local frontend origins are also allowed in development. |
Agent API
SignalArc exposes a framework-neutral Agent API for external agents and custom HTTP clients. Keep this page as the general REST API reference; use Agent API for the full agent integration guide, required fields, lifecycle examples, error catalog, and local smoke-test evidence. Agent execution status:- Agent execution is backend-managed.
- Current target execution path is Circle Developer-Controlled Wallet API or direct Circle API integration.
- Local Docker smoke testing validated
circle_developer_wallet_apimode for the documented ARC-TESTNET lifecycle actions. - Agent execution is currently scoped to
ARC-TESTNET. - Backend wallet provider configuration is required before execution endpoints can broadcast.
- API responses do not return Circle API keys, entity secrets,
entitySecretCiphertext, database URLs, deploy tokens, credential paths, or other backend secrets.
Error Format
Errors use a consistent JSON envelope:Endpoint Table
Core REST endpoints:| Method | Path | Purpose |
|---|---|---|
| GET | /health | Process health check. |
| GET | /readyz | Database readiness check. |
| GET | /schema/validate | Validate expected schema and migration state. |
| GET | /markets | List markets. |
| GET | /markets/{id} | Get one market. |
| POST | /markets | Create a market record. |
| POST | /trade-intents | Create a backend trade intent record; does not execute onchain. |
| GET | /agent/markets | Agent-readable market list. |
| GET | /users/{user_id}/positions | List positions for a user. |
| GET | /markets/{market_id}/positions | List positions for a market. |
| GET | /markets/{market_id}/resolution | Get one market resolution. |
| GET | /users/{user_id}/settlements | List settlements for a user. |
| GET | /markets/{market_id}/settlements | List settlements for a market. |
| GET | /arc/contract | Return Arc Testnet contract metadata. |
| Method | Path | Purpose |
|---|---|---|
| POST | /agent/onboarding/start | Start agent onboarding and dispatch OTP email. |
| POST | /agent/onboarding/verify | Verify OTP, register agent wallet, and activate session. |
| GET | /agent/onboarding/{onboarding_id} | Get onboarding status. |
| GET | /agent/sessions/{agent_id} | Get active agent session. |
| POST | /agent/wallets | Register or upsert an agent wallet record. |
| GET | /agent/wallets/{agent_id} | Get registered agent wallet. |
| GET | /agent/wallets/{agent_id}/balance | Read-only Circle Agent Wallet balance. |
| POST | /agent/wallets/{agent_id}/faucet | Request ARC-TESTNET faucet funding for the registered agent wallet. |
| POST | /agent/wallets/{agent_id}/disable | Disable a registered agent wallet. |
| POST | /agent/intents | Create an agent intent preview. |
| GET | /agent/intents/{intent_id} | Get the current durable intent state. |
| POST | /agent/intents/{intent_id}/confirm | Confirm an agent intent. |
| POST | /agent/intents/{intent_id}/execute | Execute a confirmed agent intent. |
| GET | /agent/intents/{intent_id}/executions | List durable execution attempts for an intent. |
| GET | /agent/portfolio/{agent_id} | Read agent portfolio summary derived from durable agent records. |
| GET | /agent/activity/{agent_id} | Read agent activity/history derived from durable agent records. |
Common Response Shapes
Market
Trade
Endpoints
GET /health
Returns process health.200 OK
Response:
GET /readyz
Checks database reachability.200 OK
Response:
| Status | Code | Meaning |
|---|---|---|
| 503 | database_unavailable | Database ping failed. |
GET /schema/validate
Validates expected database tables and migration state.200 OK when schema status is ok.
Response:
| Status | Code | Meaning |
|---|---|---|
| 500 | schema_validation_failed | Schema validation query failed. |
| 503 | n/a | Returned when validation result status is not ok. |
GET /markets
Lists up to 50 markets ordered by creation time descending.200 OK
Response:
| Status | Code | Meaning |
|---|---|---|
| 500 | markets_list_failed | Market list query failed. |
GET /markets/
Returns one market by UUID.200 OK
Response:
| Status | Code | Meaning |
|---|---|---|
| 404 | market_not_found | No market exists for the supplied id. |
| 500 | market_get_failed | Market query failed. |
POST /markets
Creates a market record. Server-owned lifecycle fields are rejected.| Field | Required | Notes |
|---|---|---|
creator_user_id | Yes | UUID-shaped string. Must reference an existing user. |
title | Yes | Non-empty string. |
description | No | Optional string. Empty string becomes null. |
category | No | Optional string. Empty string becomes null. |
cover_image_url | No | Public HTTPS URL, maximum 2048 characters. Empty string becomes null. |
outcome_yes_label | No | Defaults to YES. |
outcome_no_label | No | Defaults to NO. |
collateral_asset | No | Defaults to USDC. |
chain | Yes | Non-empty string. |
resolution_source | No | Optional string. Empty string becomes null. |
opens_at | No | RFC3339 timestamp. Must be before closes_at. Future opens_at creates DRAFT; otherwise status is OPEN. |
closes_at | Yes | RFC3339 timestamp in the future. |
status, winning_outcome, resolved_at, settled_at.
Market images are URL metadata only in v1. SignalArc does not accept base64 image data or store uploaded images on the Cloud Run filesystem. A later upload flow can use signed upload URLs backed by GCS or Cloudinary.
Success status: 201 Created
Response:
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | Request body is not valid JSON. |
| 400 | invalid_market_request | Validation failed or server-owned lifecycle fields were included. |
| 400 | invalid_creator_user | Creator user foreign key is invalid. |
| 500 | market_create_failed | Insert failed. |
POST /trade-intents
Creates a backend trade-intent record. This endpoint is not the primary onchain execution path. The frontend trade panel uses the browser wallet to send Arc Testnetapprove and openPosition transactions directly. The backend response explicitly marks execution as not_executed.
| Field | Required | Notes |
|---|---|---|
user_id | Yes | UUID-shaped string. |
market_id | Yes | UUID-shaped string. |
outcome | Yes | YES or NO. |
side | Yes | BUY or SELL. |
quantity | Yes | Positive decimal with at most 18 fractional digits and at most 18 significant integer digits. |
price | Yes | Decimal between 0 and 1, with the same decimal bounds. |
201 Created
Response:
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | Request body is not valid JSON. |
| 400 | invalid_trade_intent | Request validation failed. |
| 400 | market_not_open | Market exists but status is not OPEN. |
| 404 | market_not_found | Market does not exist. |
| 500 | trade_intent_create_failed | Lookup or insert failed. |
GET /agent/markets
Returns a compact market list for agent-readable discovery and dashboards.200 OK
Response:
| Status | Code | Meaning |
|---|---|---|
| 500 | markets_list_failed | Market list query failed. |
GET /users//positions
Lists up to 50 positions for a user.200 OK
Response:
500 positions_list_failed.
GET /markets//positions
Lists up to 50 positions for a market.200 OK
Known errors: 500 positions_list_failed.
GET /markets//resolution
Returns a market resolution record.200 OK
Response:
| Status | Code | Meaning |
|---|---|---|
| 404 | resolution_not_found | No resolution exists for this market. |
| 500 | resolution_get_failed | Resolution query failed. |
GET /users//settlements
Lists up to 50 settlements for a user.200 OK
Known errors: 500 settlements_list_failed.
GET /markets//settlements
Lists up to 50 settlements for a market.200 OK
Response shape:
500 settlements_list_failed.
GET /arc/contract
Returns the Arc Testnet prototype contract metadata used by the current MVP.200 OK
Response:
Agent Endpoints
The Agent API surface is documented in detail in Agent API, which is the canonical framework-neutral reference and can be shared with external agents, agent frameworks, and custom HTTP clients. It covers onboarding, OTP verify, sessions, wallets, balance, ARC-TESTNET faucet, market discovery, durable intent preview/confirm/execute, durable execution records, intent execution history, portfolio, activity, idempotency throughagent_id + source_client + client_request_id, and Phase 6 safety/policy checks such as agent_id validation, allowed_actions, explicit confirmation, and optional policy_metadata.max_trade_amount.
The Custom GPT shipped with SignalArc is preconfigured against https://api.signalarc.fun, but the Agent API contract is not Custom GPT-specific.