The create endpoint (required)
Gravity calls:credentials is a flat object of env-var-style keys: whatever a coding agent
should write into a project’s environment (DATABASE_URL, an API key, a PAT).
Gravity delivers them to the agent exactly once, then holds them only
encrypted at rest.
Send your own welcome email to the user at creation time. The account is
theirs, on your platform, from the moment it’s created.
Optional endpoints
Account lookup (recommended)
Account lookup (recommended)
POST {base}/accounts/lookup with { "email": "..." }, returning
{ "exists": true }. When you expose this, Gravity checks it before
creating anything and the agent tells the user “you already have an
account” instead of creating a duplicate. Lookup failures never block
provisioning.Cleanup
Cleanup
DELETE {base}/accounts/{account_ref}. Called best-effort if Gravity
fails to persist a provision after you created the resource, so nothing
is stranded.Ownership handoff (only if you need it)
Ownership handoff (only if you need it)
Only relevant if your platform creates the resource somewhere the user
can’t immediately log into (e.g. a partner org) and needs the user to
click a link to move it into their own account. In that case also return
If you create the account directly under the user’s email (most
platforms), skip all of this.
ownership_url (an https URL on your site) and optionally expires_at
from the create call; Gravity passes it through to the agent verbatim.
When the user completes the handoff, you can notify Gravity with a signed
webhook:Request signing
Every request Gravity sends you is signed with the shared secret you minted in the dashboard. Verify it before creating anything:METHOD: uppercase HTTP methodpath: request path only, no host/queryraw_body: exact request body bytes (empty string for bodyless requests)- Reject timestamp skew over 300 seconds (replay protection)
- Compare with a constant-time comparison
What the agent receives
Gravity turns your create response into a single response to the requesting agent; you never talk to the agent directly:Attribution & billing
Every provision mints agrclid and emits a conversion event at provision
time, the moment the account is created and credentials are delivered.
Same ledger and CPA billing as click-through conversions.
Checklist
1
Implement POST {base}/accounts
Verify the signature, create the account under the email, return
credentials.
2
Configure the dashboard
Turn on API provisioning for your service, save the base URL, mint the signing
secret.
3
Send your own welcome email on creation
Recommended. Your brand, your inbox placement.

