My App

API Endpoints

Complete reference of all KSeF API Gateway endpoints organized by domain.

Base URLs

EnvironmentAPIAuth
Demohttps://demo.ksefapi.comhttps://demo-auth.ksefapi.com
Productionhttps://gateway.ksefapi.comhttps://auth.ksefapi.com

All endpoints require Authorization: Bearer {jwt_token} unless noted otherwise.


Health & Info

MethodEndpointAuthDescription
GET/❌API info
GET/health❌Health check
GET/api/rate-limits✅Current rate limits

Authentication

MethodEndpointDescription
POST/api/auth/loginUser login (password grant)
POST/api/auth/refreshRefresh token
GET/api/auth/meCurrent user info
GET/api/auth/urlsOAuth2 redirect URLs
GET/api/auth/login-urlRedirect to login
GET/api/auth/register-urlRedirect to registration
GET/api/auth/callbackOAuth2 callback
POST/api/auth/logoutLogout
GET/api/auth/sessionsList auth sessions
DELETE/api/auth/sessions/currentRevoke current session
DELETE/api/auth/sessions/{ref}Revoke by reference
GET/api/auth/{ref}Check auth status

Companies

MethodEndpointDescription
POST/api/companiesRegister company
GET/api/companiesList companies
GET/api/companies/{id}Get company
PUT/api/companies/{id}Update company
DELETE/api/companies/{id}Soft delete

Credentials

MethodEndpointDescription
POST/api/companies/{id}/credentials/tokenAdd KSeF token
POST/api/companies/{id}/credentialsAdd certificate (PEM)
GET/api/companies/{id}/credentialsList 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

KSeF Tokens

MethodEndpointDescription
POST/api/companies/{id}/ksef-tokensGenerate new token
GET/api/companies/{id}/ksef-tokensList tokens
GET/api/companies/{id}/ksef-tokens/{ref}Token status
DELETE/api/companies/{id}/ksef-tokens/{ref}Revoke token

Certificates

MethodEndpointDescription
POST/api/companies/{id}/certificates/enrollStart enrollment
GET/api/companies/{id}/certificates/enroll/{ref}/statusEnrollment status
POST/api/companies/{id}/certificates/enrollmentsLow-level enrollment
GET/api/companies/{id}/certificates/enrollments/dataEnrollment data
GET/api/companies/{id}/certificates/enrollments/{ref}Enrollment status
GET/api/companies/{id}/certificates/limitsEnrollment limits
POST/api/companies/{id}/certificates/queryQuery certificates
POST/api/companies/{id}/certificates/retrieveRetrieve certificate
POST/api/companies/{id}/certificates/{serial}/revokeRevoke certificate
GET/api/companies/{id}/certificatesList stored certificates

Sessions

MethodEndpointDescription
POST/api/sessions/Create session
GET/api/sessions/List sessions
GET/api/sessions/{session_id}Get by ID
GET/api/sessions/{session_id}/statusStatus + time remaining
GET/api/sessions/company/{id}/activeGet active session
POST/api/sessions/online/{ref}/closeClose interactive
POST/api/sessions/batch/{ref}/closeClose batch
POST/api/sessions/terminateTerminate by ID

KSeF Authentication

MethodEndpointDescription
POST/api/companies/{id}/ksef/authenticateToken-based auth
POST/api/companies/{id}/ksef/auth/challengeGet XAdES challenge
POST/api/companies/{id}/ksef/auth/xadesSubmit signed XAdES
GET/api/companies/{id}/ksef/access-tokenRaw KSeF token
GET/api/companies/{id}/ksef/token-infoToken info
POST/api/companies/{id}/ksef/refresh-tokenRefresh KSeF token
DELETE/api/companies/{id}/ksef/invalidate-tokensInvalidate all
POST/api/companies/{id}/ksef/terminate-sessionClose session
POST/api/companies/{id}/ksef/terminate-all-sessionsClose all

Invoice Submission

MethodEndpointDescription
POST/api/companies/{id}/invoices/submit-syncSubmit JSON (sync)
POST/api/companies/{id}/invoices/submit-asyncSubmit JSON (async)
POST/api/companies/{id}/invoices/submit-raw-xmlSubmit raw XML
GET/api/companies/{id}/invoicesList invoices
GET/api/companies/{id}/invoices/{inv_id}Get invoice

Invoice Status & UPO

MethodEndpointDescription
GET/api/companies/{id}/invoices/{inv_id}/statusInvoice status
POST/api/companies/{id}/invoices/{inv_id}/poll-statusPoll KSeF (sync)
POST/api/companies/{id}/invoices/{inv_id}/poll-status-asyncPoll (async)
POST/api/companies/{id}/invoices/bulk-poll-statusBulk poll
GET/api/companies/{id}/invoices/{inv_id}/upoDownload UPO
GET/api/invoice-status/upo/{ksef_ref}UPO by KSeF reference
GET/api/companies/{id}/invoices/{inv_id}/qrQR code (PNG)
GET/api/companies/{id}/invoices/{inv_id}/qr-dataQR code data
GET/api/companies/{id}/invoices/{inv_id}/verification-urlVerification URL

Batch Operations

MethodEndpointDescription
POST/api/companies/{id}/batchCreate batch
GET/api/companies/{id}/batchList batches
GET/api/companies/{id}/batch/{batch_id}Batch details
POST/api/companies/{id}/batch/{batch_id}/submitSubmit batch
GET/api/companies/{id}/batch/{batch_id}/statusBatch status

Session Invoices

MethodEndpointDescription
GET/api/sessions/{ref}/invoicesInvoices in session
GET/api/sessions/{ref}/invoices/failedFailed invoices
GET/api/sessions/{ref}/invoices/ksef/{ksef_ref}/upoInvoice UPO
GET/api/sessions/{ref}/upo/{upo_ref}Session collective UPO

KSeF Limits

MethodEndpointDescription
GET/api/companies/{id}/ksef/limits/contextContext limits
GET/api/companies/{id}/ksef/limits/subjectSubject limits

MF Public Keys

MethodEndpointDescription
GET/api/public-keysList MF public keys
GET/api/public-keys/activeActive encryption key
POST/api/public-keys/clear-cacheForce refresh

Webhooks

MethodEndpointDescription
POST/api/webhooks/endpointsRegister endpoint
GET/api/webhooks/endpointsList 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}/testSend test ping
GET/api/webhooks/endpoints/{id}/deliveriesDelivery history
POST/api/webhooks/integrationsCreate integration
GET/api/webhooks/integrationsList integrations
PATCH/api/webhooks/integrations/{id}Update
DELETE/api/webhooks/integrations/{id}Delete
POST/api/webhooks/integrations/{id}/rotate-keyRotate API key
GET/api/webhooks/statsDashboard stats
GET/api/webhooks/deliveriesDelivery log

OpenAPI Specification

Interactive API documentation with schemas and try-it-out:

On this page