API Reference: Gate Identity

All Gate Identity endpoints are served from https://api.vernesoft.com.

Examples are shown as raw curl requests and as calls through the official SDKs — see Installation to set one up. SDK snippets assume an initialized verne client.

Every request requires a tenant API key in the Authorization header:

Authorization: Bearer vrn_gate_live_sk_9f8a7...

Identity Management

Tenant API keys can only access identities that belong to their own tenant. The Edge Gateway enforces this isolation — cross-tenant access is structurally impossible.

EndpointMethodsDescription
/v1/gate/identitiesPOSTCreate a new end-user identity
/v1/gate/identities/{id}GET, PATCH, DELETERead, update, or delete an identity
/v1/gate/identities/{id}/statePATCHActivate or deactivate an identity
/v1/gate/identities/{id}/metadataGET, PATCHRead or update custom metadata
/v1/gate/identities/{id}/sessionsGET, DELETEList or revoke all sessions for an identity
/v1/gate/sessions/{session_id}DELETERevoke a single session
/v1/gate/identities/{id}/resend-verificationPOSTResend verification email

Create Identity

POST /v1/gate/identities

Creates a new end-user identity bound to your tenant.

Request body — Kratos-compatible identity object:

FieldTypeRequiredDescription
schema_idstringYesMust be "user"
traits.emailstringYesEnd-user email address
credentials.password.config.passwordstringNoInitial password (omit for passwordless/social users)
statestringNo"active" (default) or "inactive"
curl -X POST https://api.vernesoft.com/v1/gate/identities \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...' \
  -H 'Content-Type: application/json' \
  -d '{
    "schema_id": "user",
    "traits": { "email": "user@example.com" },
    "credentials": {
      "password": { "config": { "password": "StrongPassword123!" } }
    },
    "state": "active"
  }'

Returns the created identity object (201 Created). Fires the identity.created webhook event.


Get Identity

GET /v1/gate/identities/{id}

Returns the full Kratos identity object. Includes traits, metadata_public, state, and credential metadata (no secrets).

curl https://api.vernesoft.com/v1/gate/identities/f47ac10b-... \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...'

Update Identity

PATCH /v1/gate/identities/{id}

Updates traits or other mutable fields. Body is a JSON Patch (RFC 6902) — an array of operations applied to the identity object; fields not referenced by any operation are unchanged.

curl -X PATCH https://api.vernesoft.com/v1/gate/identities/f47ac10b-... \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...' \
  -H 'Content-Type: application/json' \
  -d '[
    { "op": "replace", "path": "/traits/email", "value": "newemail@example.com" }
  ]'

Delete Identity

DELETE /v1/gate/identities/{id}

Permanently deletes the identity. Returns 204 No Content. Fires the identity.deleted webhook event.

curl -X DELETE https://api.vernesoft.com/v1/gate/identities/f47ac10b-... \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...'

Activate / Deactivate Identity

PATCH /v1/gate/identities/{id}/state

Changes the identity state. An inactive identity cannot log in — Kratos rejects their credentials automatically.

FieldTypeValues
statestring"active" or "inactive"
curl -X PATCH https://api.vernesoft.com/v1/gate/identities/f47ac10b-.../state \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...' \
  -H 'Content-Type: application/json' \
  -d '{ "state": "inactive" }'

Fires the identity.state_changed webhook event on success. See Custom Metadata for details.


Custom Metadata

GET  /v1/gate/identities/{id}/metadata
PATCH /v1/gate/identities/{id}/metadata

Read or merge-update the metadata_public JSON object attached to an identity. Pass null for a key to delete it.

See Custom Metadata for full documentation.


Session Management

GET    /v1/gate/identities/{id}/sessions
DELETE /v1/gate/identities/{id}/sessions
DELETE /v1/gate/sessions/{session_id}

List or revoke active sessions for an end-user. Tenant isolation is enforced — you can only manage sessions of identities that belong to your tenant.

See Session Management for the full reference including response format and integration examples.


Resend Verification Email

POST /v1/gate/identities/{id}/resend-verification

Triggers a new verification email for an unverified identity. The link is valid for the flow TTL configured in Kratos.

curl -X POST https://api.vernesoft.com/v1/gate/identities/f47ac10b-.../resend-verification \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...'

Auth Flows

Self-service flows for end-users. All flow endpoints return a Kratos flow object containing UI nodes your frontend renders. See Settings Flow for the full flow lifecycle.

EndpointMethodDescription
/v1/gate/auth/loginGETInitiate login flow
/v1/gate/auth/registrationGETInitiate registration flow
/v1/gate/auth/recoveryGETInitiate account recovery flow
/v1/gate/auth/recovery/submitPOSTSubmit recovery code
/v1/gate/auth/verificationGETInitiate email verification flow
/v1/gate/auth/verification/submitPOSTSubmit verification code
/v1/gate/auth/settingsGETInitiate settings flow (requires X-Session-Token)
/v1/gate/auth/settings/submitPOSTSubmit settings change (requires X-Session-Token)

The login and registration flows also accept an X-Return-To header for post-flow redirect.


Tenant Settings

OIDC Providers

GET  /v1/gate/settings/oidc-providers
PUT  /v1/gate/settings/oidc-providers

Read or replace the list of social login providers enabled for your tenant. See Social Auth for configuration details.


Security Settings

GET /v1/gate/settings/security
PUT /v1/gate/settings/security

Read or update per-tenant security feature flags.

FieldTypeDescription
passwordless_enabledbooleanEnable email OTP login
mfa_enabledbooleanEnable TOTP two-factor authentication
curl -X PUT https://api.vernesoft.com/v1/gate/settings/security \
  -H 'Authorization: Bearer vrn_gate_live_sk_9f8a7...' \
  -H 'Content-Type: application/json' \
  -d '{ "passwordless_enabled": true, "mfa_enabled": false }'

Webhooks

GET    /v1/gate/settings/webhooks
POST   /v1/gate/settings/webhooks
PATCH  /v1/gate/settings/webhooks/{id}
DELETE /v1/gate/settings/webhooks/{id}

Manage webhook endpoints that receive real-time identity event notifications. See Webhooks for the full reference including payload format and signature verification.


Tokens & Authorization

See Access & Authorization for the full token lifecycle reference.

EndpointMethodDescription
/v1/gate/tokensPOSTCreate a short-lived Gate access token
/v1/gate/tokens/introspectPOSTValidate and decode a Gate token
/v1/gate/authorizePOSTCheck if a subject is allowed to perform an action

Error Format

All errors use the same envelope:

{
  "error": "description of what went wrong"
}

Kratos flow errors return the full flow object with a populated ui.messages array — render these to guide the end-user.

HTTP StatusMeaning
400Bad request — invalid body or unsupported field value
403Forbidden — API key lacks the required scope, or identity belongs to a different tenant
404Not found — identity or webhook does not exist
422Unprocessable — Kratos flow validation failed (check ui.messages)
500Internal server error — contact support with the request timestamp