REST API

Over REST you call your own endpoints: jobs your AI did once in your Cloud Browser, saved with Custom API. There are no ready endpoints per app.

Introduction

Every endpoint is one you built with Custom API: in the console builder or by your AI over MCP. It lives under https://cotlet.dev/api/v1/custom, takes a JSON body and answers JSON.

Routes

POST https://cotlet.dev/api/v1/custom/{name}             call an endpoint
GET  https://cotlet.dev/api/v1/custom/runs/{run_id}     result of a call that answered 202
GET  https://cotlet.dev/api/v1/custom                   your endpoints with their schemas
GET  https://cotlet.dev/api/v1/custom/openapi.json      your endpoints as OpenAPI 3.1

A per-app path such as https://cotlet.dev/api/v1/skool/... answers 501 NOT_AVAILABLE and runs nothing. Its body links to the builder (custom_api_url).

Authentication

Send your API key as a bearer token on every call. X-API-Key works too, for tools that cannot set an Authorization header. Without a key every route answers 401 api_key_required.

Headers

Authorization: Bearer COTLET_API_KEY
Content-Type: application/json

Making a call

Call an endpoint with POST and its input as the JSON body. The body is checked against the endpoint's input schema before anything runs. Other methods answer 405 with Allow: POST.

Request

curl -X POST https://cotlet.dev/api/v1/custom/recent_bookings \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date": "2026-11-20", "limit": 2}'

Names are 2 to 40 lowercase letters, digits or underscores, unique in your workspace; runs and openapi are reserved.

Responses

An answer within 30 seconds comes in the same request: 200 with the run id and data, in the shape of the endpoint's output schema.

Response 200

{
  "run_id": "6f1c2b7e-90d4-4a51-8c3e-2b7d5f0a9e14",
  "data": {
    "bookings": [
      { "id": "bk_4821", "starts_at": "2026-11-20T09:30:00Z", "client": "Ana Lopez" }
    ]
  }
}

A call still running after 30 seconds answers 202 with a status_url, also sent as the Location header. Poll it with GET; Retry-After says how long to wait. A call stops at 90 seconds.

Response 202, then the result

{"run_id": "6f1c2b7e-90d4-4a51-8c3e-2b7d5f0a9e14", "status": "running", "status_url": "https://cotlet.dev/api/v1/custom/runs/6f1c2b7e-90d4-4a51-8c3e-2b7d5f0a9e14"}

GET https://cotlet.dev/api/v1/custom/runs/6f1c2b7e-90d4-4a51-8c3e-2b7d5f0a9e14
{"run_id": "6f1c2b7e-90d4-4a51-8c3e-2b7d5f0a9e14", "status": "succeeded", "data": { ... }}

A run's status is running, succeeded, failed (with the error fields below) or expired: input and answer are kept 24 hours, then cleared. Only your workspace's runs answer; any other id is 404.

Listing your endpoints

GET /api/v1/custom returns your endpoints, newest first: name, description, method, URL, input and output schema, status (active, needs_consent, broken or off) and whether it writes. GET /api/v1/custom/openapi.json gives the same as OpenAPI 3.1, for Postman, code generators and your agent.

OpenAPI

curl https://cotlet.dev/api/v1/custom/openapi.json -H "Authorization: Bearer $COTLET_API_KEY"

Writes and consent

An endpoint that changes data in the app needs your consent first: a dry run shows each request it would send (method, URL, body), and you allow them in the console at https://cotlet.dev/app/custom-api. Until then calls answer 409 NEEDS_CONSENT. Writes have a daily cap per endpoint, 20 by default and up to 200. A read-only key cannot call an endpoint that writes.

Errors

Errors return JSON with error, an upper-case code, a message, next_steps and the link that fixes the problem. A refused or failed call costs nothing.

Response 403

{
  "error": "auth_required",
  "code": "AUTH_REQUIRED",
  "message": "The owner is not signed in to example.com in their Cotlet Web browser.",
  "next_steps": ["Nothing was charged. Ask the owner to sign in to the app at browser_url, then make the same call again."],
  "browser_url": "https://cotlet.dev/app/browser/web?url=https%3A%2F%2Fexample.com"
}
Error codes of Custom API calls
StatusCodeWhat happenedWhat to do
400INVALID_INPUTThe body does not fit the input schema.Fix the JSON body; GET /api/v1/custom lists the schema.
401api_key_required, invalid_api_keyNo key, or the key is unknown, expired or revoked.Send Authorization: Bearer with a valid key.
402INSUFFICIENT_CREDITSYour credits cannot pay this call: the free trial ended or the credits are used up.Buy a credit pack in the console (Billing). The answer links pricing_url, the plans page.
403AUTH_REQUIREDYou are not signed in to the app in your Cloud Browser.Sign in at the browser_url, then call again.
403SCOPE_DENIEDA read-only key called an endpoint that writes.Use a key with Read and write (keys_url).
403HOST_BLOCKEDCotlet sends no requests to this site.Endpoints cannot reach it.
404UNKNOWN_ENDPOINTNo endpoint with this name in your workspace.List them at endpoints_url.
409NEEDS_CONSENT, ENDPOINT_OFFWrites are not allowed yet, or you turned the endpoint off.Allow the writes or turn it on at custom_api_url.
429RATE_LIMITED, WRITE_CAP_REACHEDOver 60 calls a minute or 5 at once per key, or the daily write cap is used up.Wait, then call again; raise the cap at custom_api_url.
502ENDPOINT_FAILED, OUTPUT_MISMATCHThe run failed, or its answer does not fit the output schema.If the app changed, rebuild the endpoint at custom_api_url.
503ENDPOINT_BROKENThe endpoint failed 3 times in a row and is off.Save a new version in the builder; calls work again then.
504TIMEOUTThe call did not finish in 90 seconds.For an endpoint that writes, check the app before calling again.

We never sign in for you or skip two-factor checks. When the app needs you, the error carries a browser_url to your Cloud Browser (also sent as connect_url, the older name).

Reporting a problem

Send bugs, errors and missing features straight to us with your key. Same fields as the MCP tool cotlet_report_issue (MCP docs).

Request

POST https://cotlet.dev/api/v1/reports
Authorization: Bearer COTLET_API_KEY

{
  "kind": "error",
  "title": "recent_bookings fails with ENDPOINT_FAILED",
  "description": "Three calls in a row since 14:00, the page loads fine in my Cloud Browser.",
  "tool": "recent_bookings"
}

kind is one of bug, error, feature_request, missing_feature or other. The answer is 201 with a report_id.

Rate limits

Rate limits
WhatLimit
Calls to your endpoints60 a minute and 5 at once per key
Listing endpoints, runs and OpenAPI120 a minute per IP
MCP messages120 a minute per key
Problem reports20 an hour per account

Over the limit you get 429 with a Retry-After header.

Discovery

These routes need no key. Agents use them to find an app and its MCP operations before the first call.

Discovery routes
RouteReturns
GET /api/v1/appsEvery app in the catalog with its links.
GET /api/v1/apps/{app}One app: what it is and how it connects.
GET /api/v1/pricingCredit packs and what uses credits.

List apps

curl https://cotlet.dev/api/v1/apps

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 500 credits, no card needed.