Client API integration

After purchasing a subscription, users can: upload documents in Upload, view and edit parsed documents (Parsed file), assign EER codes, export tables (parsed, history, validated), send data to History by assigning it to a customer, use Validate/HP Finder and HP Finder functions. This documentation lists the endpoints needed to integrate your software with HSE Genius.

Base URL and authentication

API base URL:

https://kaimakicloud.hsegenius.com/api

Interactive docs (Swagger): /api/docs/

Requests must include the JWT header:

Authorization: Bearer <access_token>

Login (obtain token)

POST /api/user/token/

Body: {"email": "user@example.com", "password": "***"}

Response: {"access": "<JWT>", "refresh": "<refresh_token>"}. Use access in the header Authorization: Bearer <access>.

POST /api/user/token/refresh/

Body: {"refresh": "<refresh_token>"}. Returns a new access when the token has expired.

Profile, password reset and account activation are under /api/user/ (see Swagger). For integration, token and refresh are sufficient.

File upload

PDF file upload and confirmation to start processing. All endpoints under /api/files/.

GET /api/files/upload/

List uploaded documents (status uploaded) for the authenticated user.

POST /api/files/upload/

Body: multipart/form-data — fields pdf (file), title (optional), eer_codes (optional, comma-separated).

Response: created document data (e.g. id, filename).

POST /api/files/upload/confirm/

Confirm uploaded files and start processing (async task). Requires an active subscription.

Response: task_id, message: "Processing started!".

DELETE /api/files/upload/{id}/

Delete an uploaded document.

POST /api/files/upload/{id}/eer/

Add one or more EER codes to the document. Body: {"eer_codes": "code1,code2"}.

DELETE /api/files/upload/{id}/eer/{eer_code}/

Remove an EER code from the document.

POST /api/files/upload/eer/

Add one EER code to all documents currently in upload. Body: {"eer_code": "..."}.

Parsed file (parsed data)

Documents after processing (status confirmed): list, search, edit, assign EER, send to History with customer, validate to HP Finder. Endpoints under /api/files/imported/.

GET /api/files/imported/

List parsed records. Query: eer_codes (filter). Additional filters via filterset (see Swagger).

GET /api/files/imported/{id}/

Single parsed record details.

PATCH /api/files/imported/{id}/

Update record data (e.g. product name, composition, item fields). Body: fields to update (partial). See Swagger for schemas.

POST /api/files/imported/{id}/eer/{eer_code}/

Add an EER code to the document linked to the parsed record.

DELETE /api/files/imported/{id}/eer/{eer_code}/

Remove an EER code from the record's document.

POST /api/files/imported/validate-constraint/

Check if selected records can be validated (e.g. EER already in HP Finder). Body: filters as in list.

POST /api/files/imported/validate/

Move records from Parsed to Validated (HP Finder). Body: filters to select records. Requires EER assigned.

POST /api/files/imported/history/

Assign records to a customer and send to History. Body: customer (customer id), filters, remove_from_parsed (true to move to history and remove from parsed).

GET /api/files/imported/export/

Export parsed file table to Excel (with filters). Query: language (optional).

Validated / HP Finder

Validated data (after validate from Parsed): list, export table, mark as processed and move to History.

GET /api/files/hp-finder/

List validated records. Query: eer_codes (EER filter).

POST /api/files/hp-finder/proceed/

Mark records as processed and move to history. Required query: eer_codes. Optional body: language (e.g. en).

POST /api/files/hp-finder/export/

Export validated filtered data to Excel. Query: eer_codes (required), language (optional, default en). Response: Excel file as attachment.

HP Finder (H/P codes)

List of Hazard/Process codes used for search and HP Finder functions.

GET /api/files/hp/

List of all HP ordered by h_punto. Paginated response.

History

Document history (company-wide: all company users).

GET /api/files/archive/

List documents in history. Filters via filterset (see Swagger for fields).

GET /api/files/archive/export/

Export filtered history to Excel. Query: language (optional). Response: Excel file as attachment.

DELETE /api/files/archive/{id}/

Delete a record from history.

Export

Excel export from parsed data, validated data and history.

GET /api/files/imported/export/

Export parsed data (status confirmed) to Excel. Query: language (optional). Response: Excel attachment.

GET /api/files/archive/export/

Export history to Excel. Query: language. Response: Excel attachment.

POST /api/files/hp-finder/export/

Export validated data to Excel. Query: eer_codes, language. Body: filters (see Swagger). Response: Excel attachment.

EER codes

List of available EER codes (for upload, filters and validation). Under /api/eer/.

GET /api/eer/eer/

List EER codes. Useful for dropdowns when assigning EER to documents or filtering parsed/validated.

Customers

Company customers: for assigning documents sent to History. Under /api/customer/.

GET /api/customer/

List company customers. Use the id in the body of POST /api/files/imported/history/ (field customer).

Users

Company user management (company admin only). Under /api/company/.

GET /api/company/user/

List users in the authenticated user's company.

POST /api/company/user/

Body (e.g.): {"email": "...", "name": "...", "role": "..."}. Create or invite user.

GET /api/company/user/{id}/

Single user details.

PATCH /api/company/user/{id}/

Update user (e.g. role).

DELETE /api/company/user/{id}/

Remove user from company.

Subscription

Active company subscription details.

GET /api/payment/subscription/

Returns the company's active subscription (plan, limits, status). 404 if no active subscription.