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

# Introduction

> Example section for showcasing API endpoints

<Note>
  This section provides documentation for the NexWrite API.
</Note>

## Welcome

The NexWrite API allows you to programmatically access and manage blog posts, user accounts, authentication, and settings. This section outlines how to authenticate and start using the available endpoints.

## Authentication

All API endpoints require Bearer token authentication. After signing in, the server returns a JWT token which must be included in the `Authorization` header for any protected request.

```json theme={null}
"security": [
  {
    "bearerAuth": []
  }
]
```

### How to Get a Token

Send a POST request to:

```
/api/auth/login
```

With the following body:

```json theme={null}
{
  "email": "admin@example.com",
  "password": "your_password"
}
```

The server will respond with a token:

```json theme={null}
{
  "token": "your-jwt-token"
}
```

Use this token in the `Authorization` header:

```http theme={null}
Authorization: Bearer your-jwt-token
```

You can now access protected endpoints such as `/api/posts`, `/api/users`, `/api/settings`, etc.

<Note>
  The token is automatically stored and used in the frontend after login.
</Note>
