Importing products
The /now flow uses public JSON import endpoints. Use these endpoints to preview a product architecture from a hosted JSON file or pasted JSON. Create the product after you accept the preview.
A raw Full Product Object (FPO) supports version values 1.0, 1.1, and 2.0. Runtype uses 2.0 by default. An FPO template supports top-level version values 1.0 and 1.1. Its nested productObject.version supports 1.0, 1.1, and 2.0.
At 2.0, an inline agent stores runtime fields under agent.config. At 1.0 and 1.1, it stores those fields on the agent object.
Supported sources
The import APIs accept these explicit JSON sources:
- Agent-to-Agent (A2A) agent cards.
- Raw FPO JSON.
- FPO template JSON.
The import APIs reject these sources:
- GitHub repository homepages.
READMEand Markdown URLs.- Raw JSON passed through query parameters.
- Generic website or repository crawling.
Use GitHub URLs only for specific JSON files. The import service normalizes GitHub blob URLs to raw file URLs before fetching them. It accepts raw GitHub file URLs without conversion. For a gist, use a raw gist file URL that points to one JSON file.
Import flow
To import a product, follow these steps:
- Preview the source with
POST /v1/quick-start/imports/preview. - Reload the preview with
GET /v1/quick-start/imports/:token. - Create the product with
POST /v1/quick-start/create.
The preview endpoints do not require authentication. Product creation requires authentication.
Step 1: Preview an import source
Choose a hosted URL or paste the JSON document into the request body.
Preview a hosted JSON document
To preview a public JSON file, send a URL source. The following TypeScript example sends the request:
The following cURL command sends the same request:
Preview pasted JSON
To preview a document that you already have in memory, send a JSON source with its contents in content. The following TypeScript example reads a template file from your app and submits it:
Replace YOUR_TEMPLATE_FILENAME with the filename that your app serves.
The following cURL command sends the template as a JSON string in content:
The content string contains the productName and companyName template variables.
Step 2: Reload a preview session
The preview response includes an importToken. Use this token to restore the preview after an authentication redirect or page refresh.
The following TypeScript example restores the preview session:
Replace qsi_YOUR_IMPORT_TOKEN with the token returned by the preview request.
The following cURL command restores the same preview session:
Preview sessions expire after 30 minutes. When the token does not identify a stored session, the API returns SESSION_NOT_FOUND.
Step 3: Create the product
Use the import token to create the product after you accept the preview.
Create a product from a raw FPO
To create a raw FPO import, send the importToken in a request that includes your API key. The following TypeScript example creates the product:
Replace YOUR_API_KEY with your Runtype API key and qsi_YOUR_IMPORT_TOKEN with the preview token.
The following cURL command creates the same raw FPO import:
Create a product from an FPO template
To create an FPO template import, send values for template variables that do not have defaults. The following TypeScript example sends the required values:
Replace YOUR_API_KEY with your Runtype API key, qsi_YOUR_TEMPLATE_IMPORT_TOKEN with the preview token, and YOUR_SEARCH_API_KEY with the secret for searchApiKey. Set FIRECRAWL_API_KEY to the same secret when you use the TypeScript example.
The following cURL command creates the same FPO template import:
The importer uses secret template values to resolve the final product object. It omits those values from preview payloads, quick-start provenance metadata, and the create response.
Create a repository button
To add a repository button labeled Deploy to Runtype, link directly to a hosted JSON document. The following Markdown snippet creates the button:
The example files in this guide are:
docs/templates/quick-start/customer-support-fpo.json.docs/templates/quick-start/customer-support-fpo-template.json.docs/templates/quick-start/deploy-to-runtype.md.
Next steps
- FPO templates: define reusable product templates with user-provided values.
- Quickstart: make your first Runtype API call.