Skip to main content
Regenerates a pre-authentication code for an existing application. This allows partners to issue fresh direct-access links without creating a new application — useful when a user leaves the form and returns later via the partner platform.
POST /api/external/applications/{id}/pre-auth

Authentication

Requires an API key with applications:create scope.
Authorization: Bearer klara_{client_id}.{secret}

Path parameters

id
string
required
The application ID (UUID) returned by Create Application.

Response

Returns 201 Created on success.
pre_auth_code
string
The newly generated pre-authentication code. Expires 72 hours after creation.
Full URL with the new pre-auth code embedded. Redirect the user here to bypass email verification.
expires_at
string
ISO 8601 timestamp for when the pre-auth code expires.
participant_id
string
UUID of the primary participant the code was issued for.
already_verified
boolean
true if the participant has already verified their email. In this case the pre-auth code still works, but verification would not have been required anyway.

Examples

curl -X POST https://app.klara-ai.com/api/external/applications/550e8400-e29b-41d4-a716-446655440000/pre-auth \
  -H "Authorization: Bearer klara_abc123def456.your-secret-here"
Response:
{
  "pre_auth_code": "R4T8W2X6Y9Z1A3B5",
  "link": "https://app.klara-ai.com/external/acme-corp/apply/7f3k9m2p4q8r1s5t?auth_code=R4T8W2X6Y9Z1A3B5",
  "expires_at": "2026-03-05T14:30:00.000Z",
  "participant_id": "660e8400-e29b-41d4-a716-446655440001",
  "already_verified": false
}
This endpoint is designed for the re-entry flow: a user starts an application, leaves the form, and later returns via the partner platform. Instead of creating a duplicate application, call this endpoint to get a fresh pre-auth link for the same application.
The already_verified field indicates whether the participant has already completed email verification. If true, the pre-auth code is still valid but redundant — the user would not be prompted for verification regardless.

Errors

{
  "error": "Application not found"
}
ErrorCause
Application not foundThe application ID does not exist or belongs to a different organization
Application is in a terminal status and pre-auth is no longer applicableThe application has been completed, cancelled, or is otherwise no longer active
No primary participant found for this applicationThe application has no primary participant (should not occur in normal usage)
Invalid API keyAPI key is invalid, expired, or inactive
Missing API keyNo Authorization header provided
Internal server errorAn unexpected error occurred on the server