API Endpoints
Complete reference of all KSeF API Gateway endpoints organized by domain.
| Environment | API | Auth |
|---|
| Demo | https://demo.ksefapi.com | https://demo-auth.ksefapi.com |
| Production | https://gateway.ksefapi.com | https://auth.ksefapi.com |
All endpoints require Authorization: Bearer {jwt_token} unless noted otherwise.
| Method | Endpoint | Auth | Description |
|---|
GET | / | ❌ | API info |
GET | /health | ❌ | Health check |
GET | /api/rate-limits | ✅ | Current rate limits |
| Method | Endpoint | Description |
|---|
POST | /api/auth/login | User login (password grant) |
POST | /api/auth/refresh | Refresh token |
GET | /api/auth/me | Current user info |
GET | /api/auth/urls | OAuth2 redirect URLs |
GET | /api/auth/login-url | Redirect to login |
GET | /api/auth/register-url | Redirect to registration |
GET | /api/auth/callback | OAuth2 callback |
POST | /api/auth/logout | Logout |
GET | /api/auth/sessions | List auth sessions |
DELETE | /api/auth/sessions/current | Revoke current session |
DELETE | /api/auth/sessions/{ref} | Revoke by reference |
GET | /api/auth/{ref} | Check auth status |
| Method | Endpoint | Description |
|---|
POST | /api/companies | Register company |
GET | /api/companies | List companies |
GET | /api/companies/{id} | Get company |
PUT | /api/companies/{id} | Update company |
DELETE | /api/companies/{id} | Soft delete |
| Method | Endpoint | Description |
|---|
POST | /api/companies/{id}/credentials/token | Add KSeF token |
POST | /api/companies/{id}/credentials | Add certificate (PEM) |
GET | /api/companies/{id}/credentials | List credentials |
GET | /api/companies/{id}/credentials/active/{type} | Get active by type |
GET | /api/companies/{id}/credentials/{cred_id} | Detail + preview |
PATCH | /api/companies/{id}/credentials/{cred_id} | Update/revoke |
DELETE | /api/companies/{id}/credentials/{cred_id} | Delete |
| Method | Endpoint | Description |
|---|
POST | /api/companies/{id}/ksef-tokens | Generate new token |
GET | /api/companies/{id}/ksef-tokens | List tokens |
GET | /api/companies/{id}/ksef-tokens/{ref} | Token status |
DELETE | /api/companies/{id}/ksef-tokens/{ref} | Revoke token |
| Method | Endpoint | Description |
|---|
POST | /api/companies/{id}/certificates/enroll | Start enrollment |
GET | /api/companies/{id}/certificates/enroll/{ref}/status | Enrollment status |
POST | /api/companies/{id}/certificates/enrollments | Low-level enrollment |
GET | /api/companies/{id}/certificates/enrollments/data | Enrollment data |
GET | /api/companies/{id}/certificates/enrollments/{ref} | Enrollment status |
GET | /api/companies/{id}/certificates/limits | Enrollment limits |
POST | /api/companies/{id}/certificates/query | Query certificates |
POST | /api/companies/{id}/certificates/retrieve | Retrieve certificate |
POST | /api/companies/{id}/certificates/{serial}/revoke | Revoke certificate |
GET | /api/companies/{id}/certificates | List stored certificates |
| Method | Endpoint | Description |
|---|
POST | /api/sessions/ | Create session |
GET | /api/sessions/ | List sessions |
GET | /api/sessions/{session_id} | Get by ID |
GET | /api/sessions/{session_id}/status | Status + time remaining |
GET | /api/sessions/company/{id}/active | Get active session |
POST | /api/sessions/online/{ref}/close | Close interactive |
POST | /api/sessions/batch/{ref}/close | Close batch |
POST | /api/sessions/terminate | Terminate by ID |
| Method | Endpoint | Description |
|---|
POST | /api/companies/{id}/ksef/authenticate | Token-based auth |
POST | /api/companies/{id}/ksef/auth/challenge | Get XAdES challenge |
POST | /api/companies/{id}/ksef/auth/xades | Submit signed XAdES |
GET | /api/companies/{id}/ksef/access-token | Raw KSeF token |
GET | /api/companies/{id}/ksef/token-info | Token info |
POST | /api/companies/{id}/ksef/refresh-token | Refresh KSeF token |
DELETE | /api/companies/{id}/ksef/invalidate-tokens | Invalidate all |
POST | /api/companies/{id}/ksef/terminate-session | Close session |
POST | /api/companies/{id}/ksef/terminate-all-sessions | Close all |
| Method | Endpoint | Description |
|---|
POST | /api/companies/{id}/invoices/submit-sync | Submit JSON (sync) |
POST | /api/companies/{id}/invoices/submit-async | Submit JSON (async) |
POST | /api/companies/{id}/invoices/submit-raw-xml | Submit raw XML |
GET | /api/companies/{id}/invoices | List invoices |
GET | /api/companies/{id}/invoices/{inv_id} | Get invoice |
| Method | Endpoint | Description |
|---|
GET | /api/companies/{id}/invoices/{inv_id}/status | Invoice status |
POST | /api/companies/{id}/invoices/{inv_id}/poll-status | Poll KSeF (sync) |
POST | /api/companies/{id}/invoices/{inv_id}/poll-status-async | Poll (async) |
POST | /api/companies/{id}/invoices/bulk-poll-status | Bulk poll |
GET | /api/companies/{id}/invoices/{inv_id}/upo | Download UPO |
GET | /api/invoice-status/upo/{ksef_ref} | UPO by KSeF reference |
GET | /api/companies/{id}/invoices/{inv_id}/qr | QR code (PNG) |
GET | /api/companies/{id}/invoices/{inv_id}/qr-data | QR code data |
GET | /api/companies/{id}/invoices/{inv_id}/verification-url | Verification URL |
| Method | Endpoint | Description |
|---|
POST | /api/companies/{id}/batch | Create batch |
GET | /api/companies/{id}/batch | List batches |
GET | /api/companies/{id}/batch/{batch_id} | Batch details |
POST | /api/companies/{id}/batch/{batch_id}/submit | Submit batch |
GET | /api/companies/{id}/batch/{batch_id}/status | Batch status |
| Method | Endpoint | Description |
|---|
GET | /api/sessions/{ref}/invoices | Invoices in session |
GET | /api/sessions/{ref}/invoices/failed | Failed invoices |
GET | /api/sessions/{ref}/invoices/ksef/{ksef_ref}/upo | Invoice UPO |
GET | /api/sessions/{ref}/upo/{upo_ref} | Session collective UPO |
| Method | Endpoint | Description |
|---|
GET | /api/companies/{id}/ksef/limits/context | Context limits |
GET | /api/companies/{id}/ksef/limits/subject | Subject limits |
| Method | Endpoint | Description |
|---|
GET | /api/public-keys | List MF public keys |
GET | /api/public-keys/active | Active encryption key |
POST | /api/public-keys/clear-cache | Force refresh |
| Method | Endpoint | Description |
|---|
POST | /api/webhooks/endpoints | Register endpoint |
GET | /api/webhooks/endpoints | List endpoints |
GET | /api/webhooks/endpoints/{id} | Endpoint details |
PATCH | /api/webhooks/endpoints/{id} | Update |
DELETE | /api/webhooks/endpoints/{id} | Delete |
POST | /api/webhooks/endpoints/{id}/test | Send test ping |
GET | /api/webhooks/endpoints/{id}/deliveries | Delivery history |
POST | /api/webhooks/integrations | Create integration |
GET | /api/webhooks/integrations | List integrations |
PATCH | /api/webhooks/integrations/{id} | Update |
DELETE | /api/webhooks/integrations/{id} | Delete |
POST | /api/webhooks/integrations/{id}/rotate-key | Rotate API key |
GET | /api/webhooks/stats | Dashboard stats |
GET | /api/webhooks/deliveries | Delivery log |
Interactive API documentation with schemas and try-it-out: