ssm.ro Docs
API for Developers

Contacts

Endpoints for managing contacts (employees) in the ssm.ro platform: retrieval, creation, and modification.

The contacts endpoints allow you to sync employees from your HR system with the ssm.ro platform. A contact represents an employee enrolled in your organization.


Retrieve contact

GET /v1/contacts?organizatie={organizatie}&marca={marca}

Returns the data of a contact based on the badge number (the unique identifying key) and the organization name. The badge number is passed as a query parameter, so badge numbers containing URL-unsafe characters are accepted too, as long as the value is encoded with encodeURIComponent().

Example request:

GET /v1/contacts?organizatie=demo-organization&marca=M00212

Parameters

ParameterInTypeRequiredDescription
organizatiequerystringYesOrganization name
marcaquerystringYesBadge number — the unique identifying key for the employee

Responses

CodeDescription
200 OKEmployee object
404 Not Found{ "error": "Contactul nu a fost gasit" } — the badge number does not exist
422 Unprocessable Entity{ "error": "Marca este obligatorie" } — the marca parameter is missing or empty
500 Server ErrorInternal server error

Legacy route GET /v1/contacts/{id} — deprecated

Deprecated as of September 2026

The route that takes the badge number in the URL path (GET /v1/contacts/{id}) is deprecated, because badge numbers containing URL-unsafe characters cannot be passed correctly through a path segment. Use GET /v1/contacts?marca=, with the badge number encoded via encodeURIComponent(). The legacy route still works, but is no longer maintained.


Create new contact

POST /v1/contacts

Creates a new contact in the organization. If the badge number already exists, the operation will fail.

Request body

Content-Type: application/jsonEmployee object.

Example:

{
  "nume": "Ion",
  "prenume": "Popescu",
  "email": "ion.popescu@exemplu.ro",
  "departament": "Finanțe",
  "codDepartament": "D163",
  "cor": "Referent bancar",
  "post": "Tesa",
  "marca": "M00212",
  "marcaSuperior": "M00132",
  "adresa": "Str. Soarelui nr. 2",
  "localitate": "Brașov",
  "judet": "Brașov",
  "dataNasterii": "1981-08-24",
  "locatieFizica": "Office 101",
  "status": "activ",
  "organizatie": "demo-organization",
  "echipaPSI": "Nu",
  "telefon": "+40722333444",
  "cnp": "1800101221144",
  "limba": "ro",
  "calificare": "Inginer",
  "cetatenie": "Romana",
  "nationalitate": "Romania",
  "dataIncepereActivitate": "2020-01-15"
}

Responses

CodeDescription
200 OKThe contact was created — returns the Employee object
404 Not FoundOrganization not found
422 Unprocessable EntityInvalid data — JSON response with error details
500 Server ErrorInternal server error

Update existing contact

PATCH /v1/contacts/update

Updates the data of an existing contact, identified by the marca field. Only the fields sent in the body will be updated.

Request body

Content-Type: application/json — full Employee object. The marca and organizatie fields are required for identification.

Example:

{
  "nume": "Ion",
  "prenume": "Popescu",
  "email": "ion.popescu@exemplu.ro",
  "departament": "Finanțe",
  "codDepartament": "D163",
  "cor": "Referent bancar",
  "post": "Tesa",
  "marca": "M00212",
  "marcaSuperior": "M00132",
  "marcaSuperior2": "M0081",
  "marcaInlocuitor": "M00301",
  "adresa": "Str. Soarelui nr. 2",
  "localitate": "Brașov",
  "judet": "Brașov",
  "dataNasterii": "1981-08-24",
  "locatieFizica": "Office 101",
  "status": "activ",
  "organizatie": "demo-organization",
  "echipaPSI": "Nu",
  "telefon": "+40722333444",
  "cnp": "1800101221144",
  "limba": "ro",
  "calificare": "Inginer",
  "cetatenie": "Romana",
  "nationalitate": "Romania",
  "dataIncepereActivitate": "2020-01-15"
}

Responses

CodeDescription
200 OKThe contact was updated — returns the Employee object
204 No ContentNo changes made — the submitted data is identical to the existing data
404 Not FoundContact not found
422 Unprocessable EntityInvalid data — JSON response with error details
500 Server ErrorInternal server error

Optional field behavior

All fields except marca and organizatie are optional. On PATCH, only the fields sent in the body are updated; a field that is absent or empty ("", null) is ignored — the existing value remains unchanged. In particular, a PATCH without status does not suspend the employee, and a POST without status creates the employee with activ status.

The department is identified by codDepartament. If you send the same codDepartament with a different departament value, the department name is updated (renamed) — a new department is not created. This way, a rename in HR propagates to the platform as long as the code stays the same.

New field validations (422 Unprocessable Entity)

SituationCodeExplanation
cnp already used by another employee422The CNP must be unique within the organization
cnp with incorrect format422Invalid CNP (valid format: 13 digits)
limba outside the accepted values422Only ro, en are allowed
dataIncepereActivitate with invalid dateignoredAn unparseable date is treated as empty (no error)
telefon too short (fewer than 9 digits)ignoredThe number is normalized automatically; values that are too short are ignored (no error)