Quickstart

Make your first API call in 5 minutes

This guide walks you through authenticating and making your first API request to OCVR.

Base URL

All API requests go to:

https://api.ocvr.net/v1

For local development:

http://localhost:16100/v1

Authentication

OCVR uses session tokens for authentication. First, register or login to get a token:

Register a new account

curl -X POST https://api.ocvr.net/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "your-secure-password",
    "display_name": "YourName"
  }'

Login to existing account

curl -X POST https://api.ocvr.net/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "your-password"
  }'

Both return a response like:

{
  "data": {
    "token": "sess_abc123...",
    "user": {
      "id": 12345,
      "display_name": "YourName",
      "email": "you@example.com"
    }
  }
}

Making authenticated requests

Include the token in the Authorization header:

curl https://api.ocvr.net/v1/auth/me \
  -H "Authorization: Bearer sess_abc123..."

Response format

All responses follow this envelope:

{
  "data": { ... },
  "error": null
}

On error:

{
  "data": null,
  "error": {
    "code": "AUTH_INVALID_CREDENTIALS",
    "message": "Invalid email or password"
  }
}

Next steps

-- ---