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

# Authenticate

All REST calls to `barkd` must include a bearer token. `barkd` generates one automatically on first start and stores it in the datadir.

<Steps>
  <Step title="Show the token">
    Print the current bearer token:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    barkd --datadir <path-to-bark-data> secret show
    ```
  </Step>

  <Step title="Rotate the token">
    To rotate the token, run:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    barkd --datadir <path-to-bark-data> secret refresh
    ```

    You can also supply your own token instead of letting `barkd` generate one:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    barkd --datadir <path-to-bark-data> secret refresh --secret <token>
    ```
  </Step>
</Steps>

## Next steps

With the daemon running and a token in hand, you can start driving `barkd` over its REST API.

<Card title="REST API" icon="code" href="/barkd/api-reference/wallet/create-a-wallet">
  Full reference for every `barkd` REST endpoint.
</Card>
