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

# Get one ValidationRule

> Retrieve a single ValidationRule record by its Id.

A validation rule is a location-scoped custom expression evaluated when selected records are created or updated; a false result blocks the save with its configured error message.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`ValidationRule-Read`** role.
</Note>

## Path Parameters

<ParamField path="id" type="integer" required>
  The Id of the ValidationRule record to retrieve.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://spaces.nexudus.com/api/sys/validationrules/87654321" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/sys/validationrules/87654321',
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const record = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://spaces.nexudus.com/api/sys/validationrules/87654321',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  record = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="BusinessId" type="integer">
  ID of the location that owns this rule; a rule on a network location is also evaluated for records in its child locations.
</ResponseField>

<ResponseField name="Name" type="string">
  Required internal name for this rule; it is returned as the failure message when ErrorMessage is null.
</ResponseField>

<ResponseField name="RecordType" type="integer">
  Record type this rule evaluates: Coworker (customer), Booking, CoworkerContract, Visitor, CoworkerProduct, ProposalContract, CoworkerInvoice, Teams, or EventAttendees. See `eValidationRuleEntity` enum values: `1` = Coworker, `2` = Booking, `4` = CoworkerContract, `5` = Visitor, `6` = CoworkerProduct, `7` = ProposalContract, `8` = CoworkerInvoice, `9` = Teams, `10` = EventAttendees.
</ResponseField>

<ResponseField name="Active" type="boolean">
  Whether this rule is evaluated when a matching record is created or updated; only active rules are selected for evaluation.
</ResponseField>

<ResponseField name="Formula" type="string">
  Required Flee expression that returns true to allow the record and false to reject it; use record, isCreate, isUpdate, user, and the available CustomFunctions as evaluation context.
</ResponseField>

<ResponseField name="Description" type="string">
  Optional internal notes explaining this rule; not shown to customers.
</ResponseField>

<ResponseField name="ErrorMessage" type="string">
  Message returned when Formula evaluates to false; when null, the rule Name is returned instead.
</ResponseField>

<ResponseField name="Id" type="integer">
  Unique record identifier.
</ResponseField>

<ResponseField name="UniqueId" type="string">
  UUID of the record.
</ResponseField>

<ResponseField name="CreatedOn" type="string">
  Date and time the record was created (ISO 8601).
</ResponseField>

<ResponseField name="UpdatedOn" type="string">
  Date and time the record was last updated (ISO 8601).
</ResponseField>

<ResponseField name="UpdatedBy" type="string">
  Email of the user who last updated this record.
</ResponseField>

<ResponseField name="IsNew" type="boolean">
  Whether the record was recently created.
</ResponseField>

<ResponseField name="SystemId" type="string">
  External system identifier.
</ResponseField>

```json Example Response theme={null}
{
  "BusinessId": 0,
  "Name": "",
  "RecordType": 0,
  "Active": false,
  "Formula": "",
  "Description": null,
  "ErrorMessage": null,
  "Id": 87654321,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "CreatedOn": "2025-01-10T08:00:00Z",
  "UniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "UpdatedBy": "admin@example.com",
  "IsNew": false,
  "SystemId": null,
  "ToStringText": "ValidationRule Example",
  "LocalizationDetails": null,
  "CustomFields": null
}
```
