Skip to main content

For developers

This page is for people building their own scripts or services on Syft. To use Syft from an AI agent, start with Connect your agent instead. An agent can also write these scripts for you: ask it to load the syft-api skill.

Agent keys​

A script or service uses an agent key instead of your login. Create one for each script in Settings > CLI & API Keys, so you can see what each one does and turn one off on its own.

  • Read can read your data.
  • Write can also call the Syft tools that make changes, such as adding contacts to a motion. A write key needs a workspace admin to create it.

The key is shown once. Keep it on your servers, never in a website or a public repository. You can see and revoke keys in Settings > CLI & API Keys.

Read with Syft SQL​

curl https://app.syftdata.com/api/v1/query \
-H "Authorization: Bearer sk_agent_..." \
-H "Content-Type: application/json" \
-d '{ "sql": "select contact.email, company.name from signals where signal = '\''Self-identified visitor'\'' limit 10" }'

The response has columns, rows and hasMore. GET /api/v1/schema lists every table and column. A few rules:

  • Results are 100 rows by default and 10,000 at most.
  • To read only what's new since last time, pass the nextCursor from the last response as cursor.
  • Queries time out after 10 seconds. Add a time range or a filter to make them faster.

Call Syft tools​

The same tools your agent uses, such as reading motion runs or approving drafts, are on the Syft MCP server at https://app.syftdata.com/api/mcp. Each call is one JSON-RPC request, with no session to open first:

curl -s -X POST https://app.syftdata.com/api/mcp \
-H "Authorization: Bearer sk_agent_..." \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_motion_runs","arguments":{"status":"waiting_for_approval"}}}'

"method":"tools/list" lists the tools your key can call. A read key lists only the tools that read.

The Syfty CLI​

If you work in a terminal, the Syfty CLI wraps the same calls. It is in beta. You don't need it to use Syft from an agent.

npm install -g @syftdata/syfty@beta
syfty login
syfty tools call get_motion_runs '{"status":"waiting_for_approval"}'

syfty keys create --name "weekly-report" --access read makes an agent key from the terminal.