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

# API Reference

> Core endpoints for interacting with the Social Network Microservices.

## Authentication

All internal microservices (except public routes) are protected by a centralized authentication system. Clients must first obtain a JSON Web Token (JWT) via the API Gateway.

### Login & Get Token

<CodeGroup>
  ```http Request theme={null}
  POST /api/auth/login
  Content-Type: application/json

  {
    "username": "user1",
    "password": "pass123"
  }

  {
    "error": false,
    "status": 200,
    "body": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
  ```
</CodeGroup>

***

## Posts Service

The Content Service handles all post-related logic, interacting with the DB Service securely behind the scenes.

### Create a New Post

**Requires Authentication**: Include the JWT in the `Authorization` header.

<CodeGroup>
  ```http Request theme={null}
  POST /api/posts
  Authorization: Bearer <your-jwt-token>
  Content-Type: application/json

  {
    "content": "Hello world! This is my first post from the Microservices API."
  }

  {
    "error": false,
    "status": 201,
    "body": {
      "id": 1,
      "uuid": "550e8400-e29b-41d4-a716-446655440000",
      "user_id": 1,
      "content": "Hello world! This is my first post from the Microservices API.",
      "created_at": "2026-04-07T10:00:00.000Z"
    }
  }
  ```
</CodeGroup>

***

## Likes Service

Independent service dedicated to handling user interactions with posts.

### Like a Post

**Requires Authentication**: Include the JWT in the `Authorization` header.

<CodeGroup>
  ```http Request theme={null}
  POST /api/likes
  Authorization: Bearer <your-jwt-token>
  Content-Type: application/json

  {
    "post_id": 1
  }

  {
    "error": false,
    "status": 201,
    "body": {
      "id": 1,
      "user_id": 1,
      "post_id": 1,
      "created_at": "2026-04-07T10:05:00.000Z"
    }
  }
  ```
</CodeGroup>
