Browse API documentation
API REFERENCEv1

Upload a file

Upload raw résumé or attachment bytes for a specific form question.

On this page
POST/api/auth/public/v1/jobs/{job_id}/application-files/{question_id}

Requires applications:write. Only your company's eligible public postings are accessible. Read the implementation guide →

How to use this endpoint

Read the form to identify each file question, create a session and then upload one file per call. Store the returned token as answers[question_id] in your submission. Uploads do not use an Idempotency-Key. If a timeout leaves you without a token, upload again and retain the latest successful token. Keep tokens separate by applicant; a token from another company, job or question is not interchangeable.

Authentication

Send both headers from your server. An app key or application token alone does not authorize a request.

http
X-Karwa-App-Key: <APP_KEY>
Authorization: Bearer <SECRET_KEY>

Parameters

Path parameters

job_idstringRequired

The public job ID from a jobs response. Internal numeric IDs cannot be used.

question_idstringRequired

The exact ID of a file or résumé question in the current application form.

Query parameters

posting_idstring or nullOptional

The selected posting ID. Pass the same value throughout detail, form, session, upload and submission. Omission selects the default eligible posting.

filenamestringOptional

Original filename including extension. URL-encode it in the upload query. Content must match a supported file type. Default: "upload". Maximum length: 255.

Header parameters

X-Karwa-Application-Tokenstring or nullRequired

Token returned by application-session. Bound to this credential version, server IP, brand, job and posting.

Request body

Send raw file bytes, up to 10,485,760 bytes. Do not use multipart, base64 or JSON. Résumés support PDF, DOCX and UTF-8 TXT. General file questions also support PNG, JPG and JPEG. Set Content-Type to match the file; Karwa validates its actual content and extension.

Request example

Set KARWA_API_BASE to your HTTPS gateway origin followed by /api/auth/public/v1. Local development uses http://localhost:8000/api/auth/public/v1. Replace job, posting, question and token values where shown.

bash
curl --fail-with-body -X POST "$KARWA_API_BASE/jobs/$JOB_ID/application-files/$QUESTION_ID?posting_id=$POSTING_ID&filename=cv.pdf" \
  -H "X-Karwa-App-Key: $KARWA_APP_KEY" \
  -H "Authorization: Bearer $KARWA_SECRET_KEY" \
  -H "X-Karwa-Application-Token: $APPLICATION_TOKEN" \
  -H "Content-Type: application/pdf" \
  --data-binary @cv.pdf

Response

201 · application/json · Successful Response

tokenstringRequired
Sensitive flow token. Store it in your server's applicant-flow state and redact it from logs.
filenamestringRequired
Original filename including extension. URL-encode it in the upload query. Content must match a supported file type.
content_typestringRequired
Validated media type of the stored file, such as application/pdf.
size_bytesintegerRequired
Actual uploaded file size in bytes.
json · example response
{
  "token": "<UPLOAD_TOKEN>",
  "filename": "cv.pdf",
  "content_type": "application/pdf",
  "size_bytes": 12345
}

Errors and recovery

401
Invalid credential or application session
403
Missing permission, scope or plan access
404
Posting unavailable
413
Request exceeds upload or JSON size limit
422
Validation Error
429
Rate limited; observe Retry-After
503
Temporary service failure
json · example error response
{
  "detail": "Invalid API key"
}

Inspect the HTTP status before using the body. Validation detail can be a string or an array. For submission timeouts, retain the same Idempotency-Key. For 429 responses, wait for Retry-After. See error handling and quotas →