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

> Create a new FailedCheckin record.

A **FailedCheckin** records an unsuccessful check-in attempt by a coworker (see `Checkin` entity). Each record captures the coworker involved, the location where the attempt occurred, the reason for the failure, and contextual details such as the coworker's teams and tariff at the time.

Failed check-ins are read-only and generated automatically by the system when a check-in is rejected — for example, due to access restrictions, an inactive plan, or an unrecognised device. Use the `Description` field to inspect the specific failure reason.

The `Source` field indicates how the check-in was initiated (e.g. manual, Wi-Fi, app) and matches the `eCheckinSource` enum used by the `Checkin` entity.

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

## Enums

<Accordion title="eCheckinSource — Source values">
  | Value | Name            |
  | ----- | --------------- |
  | 0     | None            |
  | 1     | Manual          |
  | 2     | DoorAccess      |
  | 3     | NetworkActivity |
  | 4     | Tile            |
  | 5     | Sensor          |
</Accordion>

## Request Body

### Required Fields

<ParamField body="BusinessId" type="integer" required>
  Business Id.
</ParamField>

<ParamField body="CheckinAttemptTime" type="string" required>
  Date and time when the check-in attempt occurred.
</ParamField>

### Optional Fields

<ParamField body="CoworkerId" type="integer">
  Coworker Id.
</ParamField>

<ParamField body="MacAddresses" type="string">
  MAC addresses of the device used during the check-in attempt, if available.
</ParamField>

<ParamField body="TeamsAtTheTimeOfCheckin" type="string">
  Comma-separated list of teams the coworker belonged to at the time of the failed check-in.
</ParamField>

<ParamField body="TariffAtTheTimeOfCheckin" type="string">
  Name of the pricing plan (tariff) assigned to the coworker at the time of the failed check-in.
</ParamField>

<ParamField body="Description" type="string">
  Reason or explanation for why the check-in attempt failed.
</ParamField>

<ParamField body="CheckinAttemptTimeLocal" type="string">
  Checkin Attempt Time Local.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/spaces/failedcheckins" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "CheckinAttemptTime": "2025-01-15T10:30:00Z"
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/failedcheckins',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        CheckinAttemptTime: '2025-01-15T10:30:00Z'
      })
    }
  );

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

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

  response = requests.post(
      'https://spaces.nexudus.com/api/spaces/failedcheckins',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'CheckinAttemptTime': '2025-01-15T10:30:00Z'
      }
  )

  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 failedcheckin was created successfully.
</ResponseField>

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

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