This page covers the admin view: what keys are, how to create one, and how to revoke it. For request and response detail — endpoints, headers, payloads, and error codes — see the Developer API.
What an API key is for
A key is a credential an external system sends with each request so Erstan knows who is calling and what they may do. Keys are useful when you want to:- Trigger an agent from another system (for example, run an invoice-triage agent when a record is created in NetSuite).
- Let a scheduled job or webhook start runs without a person signing in.
- Poll a run you started programmatically to read its result.
- Let an external MCP client create, inspect, update, validate, test, and publish Agent Builder drafts through guarded tools.
run_agent runs only an agent’s retained published version. The separately gated test_agent tool can run the current manageable draft in Builder Preview when the key also has both authoring scopes and agents:run. It uses real tools and normal approval policies. Archived agents cannot run; disabled agents cannot run through the published-agent path. See Preview, publish & versions.Create a key
Creating and managing keys is an admin task. Open the workspace whose agents you want to expose, then create the key from Settings.1
Open Settings → API Keys
In the target workspace, go to Settings → API Keys. Make sure you are in the right workspace — keys only ever work against the workspace they were created in.
2
Create a key and name it
Click Create Key and enter a descriptive name (for example,
NetSuite invoice intake). The name is how you will recognize the key later when you need to revoke it.3
Choose scopes
Select what the key is allowed to do. Scopes are additive — grant only what the caller needs. Agent scopes use your current access automatically; task, document, and file scopes also ask you to choose their project or team restrictions.
4
Set an optional expiry
Optionally set an expiry date so the key stops working automatically after a chosen time.
5
Copy the secret
The secret is shown once, at creation. Copy it and store it in your system’s secret manager before you close the dialog.
Scopes
Scopes control what a key can do. Grant the narrowest set that covers your use case.
A typical “run an agent and read its result” integration uses
agents:run and runs:read together. A practical Agent Builder integration uses both agents:read and agents:write, because updates, validation, and publishing require both exact scopes; agents:write alone can only create drafts. Add agents:run to test drafts and runs:read to poll those tests. Task, document, and file scopes require project or team allowlists on the key; agent scopes use the creator’s live Erstan permissions instead.
Agent access
Agent access does not use a separate per-key allowlist. It follows the key creator’s current workspace membership, team access, and agent permissions. Changing the creator’s access immediately changes what the key can read, edit, or run without recreating the key.What happens if an agent or the creator's access changes
What happens if an agent or the creator's access changes
If an agent has no published version, is disabled, archived, or removed from the workspace, the key can no longer run it. A disabled agent can still be authored by a creator with normal permission; an archived agent cannot. The same access checks apply when the creator loses access to that agent or team. Publishing restores run availability only when the creator can still access the enabled agent.
Do keys bypass NetSuite write approvals?
Do keys bypass NetSuite write approvals?
No. A key starts an agent run; it does not change how that agent’s write actions are governed. NetSuite still uses per-user authorization and the connector’s write policy (Allow / Require approval / Deny). Actions that require approval still pause for a person to review.
Expiry and revocation
Keys can have an optional expiry date, after which they stop working. You can also revoke a key at any time.1
Revoke from Settings → API Keys
Open Settings → API Keys, find the key by its name, and revoke it.
2
Rotate when needed
To rotate, create a new key, update your integration to use it, then revoke the old one.
Next steps
Developer API: API keys
Full request and response detail for using keys programmatically.
Run agents via the API
Start runs and poll results from your own systems.
Build agents over MCP
Create, validate, test, and revision-safely publish drafts.
Preview, publish & versions
Publish an agent so a key can run it.
Security & write safety
How approvals and per-user authorization keep writes in your control.