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

# API

> How the "API" application works in `zopio`.

<Tip>The `api` application runs on port 3002. We recommend deploying it to `api.{yourdomain}.com`.</Tip>

`zopio` exports the API from the `apps/api` directory. It is designed to be run separately from the main app, and is used to run isolate functions that are not part of the main user-facing application e.g. webhooks, cron jobs, etc.

## Overview

The API is designed to run serverless functions, and is not intended to be used as a traditional Node.js server. However, it is designed to be as flexible as possible, and you can switch to running a traditional server if you need to.

Functionally speaking, splitting the API from the main app doesn't matter if you're running these projects on Vercel. Serverless functions are all independent pieces of infrastructure and can scale independently. However, having it run independently provides a dedicated endpoint for non-web applications e.g. mobile apps, smart home devices, etc.

## Features

* **Api keys**: The API is used to run [api keys](/packages/api-keys). These are defined in the `apps/api/app/api-keys` directory. Each controller is a `.ts` file that exports a route handler.
* **Webhooks**: The API is used to run [inbound webhooks](/packages/webhooks/inbound). These are defined in the `apps/api/app/webhooks` directory. Each webhook is a `.ts` file that exports a route handler.
* **Cron jobs**: The API is used to run [cron jobs](/packages/cron). These are defined in the `apps/api/app/cron` directory. Each cron job is a `.ts` file that exports a route handler.
* **Triggers**: The API is used to run [advanced triggers](/packages/triggers). These are defined in the `apps/api/app/triggers` directory. Each trigger is a `.ts` file that exports a route handler.

<Tip>You can check status of the API by visiting `https://api.{yourdomain}.com/health`.</Tip>
