API Documentation

Getting Started

The Napisati Public API is a REST API that gives you programmatic access to everything in your account — generation types, style rules, generations, webhooks, team, and profile.

All requests are authenticated with an API key. All responses are JSON. The API is versioned under /api/v1.

Quick exports

Base URL

url
https://napisati.com/api/v1

Authentication

Every request must include your API key in the Authorization header as a Bearer token. API keys start with sk_live_.

bash
Authorization: Bearer sk_live_<your_key>

You can create and manage your API keys in Settings → API Keys. A key is shown once at creation — store it somewhere safe.

Never expose your API key in client-side code, public repos, or frontend JavaScript. Treat it like a password.

Request format

For POST and PATCH requests, send a JSON body with the Content-Type: application/json header.

bash
curl -X POST https://napisati.com/api/v1/generate \
  -H "Authorization: Bearer sk_live_<your_key>" \
  -H "Content-Type: application/json" \
  -d '{"input_text": "Write a LinkedIn intro", "generation_type_id": "<uuid>"}'

Response format

All successful responses wrap the payload in a data field. List endpoints also include pagination metadata.

json
// Single resource
{ "data": { "id": "uuid", ... } }

// List response
{
  "data": [ ... ],
  "total": 42,
  "page": 1,
  "limit": 20,
  "total_pages": 3
}

Error format

All errors return an appropriate HTTP status code and a JSON body with a machine-readable code and a human-readable error message.

json
{
  "error": "Human-readable description",
  "code": "MACHINE_CODE",
  "details": { ... },           // optional extra context
  "upgrade_url": "/settings/billing"  // only on 402 responses
}
StatusCodeMeaning
401INVALID_API_KEYMissing or invalid API key
402PLAN_LIMIT_REACHEDAction not allowed on your current plan
400VALIDATION_ERRORMissing or invalid request parameters
400INPUT_TOO_LONGinput_text exceeds your plan's word limit
403FORBIDDENYou don't have permission for this action
404NOT_FOUNDResource doesn't exist or belongs to another user
429RATE_LIMIT_EXCEEDEDToo many requests — check X-RateLimit-* headers
429DAILY_LIMIT_REACHEDDaily generation soft limit reached
500DB_ERRORUnexpected server error

Rate limiting

Every response includes rate limit headers so you can track your current window.

bash
X-RateLimit-Limit:     100          # max requests/minute for this endpoint
X-RateLimit-Remaining: 87           # remaining in current window
X-RateLimit-Reset:     1741965660   # epoch timestamp when window resets
Endpoint groupLimitWindow
All endpoints (standard)100 reqper minute, per API key
/api/v1/generate20 reqper minute, per API key

When rate limited you get 429 with a Retry-After header (seconds until window resets).

Plan limits

Write operations that exceed your plan limits return 402 PLAN_LIMIT_REACHED. The response always includes an upgrade_url.

ResourceFreeWriterProTeam
API Access
Generations/month20300
Words/generation5002 0005 0005 000
Generation Types320
Style Rules15
Webhooks05
Daily soft limit200500

Pagination

All list endpoints support page-based pagination via page and limit query parameters. Default page size is 20, max is 50.

bash
GET /api/v1/generations?page=2&limit=10
Create your API key