API Overview

The TextWatermark API lets you embed invisible watermarks inside text and extract them later. The mark survives copy-paste between apps, chat and email; robust mode also tells you when the text was cut short or changed. Use it to trace document leaks, verify authorship, or label AI-generated content. See Use cases for complete workflows.

Base URL

https://textwatermarking.com

All endpoints are HTTPS. There is no separate API subdomain — the app and API share the same host.

Versioning

The current API version is v2. Account management endpoints are prefixed /api/v2/. Watermarking endpoints use /api/watermark/ (unversioned — stable).

Prefix Covers
/api/auth/ Register, login, email verification, token refresh, logout
/api/v2/users/ Profile, password change, credit balance (/credits), token list / revoke / regenerate (/tokens)
/api/v2/tokens/ Create an API token (list and revoke live under /api/v2/users/tokens)
/api/v2/channels/ Signing channel management
/api/watermark/ Encode and decode watermarks (API-token authenticated)
/api/payments/ Checkout for credit packs and plans, subscription resume (Lemon Squeezy)

Authentication

The API uses two separate credential types depending on what you're doing:

Credential Format Used for
JWT access token Authorization: Bearer <jwt> Account endpoints — profile, tokens, channels, credits
API token Authorization: Bearer Watermarking — encode & decode (server-to-server)

JWTs expire after 2 hours and are refreshed via a httpOnly refresh cookie (30-day TTL). API tokens stay valid until you revoke or regenerate them in the dashboard. See Authentication for full details.

Core Concepts

Invisible watermarking. We embed data using Unicode variation selectors attached to visible characters. The resulting text looks and renders identically to the original — no visual change, no layout shift.

Secret (payload). The string you want to hide inside the text. Passed as the secret field on encode. Recovered as decoded on decode.

Signing channels. A channel holds a secret key on the server. API tokens bound to a channel encrypt the secret with AES-256-GCM before embedding it, and only tokens of the same channel can decode it; a wrong channel or changed text fails the authentication tag (422). Starter and Pro plans.

Resilience. The standard mode packs the secret into a few characters. Robust mode spreads it one bit per character with a length and checksum, so decode can tell an intact secret from a cut-short or changed one (integrity in the response).

Credits. Each watermark operation consumes credits from your balance. Subscription plans include a monthly credit allocation; additional credits can be purchased. Each watermark call costs 1 credit. Subscription credits expire at the end of their billing period; credit-pack credits are valid for 6 months; the ones that expire soonest are used first.

System Flow

TextWatermark System Flow Diagram

Text enters the encoder with a secret; invisible variation selectors are attached to visible characters to carry the encoded payload. On decode, the characters are extracted and the original secret is recovered.

Response Format

All responses are application/json. Errors follow a consistent shape:

{
  "error": "Unauthorized",
  "message": "Invalid or missing token"
}

See Error Handling for the full list of status codes and messages.

Rate Limits

Watermark calls made with an API token (/api/watermark/*) are limited per token: 600 requests per 15 minutes for each token, wherever they come from. Everything else (sign-in, dashboard and account endpoints) is limited per IP address: 100 requests per 15 minutes. Repeated invalid API tokens are limited too: 100 failed attempts per IP address per 15 minutes. Over a limit, the API returns 429 Too Many Requests with retryAfter (minutes) in the body and the standard RateLimit headers. Watermark calls are also metered by credits: 1 credit per successful call; refused calls (400, 422) cost nothing.

Next Steps