Authentication

How to authenticate SpaceKeep API requests with a session cookie.

Most SpaceKeep API endpoints require authentication. This page explains how to authenticate your requests.

How authentication works

SpaceKeep uses session-based authentication. When you sign up or log in, SpaceKeep sets a session cookie named access_token. That cookie is sent automatically by the browser on every request to a spacekeep.dev subdomain, so authenticated requests from a browser need no extra header.

For service-to-service use, send the cookie explicitly:

curl -s https://api.spacekeep.dev/profiles/me \
  -H "Accept: application/json" \
  -H "Cookie: access_token=$SPACEKEEP_TOKEN"

Getting a session

You obtain a session by:

  • Signing up — POST /auth/signup
  • Logging in — POST /auth/login
  • Using an OAuth provider — GitHub, Google, or Discord
  • Using a passkey — WebAuthn authentication

Session expiry

Sessions expire after 7 days. When a session expires, you will need to authenticate again to get a new one.