Skip to main content

API Reference

The Landed API is a REST API for managing data integration pipelines (connectors, destinations, syncs). All endpoints are served over HTTPS and return JSON.

Base URLs

EnvironmentURL
Productionhttps://api.landed.dev
Staginghttps://api-staging-<hash>.run.app
Localhttp://localhost:8000

Authentication

The API supports three authentication methods, checked in this order:

After login or OAuth, an landed_session httpOnly cookie is set. The frontend uses this automatically. Sessions expire after 30 days.

2. API Key (programmatic)

API keys use the lnd_ prefix. Pass them as a Bearer token:

Authorization: Bearer lnd_abc123...

Create a key via POST /auth/api-keys. Keys are stored as SHA-256 hashes -- the raw key is returned only once at creation time. Revoke all keys with DELETE /auth/api-keys.

3. JWT (short-lived)

JWTs are issued on login/signup and expire after 1 hour. Refresh them via POST /auth/refresh (requires a valid session cookie). Pass as a Bearer token:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Rate Limits

All endpoints are rate-limited per client IP using slowapi. Limits are specified per endpoint:

TierLimitTypical endpoints
Read60/minuteList/get resources, catalogs
Read (high-freq)120/minuteSingle resource GETs, job polling
Write20/minuteCreate, update, delete
Sensitive10/minuteSync triggers, connection tests, OAuth, secret rotation
Auth5/minute, 20/hourSignup
Auth10/minute, 50/hourLogin

When rate-limited, the API returns 429 Too Many Requests with a Retry-After header.

Request/Response Format

  • Content-Type: application/json for all request bodies
  • Pagination: Most list endpoints accept limit (default 50, max 200) and offset (default 0) query params
  • IDs: All resource IDs are UUIDs (string format)
  • Timestamps: ISO 8601 format with timezone (e.g., 2026-03-28T12:00:00+00:00)

Error Responses

All errors return a JSON body:

{
"error": "Human-readable message",
"detail": "More specific info (optional)"
}

Standard Status Codes

CodeMeaning
400Bad request -- invalid params, unsupported type, validation failure
401Not authenticated -- missing or invalid credentials
402Payment required -- connector quota exceeded
403Forbidden -- subscription inactive
404Resource not found (or does not belong to your account)
409Conflict -- duplicate name, already exists
422Validation error -- Pydantic model validation failed
429Rate limit exceeded
500Internal server error
502Bad gateway -- upstream provider (Stripe, OAuth) unavailable
503Service unavailable -- feature not configured

Validation Errors (422)

{
"error": "Validation error",
"detail": [
{
"loc": ["body", "name"],
"msg": "String should have at least 1 character",
"type": "string_too_short"
}
]
}

Security Headers

Every response includes:

  • X-Content-Type-Options: nosniff
  • X-Frame-Options: DENY
  • Referrer-Policy: strict-origin-when-cross-origin
  • Permissions-Policy: geolocation=(), microphone=(), camera=()
  • X-Request-ID: <uuid> -- correlation ID for debugging (pass your own via the request header to trace)

OpenAPI / Swagger

The interactive API docs are available when EXPOSE_API_DOCS=true:

  • Swagger UI: GET /docs
  • ReDoc: GET /redoc
  • OpenAPI JSON: GET /openapi.json

These are disabled in production by default.


Endpoints

Health

MethodPathAuthDescription
GET/healthNoneLiveness + readiness probe. Returns {"status": "ok"} with DB pool stats, or 503 if unhealthy.

Auth

MethodPathAuthDescription
POST/auth/signupNoneCreate account with email + password
POST/auth/loginNoneLogin with email + password. Account locks after 5 failed attempts for 15 minutes.
POST/auth/logoutSessionInvalidate session, clear cookie
POST/auth/refreshSession + JWTRefresh an expired JWT (token must be less than 7 days old, session must be valid)
GET/auth/meAnyBootstrap endpoint -- returns customer info + fresh JWT
POST/auth/api-keysAnyGenerate a new API key (returned once)
DELETE/auth/api-keysAnyRevoke all API keys
POST/auth/exchange-codeNoneExchange a short-lived auth code for JWT (used after OAuth redirect)

OAuth (Login/Signup)

MethodPathAuthDescription
GET/auth/oauth/googleNoneRedirect to Google consent screen
GET/auth/oauth/google/callbackNoneGoogle OAuth callback (internal)
GET/auth/oauth/githubNoneRedirect to GitHub consent screen
GET/auth/oauth/github/callbackNoneGitHub OAuth callback (internal)
POST/auth/oauth/exchangeNoneExchange provider access token for Landed JWT (used by NextAuth)

Connectors

MethodPathAuthDescription
GET/connectors/catalogOptionalList all available connector types with metadata and auth fields
GET/connectors/catalog/{type}/schemaNoneGet full stream schema for a connector type
GET/connectorsRequiredList configured connectors (paginated)
GET/connectors/summaryRequiredDashboard overview with health counts and sparkline data
POST/connectorsRequiredCreate a new connector
GET/connectors/{id}RequiredGet connector details
PATCH/connectors/{id}RequiredUpdate connector (partial)
DELETE/connectors/{id}RequiredDelete connector and all related data
POST/connectors/{id}/syncRequiredTrigger a manual sync
POST/connectors/{id}/testRequiredTest connector credentials (no data written)
GET/connectors/{id}/streamsRequiredGet available streams with enabled/disabled state
PUT/connectors/{id}/streamsRequiredUpdate stream selection (enable/disable streams)

Connector OAuth (Credential Acquisition)

These endpoints handle OAuth flows for connectors that require it. The flow uses a popup window pattern.

MethodPathAuthDescription
GET/connectors/oauth/{provider}/authorizeRequiredGet OAuth authorize URL (provider: slack, microsoft, salesforce, hubspot, shopify)
GET/connectors/oauth/{provider}/callbackNoneOAuth callback from provider (internal)
GET/connectors/oauth/resultNoneConsume short-lived OAuth code to retrieve credentials

Destinations

MethodPathAuthDescription
GET/destinations/catalogNoneList supported destination types with field definitions
GET/destinationsRequiredList configured destinations (paginated)
POST/destinationsRequiredCreate a destination
GET/destinations/{id}RequiredGet destination details
PATCH/destinations/{id}RequiredUpdate destination (full body required, type cannot change)
DELETE/destinations/{id}RequiredDelete a destination
POST/destinations/testRequiredTest destination connectivity without saving
POST/destinations/{id}/testRequiredTest an existing destination's connectivity

Syncs (History)

MethodPathAuthDescription
GET/syncsRequiredList sync receipts (paginated, filterable by connector_id, status, date range)
GET/syncs/statsRequiredSync statistics with optional filters (connector_id, destination_id, days, granularity)
GET/syncs/{connector_id}RequiredList sync receipts for a specific connector
GET/syncs/{connector_id}/schemaRequiredSchema fields, recent changes, and pending backfills

Jobs (Live Progress)

MethodPathAuthDescription
GET/jobsRequiredList recent jobs (filterable by connector_id, status)
GET/jobs/{id}RequiredGet live job status and progress. Poll while status is pending or running.

Webhooks

MethodPathAuthDescription
GET/webhooksRequiredList webhook endpoints
POST/webhooksRequiredCreate webhook endpoint
GET/webhooks/{id}RequiredGet webhook endpoint
PATCH/webhooks/{id}RequiredUpdate webhook endpoint
DELETE/webhooks/{id}RequiredDelete webhook endpoint
POST/webhooks/{id}/rotate-secretRequiredGenerate new signing secret (returned once)
POST/webhooks/{id}/testRequiredSend a test webhook delivery
GET/webhooks/{id}/deliveriesRequiredList delivery log for an endpoint
GET/webhooks/{id}/secretRequiredRetrieve current signing secret (rate-limited)

See webhooks.md for payload formats and signature verification.

Alerts and Notifications

MethodPathAuthDescription
GET/alerts/groupsRequiredList alert groups
POST/alerts/groupsRequiredCreate alert group
GET/alerts/groups/{id}RequiredGet alert group with connectors
PATCH/alerts/groups/{id}RequiredUpdate alert group
DELETE/alerts/groups/{id}RequiredDelete alert group
POST/alerts/groups/{id}/connectorsRequiredAdd connector to group
DELETE/alerts/groups/{id}/connectors/{connector_id}RequiredRemove connector from group
GET/alerts/policiesRequiredList notification policies
POST/alerts/policiesRequiredCreate notification policy
PATCH/alerts/policies/{id}RequiredUpdate notification policy
DELETE/alerts/policies/{id}RequiredDelete notification policy
GET/alerts/policies/resolve/{connector_id}RequiredPreview which policies apply to a connector
POST/alerts/policies/{id}/testRequiredSend a test notification
GET/alerts/notificationsRequiredList in-app notifications
POST/alerts/notifications/{id}/readRequiredMark notification as read
POST/alerts/notifications/read-allRequiredMark all notifications as read
GET/alerts/notifications/unread-countRequiredGet unread notification count

Billing

MethodPathAuthDescription
GET/billing/usageRequiredConnector count, rows synced, monthly estimate
POST/billing/checkoutRequiredCreate Stripe Checkout session URL
POST/billing/portalRequiredCreate Stripe Customer Portal session URL
POST/billing/webhookNone (Stripe signature)Stripe webhook receiver (internal)

Integrations (GitHub App)

MethodPathAuthDescription
GET/integrations/github/installRequiredGet GitHub App install URL
GET/integrations/github/callbackNoneGitHub App install callback (internal)
GET/integrationsRequiredList connected provider integrations
DELETE/integrations/{provider}RequiredDisconnect a provider integration

Custom Connectors

MethodPathAuthDescription
GET/custom-connectorsRequiredList custom connector definitions
POST/custom-connectorsRequiredCreate a custom connector definition
GET/custom-connectors/{id}RequiredGet custom connector definition
PATCH/custom-connectors/{id}RequiredUpdate custom connector definition
DELETE/custom-connectors/{id}RequiredDelete custom connector definition
POST/custom-connectors/{id}/discoverRequiredAI-powered API discovery (infer auth, config, streams)
POST/custom-connectors/{id}/generateRequiredTrigger AI code generation
GET/custom-connectors/{id}/generationsRequiredList generation history
POST/custom-connectors/{id}/testRequiredTest custom connector in sandbox
POST/custom-connectors/{id}/iconRequiredUpload connector icon (multipart form)

Support

MethodPathAuthDescription
POST/support/chatOptionalSend message to support AI, receive SSE stream