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

# Authentication

> Learn how BookHub Publisher API uses JWT authentication, including header format and token requirements.

Authenticate with the BookHub Publisher API using JWT bearer tokens.

## JWT bearer token

All API requests require authentication using a JWT bearer token.

### Obtaining a token

Tokens are issued manually by BookHub support. To request one, email api–[support@bookhub.com](mailto:support@bookhub.com) with your publisher name, account ID, and contact email.

### Using the token

Replace `YOUR_JWT_TOKEN` with the 24–hour JWT provided by api–[support@bookhub.com](mailto:support@bookhub.com).

```http theme={null}
Authorization: Bearer YOUR_JWT_TOKEN
```

```bash theme={null}
curl -X GET https://api.bookhub.com/api/v2/books \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

### Token expiration and renewal

Tokens expire 24 hours after they are issued. To renew, email api–[support@bookhub.com](mailto:support@bookhub.com) with the same details you used to request the original token (publisher name, account ID, and contact email).

### Authentication errors

A request with a missing, malformed, or expired token returns `401 Unauthorized`. Authentication errors return only the `status` and `message` fields — they do not include the `errors` array used for field-level validation failures.

```json theme={null}
{
  "status": "error",
  "message": "Unauthorized: the authentication token is missing, malformed, or expired."
}
```

### Token security

Store tokens securely and never expose them in client–side code, version control, or logs. Rotate tokens immediately if compromised by contacting api–[support@bookhub.com](mailto:support@bookhub.com).

## Next steps

Explore related topics:

### How-to guides

* [Monitor rate limits](/how-to-guides/how-to-guides-monitor-rate-limits.md) — Track your API usage to avoid exceeding rate limits.
* [Add the `Idempotency-Key` header](/how-to-guides/how-to-guides-add-the-idempotency-key-header) — Add the `Idempotency-Key` header to prevent duplicates when creating books.

### Reference

* [API endpoints](/reference/reference-api-endpoints.md) — Provides additional information about the BookHub Publisher API v2 endpoints, including business rules.
* [Code examples](/reference/reference-code-examples.md) — Copy code samples for book creation, sorting by creation date, handling removed title sorting, and tracking performance with `hitCount`.
* [Release notes](/reference/reference-release-notes.md) — Explore all changes in BookHub Publisher API v2.

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.