> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usealmanac.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Call the REST API

> Authenticate, discover resource IDs, and search a wiki over the hosted v1 API.

Use the REST API for services in any language and integrations that do not need
local folder discovery.

## Base URL

```text theme={"theme":{"light":"github-light","dark":"vesper"}}
https://api.usealmanac.com
```

All product routes begin with `/v1` and require HTTPS.

## Make a first authenticated request

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
export ALMANAC_API_URL="https://api.usealmanac.com"
export ALMANAC_TOKEN="waka_..."

curl "$ALMANAC_API_URL/v1/me" \
  -H "Authorization: Bearer $ALMANAC_TOKEN"
```

Create the key and choose permissions in [API keys](/api/authentication).

## Discover IDs

Direct API path parameters such as `{workspace_id}`, `{wiki_id}`, `{job_id}`, and
`{source_id}` require resource IDs—not handles or slugs.

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl "$ALMANAC_API_URL/v1/workspaces" \
  -H "Authorization: Bearer $ALMANAC_TOKEN"

curl "$ALMANAC_API_URL/v1/wikis?workspace_id=$WORKSPACE_ID" \
  -H "Authorization: Bearer $ALMANAC_TOKEN"
```

## Search the wiki

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl --get "$ALMANAC_API_URL/v1/wikis/$WIKI_ID/search" \
  -H "Authorization: Bearer $ALMANAC_TOKEN" \
  --data-urlencode "q=customer onboarding"
```

Search results include a folder-aware page path, title, summary, excerpt, and
relevance rank.

<CardGroup cols={2}>
  <Card title="Handle errors and pages" icon="triangle-alert" href="/api/errors-and-pagination">
    Use the stable error envelope, request IDs, limits, and offsets.
  </Card>

  <Card title="Browse endpoints" icon="braces" href="/api-reference/workspaces/workspaces">
    Open the generated request and response reference.
  </Card>
</CardGroup>
