Skip to main content

Setting up a person in HR using the REST API

How to update a person's settings in People via the REST API

Written by Petr Pech

The REST API provides two records for managing employees and their employment relationships — osoba (person), which holds the employee's personal details, and pracovni-pomer (employment), which holds the employment relationship linked to the person.

ℹ️ Alongside these, there are also "header" records osoba-hlavicka and pracovni-pomer-hlavicka. These hold the employee as a whole, while osoba and pracovni-pomer contain their individual time-limited settings.


Retrieving data

You can retrieve data about people using the GET method; standard filtering and detail levels can also be used:

GET https://demo.flexibee.eu/c/demo/osoba.xml
GET https://demo.flexibee.eu/c/demo/pracovni-pomer.json?detail=full


Setting versioning

Both records use versioning via the platiOd and platiDo properties. This means each employee and each employment relationship can have multiple setting versions with different validity periods. When importing with a new platiOd:

  1. the system finds the existing setting that overlaps with the new date,

  2. it automatically shortens the overlapping one — setting its platiDo to the day before the new platiOd,

  3. it creates a new setting version with values copied from the previous version,

  4. and applies the values from the import to the new version.

<winstrom version="1.0">
<osoba>
<osbCis>123</osbCis>
<platiOd>2026-07-01</platiOd>
<prijmeni>Novotná</prijmeni>
</osoba>
</winstrom>

This import creates a new setting version starting on 1 July 2026; the previous version will be automatically closed on 30 June 2026. The response contains the IDs of both the new and the shortened version.

📝 For people, the response often contains a number of warnings about unfilled legislative fields — for example osobaOicPrazdne or osobaNejvyssiVzdelaniK. These do not block the import; they merely indicate that the data will need to be completed.

Propagating to the future

The propsatDoBudoucna="true" attribute also applies the change made to all future versions of the setting. The system saves the change to the addressed setting, finds all settings with a later platiOd, and applies the same change to them:

<winstrom version="1.0">
<pracovni-pomer propsatDoBudoucna="true">
<idPpv>PP-001</idPpv>
<uvazHodDenne>6.0</uvazHodDenne>
</pracovni-pomer>
</winstrom>

Without this attribute, the change only takes effect in the addressed setting, and future versions remain unaffected. The following properties are never propagated:

  • for a person: platiOd, platiDo, and password,

  • for an employment relationship: platiOd and platiDo.


Sending data

To write data, use the POST or PUT method:

POST https://demo.flexibee.eu/c/demo/osoba.xml
<?xml version="1.0"?>
<winstrom version="1.0">
<osoba>
<platiOd>2021-07-01</platiOd>
<osbCis>PP123456</osbCis>
<prijmeni>Pavelka</prijmeni>
<jmeno>Pavel</jmeno>
<stredisko>code:C</stredisko>
</osoba>
</winstrom>

Identifying records

A person is searched for in the following order: internal ID (<id>123</id>), personnel number (<osbCis>1</osbCis>), birth number in normalized format (<rodCis>9002020005</rodCis>), the combination of rodCis + ecp, and finally the EČP (unique person code) itself.

An employment relationship is searched for as follows: internal ID, kodCsszPP + platiOd, idPpv + platiOd, idPpv + active contract (if platiOd is not provided), and finally the person together with kodCsszPP or idPpv.

The usual forms 123, code:ZKRATKA, ext:ID, and ext:SYSTEM:ID apply for identifying records. Dates are written in ISO 8601 format, with or without a time zone (2026-01-01+01:00).

Nested collections

Multi-word collection names use camelCase for the wrapper and hyphenated notation for the items:

Collection

Wrapper

Item

Person's bank accounts

bankovniSpojeni

mzdy-bankovni-spojeni

Person's employment relationships

pracovniPomery

pracovni-pomer

Children

deti

dite

Close persons

osobyBlizke

osoba-blizka

Deductions

srazky

srazka

Recurring wage components of the relationship

staleMzdoveSlozky

stala-mzdova-slozka

Absences

nepritomnosti

nepritomnost

praceProStrediska

prace-pro-stredisko

Complete import of a person with an employment relationship

An employment relationship nested in the pracovniPomery collection is automatically linked to the person, so everything can be sent in a single request:

<winstrom version="1.0">
<osoba>
<osbCis>1</osbCis>
<jmeno>Jan</jmeno>
<prijmeni>Novák</prijmeni>
<datNaroz>1990-05-15+01:00</datNaroz>
<rodCis>9005150001</rodCis>
<pohlaviK>pohlavi.muz</pohlaviK>
<zpusPlatbyK>zpusobPlatby.ucet</zpusPlatbyK>
<zdravPoj>code:201</zdravPoj>
<bankovniSpojeni>
<mzdy-bankovni-spojeni>
<buc>1234567890</buc>
<smerKod>code:0100</smerKod>
<primarni>true</primarni>
</mzdy-bankovni-spojeni>
</bankovniSpojeni>
<pracovniPomery>
<pracovni-pomer>
<idPpv>PP-001</idPpv>
<kod>PP-001</kod>
<nazev>Hlavní pracovní poměr</nazev>
<typPracPom>code:1-STANDARD</typPracPom>
<aktivniOd>2026-01-01+01:00</aktivniOd>
<zacatek>2026-01-01+01:00</zacatek>
<hlavni>true</hlavni>
<uvazHodDenne>8.0</uvazHodDenne>
<uvazDnuTydne>5</uvazDnuTydne>
<staleMzdoveSlozky>
<stala-mzdova-slozka>
<cisMzdSloz>code:MĚSÍČNÍ MZDA</cisMzdSloz>
<zaklMzd>45000</zaklMzd>
</stala-mzdova-slozka>
</staleMzdoveSlozky>
<nepritomnosti>
<nepritomnost>
<platiOd>2026-07-01+01:00</platiOd>
<platiDo>2026-07-14+01:00</platiDo>
<cisMzdSloz>code:DOVOLENÁ</cisMzdSloz>
</nepritomnost>
</nepritomnosti>
</pracovni-pomer>
</pracovniPomery>
</osoba>
</winstrom>

Deleting settings

Import can be used to add new settings with a specified start of validity and to delete selected settings — except for the last remaining one. The validity periods of the other settings are adjusted accordingly. To delete a setting, use the delete action:

<?xml version="1.0"?>
<winstrom version="1.0">
<osoba action="delete">
<id>1</id>
</osoba>
</winstrom>


What to watch out for

  • The kodELDP and kodCsszPP properties cannot be changed once the employment relationship has been saved.

  • platiOd should be the first day of the month — otherwise the system will display a warning.

  • When importing an employment relationship, the linked person must already exist.


Related

Did this answer your question?