Skip to content

Quickstart

You'll build a prism that routes support tickets, then send it a ticket from code. You need a Prismlet account and one of curl, Node 22 or later, or Python with requests installed.

Prismlet accounts are invite-only for now. Ask your Prismlet contact for an invite.

  1. In the app, open Prisms, choose Blank prism, name it Support routing and choose Create. That opens a draft. The prism is saved the first time you choose Create prism or import. Its slug becomes support-routing, and that is the name you put in the URL. Renaming the prism later does not change the slug.

  2. On the Questions tab, choose Import questions, paste this JSON and choose Import and save. Import replaces the fields, context and questions and saves the prism.

    {
    "fields": [
    { "key": "subject", "label": "Subject" },
    { "key": "text", "label": "Text" }
    ],
    "context": "We sell scheduling software to clinics.",
    "questions": [
    {
    "key": "team",
    "type": "choice",
    "text": "Which team should handle it?",
    "instructions": "Decide which team should handle the latest customer message. Use the subject only as supporting context.",
    "options": [
    {
    "key": "billing",
    "label": "Billing",
    "description": "Invoices, payments, refunds, plan changes."
    },
    { "key": "technical", "label": "Technical support" }
    ]
    },
    {
    "key": "urgent",
    "type": "yes_no",
    "text": "Does the customer explicitly describe immediate time pressure?"
    },
    {
    "key": "tone",
    "type": "scale",
    "text": "How does the customer sound?",
    "options": [
    { "key": "calm", "label": "Calm" },
    { "key": "annoyed", "label": "Annoyed" },
    { "key": "angry", "label": "Angry" }
    ]
    }
    ]
    }

    The prism reads two fields, subject and text, and asks three questions: a Choice, a Yes / No and a Scale. Prisms, fields and questions explains each part.

  3. Use Try in the app to test a prism before you write code. Paste a real ticket into the fields, add a reference if you have one to match against your own records, and run it. Every try is saved as a result, so you can come back to one that looked wrong.

  4. Optional: on the Lens tab, add a column for the probability of team and one for the average of tone. The app names them team_probability and tone_average and adds them at the end, so move each up under its question's column to match the examples here. On urgent, tick Unsure in between, then set No below to 40% and Yes from to 60%. Choose Save Lens. The Lens covers every output.

Open API keys and create a key. Give it a label that names the system that will use it. The app shows the full key once, so copy it now. If you lose it, create another and revoke the old one.

Put the key in an environment variable in the shell you'll run the examples from:

export PRISMLET_API_KEY="pl_..."

A key works for every prism in your account. Keep it on your server. Authentication explains why browser calls fail.

curl https://api.prismlet.com/v1/prisms/support-routing/results \
-H "Authorization: Bearer $PRISMLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ref": "TCK-8812",
"fields": {
"subject": "Charged twice this month",
"text": "Hi, I was billed twice for September. Please refund the second charge before Friday."
}
}'

The prism's Integrate tab shows the curl version with your prism's slug and field keys filled in, and the response its Lens gives.

A 200 means the text was answered and saved:

200 OK
{
"id": "0192f5c1-7c1a-7b3e-9f55-3c1d2e4a5b6c",
"ref": "TCK-8812",
"prism": "support-routing",
"version": 3,
"status": "ok",
"error": null,
"took_ms": 640,
"created_at": "2026-09-23T09:14:02.187Z",
"answers": {
"team": "billing",
"team_probability": 0.91,
"urgent": "yes",
"tone": "annoyed",
"tone_average": 2.05
}
}

This response uses the Lens from step 4. With the automatic Lens, answers holds team, urgent and tone.

Key What it holds
id The result id. Read the result again with GET /v1/results/{id}.
ref The reference (ref) you sent, or null.
prism The prism's slug.
version The prism version that answered. Saving the prism creates version 1 and each save adds one, so after the import yours is 1. The example shows 3.
status ok, or failed when the model gave no usable answer.
error Why the result failed, or null.
took_ms How long the model took, in milliseconds.
created_at When the result was saved, ISO 8601 in UTC.
answers One entry per Lens column, in Lens order. null when the result failed.

Answers use keys, not labels: billing rather than Billing, yes rather than Yes. Your code can compare them without worrying that someone fixed a typo in a label. Formats shows where labels appear instead.

A call can also come back as 502 with status: "failed". The failed result is saved and has the same shape, with answers: null and an error. Errors and retries shows how to handle it.