Skip to main content

API keys

GET /api masks the key; GET /api/:id returns it in full. There is no update endpoint. See API keys.

Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.

4 endpoints.

GET /api

List API keys. key is projected out; you get maskedKey.

Auth apikey

:::note Used by the web app pages/APIKeyIPAddress.jsx :::

Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.

Responsedata is an array of Api objects, alongside the pagination fields described in Response format. updatedBy, createdBy are populated, so they arrive as nested objects rather than ids.

POST /api

Create an API key. The full key is returned once, here only.

Auth apikey · Success 200

:::note Used by the web app pages/APIKeyIPAddress.jsx :::

Request body

FieldDefaultNotes
ipRestrictionopenopen or restricted. Stored but not currently enforced.
typepermanentpermanent or temporary.
durationMinutesRequired when type is temporary — otherwise DurationRequired_400. Not enforced on this path; see API keys.

Responsedata is one Api object. (Resource deduced from the collections this handler reads, not read off an explicit return.)

Errors DurationRequired_400

DELETE /api

Delete API keys.

Auth apikey · Success 200

:::note Used by the web app pages/APIKeyIPAddress.jsx :::

Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.

Responsedata is null; the outcome is the status code and message.

GET /api/:id

Fetch one API key document — this returns the key in full.

Auth apikey

Path parameters

Name
idRequired

Responsedata is one Api object.

Errors ApiNotFound_400