# Raskr Intake API Use these steps to turn a client brief into a conversational preview. The calling agent writes the interview. Send requests to the same origin that served this file. Use Content-Type: application/json and Accept: application/json. 1. Register a workspace POST /api/workspaces {"name":"Example agency","defaultLocale":"en"} The 201 JSON response contains id, name, defaultLocale and apiKey. Store apiKey privately. Use one workspace per client and reuse its key. Each registration creates a new workspace. 2. Write the interview POST /api/interviews Authorization: Bearer Example request body: { "title": {"en": "Your bathroom project"}, "defaultLocale": "en", "items": [ {"key":"scope","type":"single","required":true,"label":{"en":"What are you planning?"},"options":[ {"key":"full","label":{"en":"A full renovation"}}, {"key":"refresh","label":{"en":"A small refresh"}} ]}, {"key":"floor_area","type":"text","label":{"en":"Roughly how large is the bathroom?"},"help":{"en":"Dimensions or a floor area are both helpful."},"when":{"question":"scope","equals":"full"}}, {"key":"materials","type":"multi","label":{"en":"Which wall finishes can you see today?"},"options":[ {"key":"tile","label":{"en":"Tile"}}, {"key":"paint","label":{"en":"Paint"}}, {"key":"unknown","label":{"en":"Unsure"}} ]}, {"key":"priorities","type":"longtext","label":{"en":"What else should the firm know before preparing a quote?"}} ] } The 201 response contains id, title, defaultLocale, locales, purpose, items and previewUrl. Return previewUrl to the person trying the interview. Anyone with this link can try the current draft. By default a live AI interviewer reads the list, asks clarifying questions in the interview language, and picks up facts volunteered in earlier replies. Visitors can type a reply on its own or add details alongside a choice. The interviewer can ask about a new detail even after the underlying item has an answer. Respondents can skip these follow-ups. They can view the live project summary, correct a detail or change its status between confirmed, assumption and still open. Before finishing, the interviewer checks which missing details would change the team's decision. In a quote interview it asks about details the customer can supply, such as measurements or the extent of the work. Customers can finish with what they have shared. The browser sends the conversation to Cloudflare Workers AI on each AI turn. Raskr keeps practice answers out of survey results. On completion, the downloadable interview brief brings together reported details, assumptions, numbered supporting replies, and outstanding questions or site checks. Written-questions mode runs entirely in the tab. Reload to start over. 3. Read or revise GET /api/interviews/ reads the current draft. PUT /api/interviews/ replaces it. Send the same body shape as for creation. Keep the original defaultLocale on edits. Both operations require the workspace bearer key. Edits appear when the preview reloads. Authoring rules - Set purpose to say what the interview is for. It steers what the interviewer follows up on, what it notes, and which gaps it raises before finishing: quote (default): enough to price work; probes quantities, specifications, site checks. discovery: a client's goals, reasons, audiences, constraints and priorities. requirements: who needs what and why, what counts as done, essential or nice to have. feedback: an honest account of finished work; neutral, concrete moments, suggestions. - Give each item a stable, unique key. Use a lowercase letter first, then lowercase letters, digits or underscores. Limit keys to 64 characters. - Supported types are text, longtext, single, multi and scale. Single and multi need at least two options with unique keys and translated labels. Scale needs integer min and max, with max greater than min. Optional minLabel and maxLabel are localized. - Items are optional unless required is true. Optional help text is localized. - Supply an optional localized assumption on an item when the client has an explicit working default. For a ceiling height item this might be {"en":"2.5 m","sv":"2,5 m"}. It appears as an assumption while the answer is outstanding. Respondents can edit the value and explicitly mark it confirmed. - To ask a follow-up only for one choice, use when with the key of an earlier single item and one of its option keys. A skipped or hidden parent skips its follow-ups. - To offer translations, add locales (for example ["en","sv"]). Supply all wording in every enabled language. To try a specific language, append ?lang=sv to previewUrl. - An interview accepts 1–100 items. The maximum JSON request size is 128 KiB. Limits - A workspace holds at most 50 interviews. Revise an existing one with PUT. - A workspace gets 300 AI interviewer turns per UTC day, shared by all its previews. The whole service has a daily cap too. Written-questions mode is never limited. - Registration and AI turns are also limited per minute per client address. HTTP errors: 400 malformed JSON, 401 missing or invalid workspace key, 404 unknown interview, 413 request too large, 415 wrong media type, 422 invalid interview, 429 a limit is reached (Retry-After gives the seconds to wait; a daily cap resets at midnight UTC).