Auth Endpoints
Endpoints for account creation via GitHub OAuth.
GET /v1/auth/github/url
Get the GitHub OAuth authorization URL.
bash
curl https://api.payre.dev/v1/auth/github/url?role=developerQuery Parameters:
| Param | Required | Description |
|---|---|---|
role | Yes | developer or consumer |
Response:
json
{
"url": "https://github.com/login/oauth/authorize?client_id=xxx&scope=read:user,user:email&state=developer"
}POST /v1/auth/github
Exchange a GitHub OAuth code for a Payre account.
bash
curl -X POST https://api.payre.dev/v1/auth/github \
-H "Content-Type: application/json" \
-d '{"code": "github_oauth_code_here", "role": "developer"}'Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | GitHub OAuth authorization code |
role | string | Yes | developer or consumer |
Response:
json
{
"id": "dev_xxx",
"email": "dev@example.com",
"name": "Developer Name",
"secretKey": "pyr_sk_live_xxx",
"role": "developer"
}Account creation is idempotent -- if the email already exists, the existing account is returned.
Health Check
GET /health
bash
curl https://api.payre.dev/healthResponse:
json
{
"status": "ok",
"service": "@payre/api",
"uptime": 12345
}No authentication required.