Browse API documentation
Implementation guidesv1

Application sessions

Create and retain a session for your applicant's upload and submission flow.

On this page

Start a session before uploading files or submitting a custom application. This authenticates your server's intake flow without requiring the applicant's browser to send a Karwa API secret.

Endpoint

POST /jobs/{job_id}/application-session?posting_id={posting_id} requires applications:write, your app key and secret, and no body.

bash
curl --fail-with-body -X POST \
  "$KARWA_API_BASE/jobs/$JOB_ID/application-session?posting_id=$POSTING_ID" \
  -H "X-Karwa-App-Key: $KARWA_APP_KEY" \
  -H "Authorization: Bearer $KARWA_SECRET_KEY"

Response

json
{"token":"<APPLICATION_TOKEN>","expires_at":"2026-11-06T09:20:00Z"}

Save the returned token in your server's applicant-flow state, associated with the chosen job and posting. Do not log it. The default session duration is 20 minutes; use expires_at because deployments can configure that duration.

What a session binds

The signed token is bound to your app credential, its secret version, company brand, public job ID, posting ID and originating server IP. Uploads and submissions recheck all these values and the posting's eligibility.

Send X-Karwa-Application-Token: <APPLICATION_TOKEN> with every file upload and application submission. Send both credential headers too. An application token does not replace your app key or secret.

Server infrastructure

Keep a consistent outbound IP during a flow. If your serverless workers use different egress IPs, route these calls through a stable egress or create a fresh session after a change. A fresh token must match the server that uploads or submits. The gateway replaces untrusted forwarding headers; do not try to set X-Forwarded-For as a workaround.

Browser Turnstile is not required on this authenticated endpoint. That does not relax the security checks on Karwa's unauthenticated hosted application flow.

Expiry and reset

A 401 can indicate an expired, tampered or mismatched session. Obtain a new session only after confirming your credential pair is valid. Secret reset invalidates developer sessions tied to the previous secret version, so start new ones after deploying the replacement secret.

Sessions are short-lived flow credentials, not one-use submission IDs. Retrying the same application with the same Idempotency-Key and a valid session returns the existing receipt. Do not create a different Idempotency-Key solely because the session expired.

A posting that becomes confidential or unavailable during the flow returns 404 even if your token has not expired. Show the applicant an appropriate message and stop submission.