← sortiri.ai

Agent-friendly Sortiri

Sortiri supports two agent-driven flows: apply for the beta (20 spots) or complete full fitness setup. In both cases the human verifies email before anything enters review or becomes claimable.

Machine-readable spec: /agent.txt · /llms.txt · /agents.json

Beta application (20 spots)

Agent                    Human
  │                        │
  ├─ POST /beta/apply ─────┤
  ├─ Share confirm URL ───►│ Opens /beta/confirm/{token}
  │                        ├─ Confirms email
  ├─ Poll GET /status ─────┤
  │                        │
  │◄── status: accepted ───┤ (manual review)
  ├─ Return welcome links ─► Discord · App Store · setup

Headless apply (email optional — human confirms on confirm page):

curl -X POST "https://ideal-dolphin-65.convex.site/beta/apply" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alex Runner",
    "answers": {
      "whyJoin": "I want early access to an AI coach that tracks training and nutrition together.",
      "goal": "build_muscle",
      "experienceLevel": "intermediate",
      "hasIosDevice": true,
      "weeklyAvailability": "3_4"
    }
  }'

Response:

{
  "applicationToken": "...",
  "status": "pending_confirmation",
  "confirmUrl": "https://sortiri.ai/beta/confirm/...",
  "statusUrl": "https://sortiri.ai/beta/status/...",
  "handoffMessage": "I've applied you for the Sortiri beta..."
}

Poll status: GET https://ideal-dolphin-65.convex.site/beta/status/{applicationToken}

When status === "accepted", the response includes welcomeUrl, discordInviteUrl, appStoreUrl, welcomeVideoUrl, and setupUrl.

Schema: /beta-application.schema.json · Browser fallback: /beta?mode=agent

Onboarding flow overview

Agent                    Human
  │                        │
  ├─ Complete setup ───────┤
  ├─ Create draft token    │
  ├─ Share claim URL/QR ──►│ Opens /claim/{token}
  │                        ├─ Reviews plan summary
  │                        ├─ Verifies email (OTP)
  │                        ├─ Downloads iOS app
  │                        └─ Signs in → quick tour

Path A — Headless HTTP API (recommended)

Create a draft without a browser session:

curl -X POST "https://ideal-dolphin-65.convex.cloud/onboarding/draft" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "answers": { "...": "see agent.txt" }
  }'

Response:

{
  "token": "...",
  "expiresAt": 1234567890123,
  "claimUrl": "https://sortiri.ai/claim/...",
  "statusUrl": "https://ideal-dolphin-65.convex.site/onboarding/draft/status/...",
  "handoffMessage": "Your Sortiri fitness plan is ready..."
}

Schema: /onboarding-draft.schema.json

Drafts expire after 24 hours. Each token can be claimed once. Rate limit: 20/hour.

Path B — Browser automation (fallback)

Open /setup?mode=agent. Each step is a section[data-setup-step][data-setup-ready="true"] with labeled inputs and option buttons (button[name][data-value]). Deep-link with ?step=meals when prior steps are complete.

  1. Automate each wizard step using stable selectors (see /agent.txt)
  2. Chip steps auto-advance; date/text steps need Continue
  3. On finish, receive claim URL + QR code
  4. Share with the account owner

Beta browser fallback: /beta?mode=agent with data-beta-step selectors.

Step order (setup): goal → meals → workouts → weigh-ins → gender → units → dob → weight → height → activity → macros → notifications → consent → email.

Female users may see additional steps: pregnancy, cycle tracking, period dates.

Compute macros (API agents)

API requests must include computed targets in answers. Use Mifflin-St Jeor:

Required output fields: dailyCalorieGoal, macroProtein, macroCarbs, macroFat, dailyWaterGoalMl

Claim flow (human)

  1. Open https://sortiri.ai/claim/{token}
  2. Review plan summary
  3. Enter email (prefilled if agent provided it) + OTP verification
  4. Download iOS app and sign in with same email

What agents cannot do

Security

Full spec: /agent.txt · Support: support@fystash.ai