> ## 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.

# Create AutomationTileAudit

> Create a new AutomationTileAudit record.

An **AutomationTileAudit** is a log entry recorded each time an `AutomationTile` is scanned or tapped. It captures the outcome (success or failure), the action that was triggered, and the identity of the user who scanned the tile.

Use this entity to review tile usage history, troubleshoot scanning failures, and track which customers are interacting with specific tiles.

## 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 **`AutomationTileAudit-Create`** role.
</Note>

## Enums

<Accordion title="eAutomationTileAction — Action values">
  | Value | Name                  |
  | ----- | --------------------- |
  | 1     | None                  |
  | 2     | UnlockAct365Door      |
  | 3     | CheckIn               |
  | 4     | CheckOut              |
  | 5     | BookingCheckIn        |
  | 6     | EventCheckIn          |
  | 7     | ResourceCleaned       |
  | 8     | RequestUrl            |
  | 9     | RedirectUrl           |
  | 10    | UnlockDoorDeckDoor    |
  | 11    | UnlockKisiDoor        |
  | 12    | BookResource          |
  | 13    | BookDesk              |
  | 14    | ShowNewBookingForm    |
  | 15    | SmartLock             |
  | 16    | ExtendBookingBy       |
  | 17    | ShowAcsModal          |
  | 18    | UnlockPadWordDoor     |
  | 19    | UnlockOPaxtonNet2Door |
</Accordion>

<Accordion title="eTileAuditType — TileAuditType values">
  | Value | Name    |
  | ----- | ------- |
  | 1     | Success |
  | 2     | Failure |
</Accordion>

## Request Body

### Required Fields

<ParamField body="AutomationTileId" type="integer" required>
  ID of the automation tile linked to this record.
</ParamField>

<ParamField body="Description" type="string" required>
  Human-readable description of what happened when the tile was scanned.
</ParamField>

<ParamField body="Action" type="integer" required>
  The action that was triggered when the tile was scanned (matches the tile's configured action).
</ParamField>

<ParamField body="TileAuditType" type="integer" required>
  Outcome of the scan: Success or Failure.
</ParamField>

### Optional Fields

<ParamField body="ActionBy" type="string">
  Name or identifier of the customer who scanned the tile.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/sys/automationtileaudits" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "AutomationTileId": 0,
      "Description": "",
      "Action": 0,
      "TileAuditType": 0
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/sys/automationtileaudits',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        AutomationTileId: 0,
        Description: '',
        Action: 0,
        TileAuditType: 0
      })
    }
  );

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

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

  response = requests.post(
      'https://spaces.nexudus.com/api/sys/automationtileaudits',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'AutomationTileId': 0,
          'Description': '',
          'Action': 0,
          'TileAuditType': 0
      }
  )

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

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the automationtileaudit was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "AutomationTileAudit was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Description: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Description"
    }
  ],
  "WasSuccessful": false
}
```
