Skip to content

Authentication

Hype Doc supports passwordless email sign-in, opaque API tokens, and OAuth 2.1 for MCP clients. API requests use a bearer token in the Authorization header.

Request a code:

Terminal window
curl -X POST https://app.myhypedoc.com/api/v1/auth/code \
-H 'Content-Type: application/json' \
-d '{"email_address":"ada@example.com"}'

The server returns 202 {} and sends a six-character code. Codes expire after 15 minutes and can be used once. Verify it:

Terminal window
curl -X POST https://app.myhypedoc.com/api/v1/auth/verify \
-H 'Content-Type: application/json' \
-d '{
"email_address":"ada@example.com",
"code":"2K7MNP",
"device_name":"CLI"
}'

The response contains a user and a raw API token:

{
"token": "<raw token, shown once>",
"user": {
"id": "user-uuid",
"email_address": "ada@example.com",
"name": "Ada Lovelace",
"plan": "free",
"email_verified": true,
"unconfirmed_email": null,
"onboarding_completed": true,
"onboarding_goal": "career",
"wins_remaining": 12,
"spaces_remaining": 1,
"created_at": "2026-10-27T15:30:00Z"
}
}

Codes are case-insensitive, and non-alphanumeric characters are ignored. A wrong or expired code returns 401. Save the token in a secure location.

Web sign-in uses the same endpoints and creates a signed cookie session. Native apps store the returned token in Keychain or Android secure storage.

GET /api/v1/wins
Authorization: Bearer <token>

For example:

Terminal window
export HYPEDOC_TOKEN='<token>'
curl https://app.myhypedoc.com/api/v1/wins \
-H "Authorization: Bearer $HYPEDOC_TOKEN"

Revoke the token used by the current request:

DELETE /api/v1/auth/session
Authorization: Bearer <token>

A missing or invalid token returns 401 {"error":"Authentication required"}.

Create a named token in Settings or with the API:

POST /api/v1/api_tokens
Authorization: Bearer <existing-token>
Content-Type: application/json
{"name":"Build script","expires_in_days":90}

The raw token appears only in the creation response. The API stores a SHA-256 digest. List metadata with GET /api/v1/api_tokens and revoke a token with DELETE /api/v1/api_tokens/{id}. See API tokens.

MCP clients use OAuth 2.1 with S256 PKCE. Discovery requires no credentials:

EndpointPurpose
GET /.well-known/oauth-authorization-serverAuthorization server metadata
GET /.well-known/oauth-protected-resourceMCP protected resource metadata
POST /oauth/registerPublic dynamic client registration
GET /oauth/authorizeUser sign-in and consent
POST /oauth/tokenAuthorization code or refresh exchange
POST /oauth/revokeRevoke an access or refresh token

The server supports read and write scopes, requires S256 PKCE, returns one-hour access tokens, and rotates refresh tokens. MCP write tools require the write scope. Users can revoke authorized clients from Settings or through the connected apps operations.

MCP clients should open:

https://app.myhypedoc.com/mcp

They handle discovery, registration, PKCE, consent, and token refresh. See the MCP OAuth flow for client configuration details.

Unauthenticated API requests are limited to 10 per minute per IP. Authenticated API requests are limited to 100 per minute per token. The email code endpoint is limited to 5 requests per minute per IP. See Rate limits.