Skip to main content
A credential request asks someone to fill in a vault item. The platform can send the request as a link to a hosted page. You can also render the same request on your own page, with your own components. This page covers the second option. Your backend creates the request with your API key. Your page reads the form shape and submits the values to Asteroid. The values never pass through your servers.
Start from the example app. It is a small Next.js app that implements every step on this page. Copy it into your own codebase.

The contract

The public_v2 calls accept requests from any origin. They carry no session and send no cookies. The share token is the only credential.
Never send your API key to the browser. Only your backend calls the v2 endpoints.

1. Create the request

Design the form as a vault template on Vault in the platform. Copy its ID. Then create one request for each person you collect from:
Get the organization ID from GET /context. The response holds the request and a token:
The API returns the token once. Asteroid stores only its hash. Store the token server-side, next to your user, until the request completes. Hand it to your page when that user opens the form. name becomes the vault item’s name. The item key is derived from it, and it must be unique in your organization. A pending request reserves the key. Put your own user ID in the name, so two requests never clash. A clash returns 409. To skip the template, send kind, fields and optional steps inline instead of templateId.

2. Read the form

Render fields in array order. When steps is not empty, show one step per page. Each step lists its fields by key. instructions is Markdown. A step can have instructions and no fields. Map each field type to an input: Write-only values never come back out of the API. Asteroid decrypts them only when a workflow uses them.

3. Submit the values

Send one entry per filled field. Leave out empty optional fields. An unknown key or a missing required value returns 400. Clean the values first, the way the hosted page does:
  • TOTP seed: accept a Base32 key or an otpauth://totp/ link. Send the Base32 secret only, uppercase, with spaces, dashes and = padding removed.
  • Card number and CVV: remove spaces and dashes.
  • URL: add https:// when the scheme is missing.
  • Readable fields: trim whitespace. Send secrets exactly as typed.
A 200 with "status": "completed" means the vault item exists. Attach it to an agent profile to use it in workflows.

Responses

Limits

Create a request when a user needs one, not on every page load. Reuse the stored token until the request completes or returns 410. Revoke unused requests with POST /vault/share-links/{linkId}/revoke. The Vault page in the platform creates the same request and gives you a link to vault.asteroid.ai. Send that link when you do not need the form inside your own app.