Skip to content
OpenSmartRoute
Skillv1.0.0

persona-hello-world

Create your first Persona identity verification inquiry and check its status. Use when learning Persona API basics, testing inquiry creation, or building a simple verification flow. Trigger with phras

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/persona-hello-world/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill persona-hello-world. Copyright stays with the author (MIT).

Persona Hello World

Overview

Create a Persona inquiry, generate an embed URL for the verification flow, and poll for the inquiry status. Uses the real Persona REST API with sandbox credentials.

Prerequisites

  • Completed persona-install-auth setup
  • An Inquiry Template ID from the Persona Dashboard (format: itmpl_*)

Instructions

Step 1: Create an Inquiry

import os, requests

API_KEY = os.environ["PERSONA_API_KEY"]
BASE = "https://withpersona.com/api/v1"
HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Persona-Version": "2023-01-05",
    "Content-Type": "application/json",
}

# Create a new inquiry from a template
resp = requests.post(f"{BASE}/inquiries", headers=HEADERS, json={
    "data": {
        "attributes": {
            "inquiry-template-id": "itmpl_YOUR_TEMPLATE_ID",
            "reference-id": "user-12345",  # Your internal user ID
        }
    }
})
resp.raise_for_status()
inquiry = resp.json()["data"]
inquiry_id = inquiry["id"]
status = inquiry["attributes"]["status"]
print(f"Inquiry created: {inquiry_id} (status: {status})")

Step 2: Get the Verification URL

# The inquiry includes a session token for the embedded flow
session_token = inquiry["attributes"].get("session-token")
if session_token:
    # Option A: Hosted flow (redirect user to Persona)
    hosted_url = f"https://withpersona.com/verify?inquiry-id={inquiry_id}&session-token={session_token}"
    print(f"Send user to: {hosted_url}")

    # Option B: Embedded flow (JavaScript SDK in your page)
    print(f"Embed with: Persona.Client({{ templateId: 'itmpl_...', inquiryId: '{inquiry_id}' }})")

Step 3: Poll for Completion

import time

for _ in range(30):  # Poll for up to 5 minutes
    resp = requests.get(f"{BASE}/inquiries/{inquiry_id}", headers=HEADERS)
    resp.raise_for_status()
    status = resp.json()["data"]["attributes"]["status"]
    print(f"  Status: {status}")

    if status in ("completed", "approved", "declined"):
        break
    time.sleep(10)

# Get verification details
if status == "completed":
    verifications = resp.json()["data"]["relationships"]["verifications"]["data"]
    for v in verifications:
        print(f"  Verification: {v['type']}{v['id']}")

Step 4: Retrieve Verification Results

# Get detailed verification result
verification_id = verifications[0]["id"]
v_resp = requests.get(f"{BASE}/verifications/{verification_id}", headers=HEADERS)
v_resp.raise_for_status()
v_data = v_resp.json()["data"]["attributes"]
print(f"  Check: {v_data['status']}")
print(f"  Name: {v_data.get('name-first', 'N/A')} {v_data.get('name-last', 'N/A')}")

Output

  • Inquiry created with unique ID
  • Hosted or embedded verification URL generated
  • Inquiry status polled until completion
  • Verification results retrieved

Error Handling

Error Cause Solution
422 Unprocessable Invalid template ID Verify template ID in Dashboard
Inquiry stays created User hasn't started flow Share the hosted URL with user
Empty verifications Inquiry not completed Wait for user to complete verification
404 Not Found Wrong inquiry ID Check ID format: inq_*

Resources

Next Steps

  • Build full KYC flow: persona-core-workflow-a
  • Handle webhook events: persona-webhooks-events

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-persona-hello-world/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-persona-hello-world.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-persona-hello-world",
  "kind": "skill",
  "name": "persona-hello-world",
  "description": "Create your first Persona identity verification inquiry and check its status. Use when learning Persona API basics, testing inquiry creation, or building a simple verification flow. Trigger with phrases like \"persona hello world\", \"first persona inquiry\", \"persona quick start\", \"test identity verification\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general_chat",
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "persona",
      "identity",
      "kyc",
      "getting-started",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Create your first Persona identity verification inquiry and check its status. Use when learning Persona API basics, testing inquiry creation, or building a simple verification flow. Trigger with phrases like \"persona hello world\", \"first persona inquiry\", \"persona quick start\", \"test identity verification\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/persona-hello-world/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/persona-hello-world/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/persona-hello-world/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(curl:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Persona Hello World\n\n## Overview\n\nCreate a Persona inquiry, generate an embed URL for the verification flow, and poll for the inquiry status. Uses the real Persona REST API with sandbox credentials.\n\n## Prerequisites\n\n- Completed `persona-install-auth` setup\n- An Inquiry Template ID from the Persona Dashboard (format: `itmpl_*`)\n\n## Instructions\n\n### Step 1: Create an Inquiry\n\n```python\nimport os, requests\n\nAPI_KEY = os.environ[\"PERSONA_API_KEY\"]\nBASE = \"https://withpersona.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {API_KEY}\",\n    \"Persona-Version\": \"2023-01-05\",\n    \"Content-Typ",
  "cost": {
    "context_tokens": 901
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-persona-hello-world/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.