CapyDB Docs
ReferenceAPI

Auth

Viewer identity and CLI device-login sessions.

GET
/v1/me

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/me"
{  "organization": {    "billing_customer_id": "string",    "billing_email": "string",    "billing_name": "string",    "billing_period_end": "2019-08-24T14:15:22Z",    "billing_plan": "string",    "billing_product_id": "string",    "billing_provider": "string",    "billing_status": "string",    "billing_subscription_id": "string",    "clerk_organization_id": "string",    "clerk_organization_slug": "string",    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "name": "string",    "slug": "string",    "suspended_at": "2019-08-24T14:15:22Z",    "suspended_reason": "string",    "updated_at": "2019-08-24T14:15:22Z",    "vercel_installation_id": "string"  },  "principal": {    "auth_source": "string",    "clerk_organization_id": "string",    "clerk_organization_role": "string",    "clerk_organization_slug": "string",    "is_admin": true,    "organization_id": "string",    "scopes": [      "string"    ],    "user_id": "string"  }}
{  "error": "string"}
POST
/v1/cli/login/sessions

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/cli/login/sessions" \  -H "Content-Type: application/json" \  -d '{}'
{  "expires_at": "2019-08-24T14:15:22Z",  "poll_token": "string",  "session_id": "string",  "state": "pending"}
{  "error": "string"}
GET
/v1/cli/login/sessions/{sessionID}

Path Parameters

sessionID*string

CLI login session id.

Query Parameters

poll_token*string

Poll token returned by the session start call.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/cli/login/sessions/string?poll_token=string"
{  "authorized_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "organization_id": "string",  "organization_name": "string",  "organization_slug": "string",  "plaintext_api_key": "string",  "session_id": "string",  "state": "pending"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/cli/login/sessions/{sessionID}/authorize

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

sessionID*string

CLI login session id.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/cli/login/sessions/string/authorize"
{  "authorized_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "organization_id": "string",  "organization_name": "string",  "organization_slug": "string",  "plaintext_api_key": "string",  "session_id": "string",  "state": "pending"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}