> For the complete documentation index, see [llms.txt](https://docs.shipped.club/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shipped.club/features/api-endpoints.md).

# API endpoints

**Shipped** uses Next.js 14 latest features, which include the new App Router.

The API endpoints of your product live in the `/app/api/` folder. Any `route.ts` file, and each folder and subfolder, take part to the final endpoint URL.<br>

For example:

/app/api/user/routes.ts -> <http://localhost:3000/api/user>

/app/api/user/profile/routes.ts -> <http://localhost:3000/api/user/profile>

/app/api/user/\[id]/profile -> <http://localhost:3000/api/user/1234/profile><br>

The logic of each route resides in the `route.ts` files.

### Make an API call from your website

To make API calls, use the library `axios`.

```typescript

import axios from "axios";
import toast from "react-hot-toast";


axios
  .post("/api/waitlist", {
    email,
  })
  .then(() => {
    toast.success("You've been added to the waitlist!");
  })
  .catch(() => {
    toast.error("Something went wrong. Please try again later.");
  })
  .finally(() => {
    setLoading(false);
  });
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.shipped.club/features/api-endpoints.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
