Getting started

Authentication

Every request is authenticated with an API key sent in the X-API-Key header. Store the key in a server-side environment variable and never expose it to browsers.

  • X-API-KeyHeader on every request
  • 401Missing or invalid key
  • Server-sideWhere the key belongs

Authenticated request

Every request

Send the key in the X-API-Key header. The same key works on every endpoint in the reference.

Authenticated requestbash
curl "https://api.envoapi.com/api/v2/profiles/avery-chen-synthetic" \  -H "X-API-Key: $ENVO_API_KEY"

Call the API from your backend

Server-side only

Browser-facing apps should call your own server route, which then calls EnvoAPI with X-API-Key. Keys shipped in client-side code are public.

Server route patternts
export async function getProfile(publicIdentifier: string) {  const res = await fetch(    `https://api.envoapi.com/api/v2/profiles/${encodeURIComponent(publicIdentifier)}`,    {      headers: {        "X-API-Key": process.env.ENVO_API_KEY ?? "",      },    },  );  return res.json();}

The same pattern in Python:

Server route pattern · Pythonpython
import osfrom urllib.parse import quoteimport requestsdef get_profile(public_identifier: str):    res = requests.get(        "https://api.envoapi.com/api/v2/profiles/"        + quote(public_identifier, safe=""),        headers={"X-API-Key": os.environ["ENVO_API_KEY"]},        timeout=30,    )    return res.json()

When a key is missing or invalid

401 · unauthorized

Requests without a valid key return 401 with the standard error envelope. Do not echo API keys in logs, UI, analytics, or error messages.

Response401json
{  "success": false,  "data": null,  "pagination": null,  "meta": {    "error": {      "statusCode": 401,      "type": "unauthorized",      "detail": "Authentication required"    }  }}

When a request that should be authenticated comes back 401, the cause is almost always on the sending side:

  • The value of X-API-Key is the key alone — no Bearer prefix, no quotes around the value.
  • An unset environment variable sends an empty header value. When debugging, log whether the header is present and non-empty — never the key itself.
  • A key pasted with surrounding whitespace or a trailing line break fails. Trim the value before sending it.
  • The same key works on every endpoint, so a 401 on one endpoint but not another points at the request that is missing the header — for example a second HTTP client in the codebase that never had it added.

Keeping keys safe

Operational
  • Store keys in environment variables or a secrets manager, not in source control.
  • Use a placeholder such as $ENVO_API_KEY in documentation, scripts, and examples.
  • Rotate a key immediately if it leaks, then update your server environment.

Try it with your own records

Sign up for an API key — 100 free credits, no credit card — and the same key works on every documented endpoint.

Get API key

Keep reading