API Reference

API Overview

Comprehensive reference for the Interna REST API. All endpoints, parameters, and response formats documented.

Base URL

All API requests should be made to the following base URL:

https://api.interna.dev/v1

For sandbox/testing, use https://sandbox-api.interna.dev/v1 instead.

Authentication

Authenticate requests by including your API key in the Authorization header:

cURL
curl https://api.interna.dev/v1/users \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json"

Request Format

The API accepts JSON-encoded request bodies and returns JSON-encoded responses.

Headers

HeaderRequiredDescription
AuthorizationYesBearer token with your API key
Content-TypeFor POST/PUTMust be application/json
X-Request-IdNoIdempotency key for safe retries
X-Api-VersionNoAPI version override (default: latest)

Response Format

All responses follow a consistent envelope format:

Success Response
{
  "data": { ... },
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2025-03-15T10:30:00Z"
  }
}

Status Codes

CodeMeaningDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request parameters
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error

Pagination

List endpoints support cursor-based pagination:

Paginated Request
# First page
curl "https://api.interna.dev/v1/users?limit=25"

# Next page
curl "https://api.interna.dev/v1/users?limit=25&cursor=eyJpZCI6InVzcl8yeEs5bVBxUiJ9"

Rate Limits

Rate limit information is included in response headers. See the Rate Limiting guide for details.

Endpoints

MethodEndpointDescription
GET/v1/usersList all users
POST/v1/usersCreate a new user
GET/v1/users/:idGet a user by ID
PUT/v1/users/:idUpdate a user
DELETE/v1/users/:idDelete a user
GET/v1/organizationsList organizations
POST/v1/organizationsCreate an organization
GET/v1/auth/tokenGenerate access token
POST/v1/auth/revokeRevoke a token