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

> Create a new AutomationTile record.

An **AutomationTile** represents a physical NFC chip and QR code tile that triggers actions in a Nexudus-powered coworking space. Each tile is linked to a single action (e.g. check-in, booking, door unlock, HTTP request) that fires when a customer scans or taps the tile.

The `Action` field determines what happens when the tile is scanned. Some actions require additional data in `ActionParameters`:

| Action                                                 | ActionParameters format                                                        |
| ------------------------------------------------------ | ------------------------------------------------------------------------------ |
| CheckIn / CheckOut / EventCheckIn                      | Not required                                                                   |
| BookingCheckIn / ResourceCleaned / ShowNewBookingForm  | Resource ID                                                                    |
| BookResource                                           | Resource ID `\|` default booking length in minutes (default 60)                |
| BookDesk                                               | Desk (floor plan item) ID `\|` default booking length in minutes (default 480) |
| ExtendBookingBy                                        | Number of minutes to extend                                                    |
| RequestUrl                                             | Target URL for the HTTP POST request                                           |
| RedirectUrl                                            | URL to redirect the user to                                                    |
| UnlockAct365Door / UnlockDoorDeckDoor / UnlockKisiDoor | Door ID from the access-control provider                                       |
| SmartLock                                              | Smartalock locker bank ID                                                      |

Tiles can optionally be geo-fenced to restrict scanning to a physical area around the tile's installed location. Enable `EnableGeofence`, set `Latitude`/`Longitude`, and choose a `GeofencePrecission` level. `MaxDistanceMeters` overrides the precision preset with a custom radius.

Set `CheckCustomerIn` to also check the customer into the space when they scan the tile, regardless of the tile's primary action.

## 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 **`AutomationTile-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="eAutomationTileGeofencePrecission — GeofencePrecission values">
  | Value | Name     |
  | ----- | -------- |
  | 1     | Low      |
  | 2     | Medium   |
  | 3     | High     |
  | 4     | VeryHigh |
</Accordion>

## Request Body

### Required Fields

<ParamField body="BusinessId" type="integer" required>
  ID of the business linked to this record.
</ParamField>

<ParamField body="Name" type="string" required>
  Tile name used to identify it in the admin panel.
</ParamField>

<ParamField body="Action" type="integer" required>
  Action triggered when the tile is scanned: None, CheckIn, CheckOut, BookingCheckIn, EventCheckIn, ExtendBookingBy, RequestUrl, RedirectUrl, ResourceCleaned, BookResource, BookDesk, ShowNewBookingForm, UnlockAct365Door, UnlockDoorDeckDoor, UnlockKisiDoor, SmartLock, etc..
</ParamField>

<ParamField body="GeofencePrecission" type="integer" required>
  Geofence precision level: Low, Medium, High, or VeryHigh. Higher precision requires the user to be closer to the tile coordinates.
</ParamField>

### Optional Fields

<ParamField body="TileNumber" type="string">
  Unique tile identifier (GUID) auto-assigned on creation. Used to generate the QR code and NFC URL.
</ParamField>

<ParamField body="ActionParameters" type="string">
  Parameters for the selected action. Format depends on the action type — e.g. a resource ID, a URL, or a resource ID|duration pair.
</ParamField>

<ParamField body="EnableGeofence" type="boolean">
  Whether to restrict the tile to a geographic area. When enabled, the tile only works if the user is within the configured radius of the tile's coordinates.
</ParamField>

<ParamField body="CheckCustomerIn" type="boolean">
  Whether to also check the customer into the space when they scan the tile, regardless of the primary action.
</ParamField>

<ParamField body="Longitude" type="string">
  Longitude of the tile's installed location. Used for geofencing.
</ParamField>

<ParamField body="Latitude" type="string">
  Latitude of the tile's installed location. Used for geofencing.
</ParamField>

<ParamField body="MaxDistanceMeters" type="integer">
  Custom maximum distance in meters from the tile's coordinates. Overrides the precision preset when set.
</ParamField>

<ParamField body="SuccessMessage" type="string">
  Custom message shown to the user when the tile action completes successfully.
</ParamField>

<ParamField body="ErrorMessage" type="string">
  Custom error message shown to the user when the tile action fails.
</ParamField>

<ParamField body="Resources" type="integer[]">
  List of resources linked to this record.
</ParamField>

<ParamField body="Tariffs" type="integer[]">
  List of tariffs linked to this record.
</ParamField>

<ParamField body="TimePasses" type="integer[]">
  List of time passes linked to this record.
</ParamField>

<ParamField body="FloorPlanDesks" type="integer[]">
  List of floor plan desks linked to this record.
</ParamField>

## Code Examples

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

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

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

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

  response = requests.post(
      'https://spaces.nexudus.com/api/sys/automationtiles',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'Name': '',
          'Action': 0,
          'GeofencePrecission': 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 automationtile was created successfully.
</ResponseField>

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

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "AutomationTile 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": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
