API Reference

Introduction

This API reference describes the RESTful and real-time APIs provided by Cortado.js. The framework enables fast and structured development of backend applications with built-in support for routing and assets management.

Authentication

Cortado.js supports token-based authentication (e.g., JWT) and custom schemes via middleware. Routes can be protected using request headers and server-side token verification.

main.ts

Authorization: Bearer YOUR_ACCESS_TOKEN

main.ts

Authorization: Bearer YOUR_ACCESS_TOKEN

main.ts

Authorization: Bearer YOUR_ACCESS_TOKEN

If you manage multiple tenants, organizations, or client environments within a single Cortado.js backend, you can pass custom headers to specify which organization or project context should be used during the request.

main.ts

import axios from 'axios';

async function fetchProfile() {
  const res = await axios.get('https://api.cortado.com/v1/profile', {
    headers: {
      Authorization: 'Bearer YOUR_ACCESS_TOKEN',
      'Cortado-Organization': 'YOUR_ORG_ID',
      'Cortado-Project': 'YOUR_PROJECT_ID',
    }
  });

  return res.data;
}

main.ts

import axios from 'axios';

async function fetchProfile() {
  const res = await axios.get('https://api.cortado.com/v1/profile', {
    headers: {
      Authorization: 'Bearer YOUR_ACCESS_TOKEN',
      'Cortado-Organization': 'YOUR_ORG_ID',
      'Cortado-Project': 'YOUR_PROJECT_ID',
    }
  });

  return res.data;
}

main.ts

import axios from 'axios';

async function fetchProfile() {
  const res = await axios.get('https://api.cortado.com/v1/profile', {
    headers: {
      Authorization: 'Bearer YOUR_ACCESS_TOKEN',
      'Cortado-Organization': 'YOUR_ORG_ID',
      'Cortado-Project': 'YOUR_PROJECT_ID',
    }
  });

  return res.data;
}

Routes

Cortado.js allows you to define REST endpoints with full control over routing, parameters, and middleware.
Routes support the following methods:

Was this helpful?

Dismiss

Was this helpful?

Dismiss

Last updated on

Jul 23, 2025