> ## Documentation Index
> Fetch the complete documentation index at: https://slovakapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get entity detail

> Returns the full record for the entity with the given `id`.

## Parameters

By default the response includes only current field values.

| Parameter                    | When present                                |
| ---------------------------- | ------------------------------------------- |
| `showHistoricalData=true`    | Includes past entries for all timed fields. |
| `showOrganizationUnits=true` | Includes the entity's organisational units. |

<Warning>
  Only the literal string `true` is accepted — `1`, `yes`, and other truthy values silently evaluate to false.
</Warning>

## Working with timed fields

Most array fields are time-scoped — the current value is always the entry with no `validTo`.

```js theme={null}
// Current name
const name = entity.fullNames.find(e => !e.validTo)?.value;

// Current address
const address = entity.addresses.find(a => !a.validTo);
console.log(address?.formatedAddress);
```

## Common patterns

<AccordionGroup>
  <Accordion title="Fetch a basic entity record">
    Returns current field values only.

    ```bash theme={null}
    GET /entity/12345678
    ```
  </Accordion>

  <Accordion title="Fetch with full history">
    Includes all historical entries for timed fields — past names, addresses, legal forms, and more.

    ```bash theme={null}
    GET /entity/12345678?showHistoricalData=true
    ```
  </Accordion>

  <Accordion title="Fetch with organisational units">
    ```bash theme={null}
    GET /entity/12345678?showOrganizationUnits=true
    ```
  </Accordion>

  <Accordion title="Check if an entity is active">
    `termination` is absent when the entity is still active — null fields are omitted from the response entirely.

    ```js theme={null}
    const isActive = entity.termination == null;
    ```
  </Accordion>

  <Accordion title="Get the current legal form">
    Legal form is a `TimedCodeValueEntry` — find the current entry, then read the label from `.value.value`.

    ```js theme={null}
    const form = entity.legalForms.find(f => !f.validTo);
    console.log(form?.value.value); // "spoločnosť s ručením obmedzeným"
    console.log(form?.value.code);  // "112"
    ```
  </Accordion>

  <Accordion title="List current statutory bodies">
    ```js theme={null}
    const current = entity.statutoryBodies.filter(b => !b.validTo);

    current.forEach(b => {
      const name = b.personName?.formatedName ?? b.fullName;
      console.log(name);
    });
    ```
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml rpo/openapi.json GET /entity/{id}
openapi: 3.1.0
info:
  title: RPO API
  description: >-
    Public REST API for Slovakia's central register of legal entities,
    entrepreneurs, and public authorities. Administered by the Statistical
    Office of the Slovak Republic (ŠÚ SR).
  version: 1.0.0
  license:
    name: Creative Commons Attribution 4.0 (CC BY 4.0)
    url: https://creativecommons.org/licenses/by/4.0/legalcode
servers:
  - url: https://api.statistics.sk/rpo/v1
    description: Production
security: []
paths:
  /entity/{id}:
    get:
      summary: Get entity detail
      description: Returns the full record for the entity with the given `id`.
      operationId: getEntityDetail
      parameters:
        - name: id
          in: path
          required: true
          description: Unique entity identifier — obtained from a search result.
          schema:
            type: integer
            format: int64
        - name: showHistoricalData
          in: query
          description: >-
            When `true`, includes historical entries for all timed fields —
            entries where `validTo` is set.
          schema:
            type: boolean
        - name: showOrganizationUnits
          in: query
          description: >-
            When `true`, includes the entity's organisational units in the
            response.
          schema:
            type: boolean
      responses:
        '200':
          description: Full entity record returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailResponse'
        '404':
          description: No entity found with the given `id`.
components:
  schemas:
    DetailResponse:
      type: object
      description: Full entity record as returned by the detail endpoint.
      properties:
        id:
          type: integer
          format: int64
          description: Unique entity identifier.
        dbModificationDate:
          type: string
          format: date
          description: >-
            Date this record was last updated in the database. Format:
            `YYYY-MM-DD`. Note: data refreshes nightly — recent changes may lag
            up to 24 hours.
        identifiers:
          type: array
          description: IČO history. The current IČO is the entry with no `validTo`.
          items:
            $ref: '#/components/schemas/TimedValueEntry'
        fullNames:
          type: array
          description: >-
            Registered name history. The current name is the entry with no
            `validTo`.
          items:
            $ref: '#/components/schemas/TimedValueEntry'
        alternativeNames:
          type: array
          description: Alternative name history.
          items:
            $ref: '#/components/schemas/TimedValueEntry'
        addresses:
          type: array
          description: >-
            Registered address history. The current address is the entry with no
            `validTo`.
          items:
            $ref: '#/components/schemas/Address'
        legalForms:
          type: array
          description: Legal form history from codelist CL000056.
          items:
            $ref: '#/components/schemas/TimedCodeValueEntry'
        establishment:
          type: string
          format: date
          description: Date the entity was established.
        termination:
          type: string
          format: date
          nullable: true
          description: Date the entity was dissolved. Absent if still active.
        activities:
          type: array
          description: >-
            Registered economic activities. Each activity can be active,
            suspended, or deregistered independently.
          items:
            $ref: '#/components/schemas/Activity'
        statutoryBodies:
          type: array
          description: Persons or organisations authorised to act on behalf of the entity.
          items:
            $ref: '#/components/schemas/StatutoryBody'
        stakeholders:
          type: array
          description: >-
            Persons or organisations with a formal relationship to the entity —
            shareholders, partners, members, and similar.
          items:
            $ref: '#/components/schemas/Stakeholder'
        legalStatuses:
          type: array
          description: Legal status history from codelist CL010108.
          items:
            $ref: '#/components/schemas/TimedCodeValueEntry'
        otherLegalFacts:
          type: array
          description: Other legal facts recorded against the entity.
        authorizations:
          type: array
          description: Authorisations to act on behalf of the entity.
        equities:
          type: object
          description: Share capital information including shares and deposits.
          properties:
            shares:
              description: Share details.
            deposits:
              description: Deposit details.
        sourceRegister:
          type: object
          description: >-
            The source register this entity's data is drawn from, from codelist
            CL010112.
        predecessors:
          type: array
          description: Legal predecessors of this entity.
        successors:
          type: array
          description: Legal successors of this entity.
        statisticalCodes:
          type: object
          description: >-
            Statistical classification codes including economic activity
            (CL005205) and ESA 2010 sub-sector (CL010010).
        organizationUnits:
          type: array
          description: >-
            Organisational units (branches). Only included when
            `showOrganizationUnits=true`.
        license:
          type: string
          description: License statement for this data.
    TimedValueEntry:
      type: object
      description: >-
        A string value scoped to a validity window. The current value is always
        the entry with no `validTo`.
      properties:
        value:
          type: string
          description: The value for this time period.
        validFrom:
          type: string
          format: date
          description: Start of validity. Absent if the start date is unknown.
        validTo:
          type: string
          format: date
          nullable: true
          description: End of validity. Absent if this is the current value.
    Address:
      type: object
      description: >-
        A structured postal address scoped to a validity window. Use
        `formatedAddress` for display.
      properties:
        formatedAddress:
          type: string
          description: Pre-formatted full address string. Use for display.
        validFrom:
          type: string
          format: date
          description: Start of validity.
        validTo:
          type: string
          format: date
          nullable: true
          description: End of validity. Absent if this is the current address.
        street:
          type: string
          description: Street name.
        regNumber:
          type: number
          description: Registry number (súpisné číslo).
        buildingNumber:
          type: string
          description: Orientation number (orientačné číslo).
        postalCodes:
          type: array
          description: Postal codes. Usually one entry.
          items:
            type: string
        municipality:
          $ref: '#/components/schemas/CodeValue'
          description: Municipality from codelist CL000025 or UCE.
        country:
          $ref: '#/components/schemas/CodeValue'
          description: Country from codelist CL000086 or STA.
        district:
          $ref: '#/components/schemas/CodeValue'
          description: City quarter from codelist CL010141 or UCE.
        buildingIndex:
          type: string
          description: Building identifier from the Address Register.
    TimedCodeValueEntry:
      type: object
      description: >-
        A codelist-backed value scoped to a validity window. The current value
        is always the entry with no `validTo`.
      properties:
        value:
          $ref: '#/components/schemas/CodeValue'
          description: The categorical value for this period.
        validFrom:
          type: string
          format: date
          description: Start of validity.
        validTo:
          type: string
          format: date
          nullable: true
          description: End of validity. Absent if this is the current value.
    Activity:
      type: object
      description: >-
        A registered economic activity. Can be active, suspended, or
        deregistered independently of the entity's own status.
      properties:
        economicActivityDescription:
          type: string
          description: Free-text description of the activity.
        validFrom:
          type: string
          format: date
          description: Date from which the activity is registered.
        validTo:
          type: string
          format: date
          nullable: true
          description: Date the activity was deregistered. Absent if still registered.
        suspendedFrom:
          type: string
          format: date
          nullable: true
          description: >-
            Suspension start date. Present only if the activity is or has been
            suspended.
        suspendedTo:
          type: string
          format: date
          nullable: true
          description: Suspension end date. Absent if the activity is currently suspended.
    StatutoryBody:
      type: object
      description: >-
        A person or organisation authorised to act on behalf of the entity. Same
        shape as Stakeholder with the addition of `statutoryBodyMember` for
        collective board roles.
      properties:
        stakeholderType:
          $ref: '#/components/schemas/CodeValue'
          description: Type of statutory body from codelist CL010113.
        statutoryBodyMember:
          $ref: '#/components/schemas/CodeValue'
          description: >-
            Role within a collective body from codelist CL010470 (e.g. chairman,
            member).
        validFrom:
          type: string
          format: date
          description: Appointment start date.
        validTo:
          type: string
          format: date
          nullable: true
          description: Appointment end date. Absent if current.
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the statutory body.
        personName:
          $ref: '#/components/schemas/PersonName'
          description: Name of the natural person. Present for natural persons only.
        identifier:
          type: string
          description: IČO of the legal entity. Present for legal entities only.
        fullName:
          type: string
          description: Full name of the legal entity. Present for legal entities only.
        establishment:
          type: string
          format: date
          description: Date of incorporation. Present for legal entities only.
        termination:
          type: string
          format: date
          nullable: true
          description: Date of dissolution. Present for legal entities only.
    Stakeholder:
      type: object
      description: >-
        A person or organisation with a formal relationship to the entity —
        shareholders, partners, members, and similar. Natural persons carry a
        `personName`; legal entities carry `identifier` and `fullName`.
      properties:
        stakeholderType:
          $ref: '#/components/schemas/CodeValue'
          description: Role from codelist CL010109 (e.g. shareholder, partner).
        validFrom:
          type: string
          format: date
          description: Relationship start date.
        validTo:
          type: string
          format: date
          nullable: true
          description: Relationship end date. Absent if current.
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the stakeholder.
        personName:
          $ref: '#/components/schemas/PersonName'
          description: Name of the natural person. Present for natural persons only.
        identifier:
          type: string
          description: >-
            IČO of the legal entity or organisational unit. Present for legal
            entities only.
        fullName:
          type: string
          description: Full name of the legal entity. Present for legal entities only.
        establishment:
          type: string
          format: date
          description: Date of incorporation. Present for legal entities only.
        termination:
          type: string
          format: date
          nullable: true
          description: Date of dissolution. Present for legal entities only.
    CodeValue:
      type: object
      description: >-
        A categorical value paired with its codelist reference. Use `value` for
        display, `code` for storing and filtering.
      properties:
        value:
          type: string
          description: Human-readable label in Slovak.
        code:
          type: string
          description: >-
            Stable codelist entry key. Empty string if no matching entry exists
            — guard against `""` before using as a lookup key.
        codelistCode:
          type: string
          description: >-
            Identifies the codelist this value belongs to (e.g. `CL000056`). See
            the Codelists reference.
    PersonName:
      type: object
      description: A structured name for a natural person. Use `formatedName` for display.
      properties:
        formatedName:
          type: string
          description: Pre-formatted full name. Use for display.
        givenNames:
          type: array
          description: First name(s).
          items:
            type: string
        familyNames:
          type: array
          description: Current family name(s).
          items:
            type: string
        givenFamilyNames:
          type: array
          description: Birth family name(s).
          items:
            type: string
        prefixes:
          type: array
          description: Titles before the name (e.g. Ing., JUDr.) from codelist CL000062.
          items:
            $ref: '#/components/schemas/CodeValue'
        postfixes:
          type: array
          description: Titles after the name (e.g. PhD.) from codelist CL000063.
          items:
            $ref: '#/components/schemas/CodeValue'

````