---
# System prepended metadata

title: HTTP Endpoints

---

# Channel Router
## Endpoints
```
POST /channel
GET /channel
PUT /channel/:id
DELETE /channel/:id
```
## Parameters for each endpoint
- `POST /channel`: Create a new channel.

Request Body:
| Field        | Type          | Required | Description                                         |
|---------------|---------------|-----------|---------------------------------------------------|
| `name`   | string | Required | The name to be assigned to the channel ('20s', '30s'...etc).|


- `GET /channel`: Fetch channels filtered by one or more optional query parameters. If no query params are provided, returns all channels.

Query Parameters:

| Field        | Type          | Required | Description                                                  |
|---------------|---------------|-----------|--------------------------------------------------------------|
| `id`          | string | Optional | Retrieve a specific channel by ID.                              |
| `name`   | string | Optional | Retrieve a specific channel by its name                          |


- `PUT /channel/:id`: Update an existing channel by its ID.
Only the fields provided in the request body will be updated.

Request Body:
| Field        | Type          | Required | Description                               |
|---------------|---------------|-----------|-------------------------------------------|
| `name`   | string | Optional | Retrieve a specific channel by its name                          |



- `DELETE /channel/:id`: Delete a channel by its unique ID.
## Notes
- Responses will include posts to the given channels.

# Post Router
## Endpoints
```
POST /post
GET /post
PUT /post/:id
DELETE /post/:id
```
## Parameters for each endpoint
- `POST /post`: Create a new post under a specific channel.

Request Body:
| Field        | Type          | Required | Description                                         |
|---------------|---------------|-----------|---------------------------------------------------|
| `channelId`   | string (UUID) | Required | The ID of the channel to which this post belongs|
| `displayName` | string        | Required | The display name of the user creating the post.|
| `message`     | string        | Optional | Text content of the post (max 250 characters). |
| `imageUrls`   | string[]      | Optional | Array of image URLs associated with the post. |

- `GET /post`: Fetch posts filtered by one or more optional query parameters. If no query params are provided, returns all posts. Posts are arranged in a descending order from latest post to earliest.

Query Parameters:

| Field         | Type          | Required | Description                                                   |
|---------------|---------------|----------|---------------------------------------------------------------|
| `id`          | string        | Optional | Retrieve a specific post by ID.                               |
| `channelId`   | string        | Optional | Filter posts by channel ID.                                   |
| `displayName` | string        | Optional | Filter posts by author display name.                          |
| `message`     | string        | Optional | Filter posts containing a specific message substring (1–250). |
| `likes`       | number      | Optional | Filter posts with a specific number of likes                  |


- `PUT /post/:id`: Update an existing post by its ID.
Only the fields provided in the request body will be updated.

Request Body:
| Field         | Type          | Required| Description                               |
|---------------|---------------|---------|-------------------------------------------|
| `channelId`   | string (UUID) |Optional | Change the channel the post belongs to.   |
| `displayName` | string        |Optional | Update the display name.                  |
| `message`     | string        |Optional | Update the post’s text message.           |
| `imageUrls`   | string[]      |Optional | Replace or modify image URLs.             |
| `likes`       | number        |Optional | Replace of modify likes.                  |


- `DELETE /post/:id`: Delete a post by its unique ID.
## Notes
- Responses will include replies to the given posts.

# Reply Router
## Endpoints
```
POST /reply
GET /reply
PUT /reply/:id
DELETE /reply/:id
```
## Parameters for each endpoint
- `POST /reply`: Create a new reply under a specific post.

Request Body:
| Field        | Type          | Required | Description                                         |
|---------------|---------------|-----------|---------------------------------------------------|
| `postId`   | string (UUID) | Required | The ID of the post to which this reply belongs|
| `displayName` | string        | Required | The display name of the user creating the reply.|
| `message`     | string        | Required | Text content of the post (max 250 characters). |

- `GET /reply`: Fetch replies filtered by one or more optional query parameters. If no query params are provided, returns all replies. replies are arranged in a descending order from latest post to earliest.

Query Parameters:

| Field        | Type          | Required | Description                                                  |
|---------------|---------------|-----------|--------------------------------------------------------------|
| `id`          | string | Optional | Retrieve a specific reply by ID.                              |
| `postId`   | string | Optional | Filter replies by post ID.                                  |
| `displayName` | string        | Optional | Filter replies by author display name.                         |
| `message`     | string        | Optional | Filter replies containing a specific message. |


- `PUT /reply/:id`: Update an existing reply by its ID. Only the fields provided in the request body will be updated.

Request Body:
| Field        | Type          | Required | Description                               |
|---------------|---------------|-----------|-------------------------------------------|
| `postId`   | string (UUID) |Optional | Change the post the reply belongs to.   |
| `displayName` | string        |Optional | Update the display name.                  |
| `message`     | string        |Optional | Update the reply’s text message.           |


- `DELETE /reply/:id`: Delete a post by its unique ID.

