Skip to main content

API Reference

The Loyva partner API is a RESTful JSON API served over HTTPS. All partner endpoints are versioned under /api/v2/partner/* and authenticated with an API key.

Base URL

https://api.stg.loyva.net/api/v2

Request format

  • All request bodies must be JSON with Content-Type: application/json
  • File uploads use Content-Type: multipart/form-data
  • Dates are ISO 8601 strings (2026-04-11T10:00:00.000Z)
  • IDs are prefixed strings (e.g., env_, cust_, lk_)

Authentication

Every partner API request is authenticated with your lk_... key in the X-API-Key header:

X-API-Key: lk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2

The organization is derived from the key — no additional org header is required.

See Authentication for full details, including short-lived embed tokens for iframe widgets.

Pagination

List endpoints return paginated results:

Request:

GET /api/v2/partner/envelopes?page=2&limit=25

Response:

{
"data": [...],
"meta": {
"page": 2,
"limit": 25,
"total": 142
}
}
ParameterDefaultMaxDescription
page1Page number (1-indexed)
limit20 (50 for some endpoints)100–200 depending on endpointItems per page
note

The page count is not returned — compute it client-side as Math.ceil(total / limit).

Response envelope

Every 2xx response wraps resources under a top-level data field. Mutation endpoints wrap the created/updated resource the same way. Errors use { "error": "...", "details"?: [...] } instead.

{ "data": { /* resource */ } }
{ "data": [ /* resources */ ], "meta": { "page": 1, "limit": 20, "total": 42 } }

Rate limits

Partner keys have an rate_limit_rpm configured at provisioning time (default 60). Rate limit headers are returned on every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 298
X-RateLimit-Reset: 1712836860

When rate limited, you'll receive a 429 Too Many Requests response.

Common headers

Request headers

HeaderRequiredDescription
X-API-KeyYesYour partner key (lk_...)
Content-TypeYes (writes)application/json

Response headers

HeaderDescription
X-Request-IdUnique request ID for debugging
X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-ResetRate limit state

ID formats

ResourcePrefixExample
Envelopeenv_env_x7k9m2p4q1w3
Customercust_cust_abc123def456
API Keylk_lk_a1b2c3d4e5f6...
Organizationorg_org_main789

Status codes

CodeMeaning
200Success
201Created
400Bad request — invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — insufficient scope
404Not found
409Conflict — resource already exists
422Unprocessable — valid JSON but semantic error
429Rate limited
500Internal server error

See Errors for the error response format.