SpaceCare Public API
Machine-readable formats: OpenAPI 3.1 (JSON), Markdown, and llms.txt.
## Introduction
SpaceCare helps professionals package their expertise into structured content - courses built from ordered modules, plus podcasts, newsletters, and downloadable resources - and share it with the clients they work with.
The public API brings that into your own systems: an approved partner application can read a creator's published courses - so delivery and follow-up live in the tools your team already uses.
### What you can do
- **Read your catalogue from your own product.** List a creator's courses and read module headers to link out or embed.
## Overview
The API is REST over HTTPS with JSON request and response bodies. Every request carries a bearer token, is gated by scope, and is owner-scoped - a token only ever reads or writes its own account's data.
Base URL: `https://space.care/api/v1`
Successful responses use the envelope `{ data, meta? }`; failures use `{ error: { code, message, details? } }`. Branch on the machine-stable `error.code`, never on the human-readable `error.message`.
## Getting started
1. **Mint a scoped API key.** Sign in to the SpaceCare app and open [Settings -> Developer API](https://space.care/settings?tab=developers) to create a key. Scopes are selectable when you mint the key - grant only what your integration needs.
2. **Send the key as a bearer token.** Add an `Authorization` header to every request:
```http
Authorization: Bearer <your-api-key>
```
3. **Verify your credential.** Call `GET https://space.care/api/v1/me` to confirm the token works and read back its granted scopes.
A missing or invalid token returns `401 unauthorized`; a valid token missing a required scope returns `403 insufficient_scope`.
## Scopes
A credential carries one or more of these scopes. Operations declare the scope they require.
- `read:profile` - verify a credential and read back its identity and scopes.
- `read:courses` - list and read your own courses and module headers, never module bodies.
## Machine-readable specification
A public, unauthenticated OpenAPI 3.1 document is served at `https://docs.space.care/openapi.json` - a bare OpenAPI document (not wrapped in the `{ data }` envelope) so tooling can consume it directly. The spec only describes shapes and carries no secret; every call still requires a bearer token.
A Markdown rendering of the full reference is at `https://docs.space.care/openapi.md`, and an `llms.txt` index for AI agents at `https://docs.space.care/llms.txt`.
Credentialed tooling can also fetch the same document from the API host at `https://space.care/api/v1/openapi.json` (bearer-gated).
