lovegpt / docs /api.md
Crownelius's picture
Add encrypted matchmaker agent table
910f36a verified
|
Raw
History Blame Contribute Delete
2.01 kB
# API
All `/api/*` routes except Stripe webhooks require:
```text
Authorization: Bearer <supabase-access-token>
```
## Health
`GET /health`
Returns service status.
## OpenClaw
`POST /api/openclaw/chat`
```json
{
"currentQuestionId": "q1",
"messages": [
{ "role": "user", "content": "My values are honesty, craft, kindness,..." }
]
}
```
Returns the OpenClaw response contract from `artifacts/schemas/openclaw-response.schema.json`.
## Profiles
`GET /api/profiles/questions`
Returns the full compatibility questionnaire.
`GET /api/profiles/me`
Returns the authenticated user's profile or `null`.
`POST /api/profiles/me`
```json
{
"displayName": "Alex",
"age": 31,
"location": "Denver, CO",
"gender": "woman",
"interestedIn": ["men"]
}
```
`PATCH /api/profiles/answers/:questionId`
```json
{
"answer": ["Poor dental hygiene", "Dirty home"],
"followup": "These are hard attraction breaks for me.",
"dealbreakerSeverity": "high"
}
```
`POST /api/profiles/complete`
Requires all questionnaire answers. Generates summary, embedding, extracted disgust triggers, extracted captivating traits, and marks the profile complete.
## Payments
`POST /api/payments/checkout-session`
Returns:
```json
{
"id": "cs_test_...",
"url": "https://checkout.stripe.com/..."
}
```
`POST /api/payments/webhook`
Stripe raw-body endpoint. Marks entry paid after `checkout.session.completed`.
## Matches
`GET /api/matches`
Lists existing curated matches.
`POST /api/matches/curate`
Requires complete profile and paid entry. Creates up to 10 suggested matches.
`POST /api/matches/:matchId/accept`
Accepts a match. When both sides accept, status becomes `active` and a conversation is created.
## Messages
`GET /api/messages/conversations`
Lists conversations.
`GET /api/messages/conversations/:conversationId/messages`
Lists messages.
`POST /api/messages/conversations/:conversationId/messages`
```json
{
"body": "I liked what you wrote about repair after conflict."
}
```