# API Functions

{% hint style="info" %}
When an argument is **`bold`**, it is **required**.
{% endhint %}

### Open Door

{% tabs %}
{% tab title="Info" %}
`API.Doors.Open:Fire(Door)`

Opens the CheckMeIn door specified.

**Arguments**\
\&#xNAN;**`Door`** Type: Door Model
{% endtab %}

{% tab title="Example" %}

```lua
API.Doors.Open:Fire(workspace.CheckMeIn.Doors.Rooms['My Cool Room'])
```

{% endtab %}
{% endtabs %}

### Checked In

{% tabs %}
{% tab title="Info" %}
`API.Service.CheckedIn.Event:Connect(function(Employee, Player, Door)`

This event fires when a user is checked in.

{% hint style="info" %}

* This event fires when the employee who sent a check in request leaves the game before it is accepted. In this case, the employee property will be set to nil.
* This event fires when self check in is used. The employee property will be set to 'SCI' (string).
  {% endhint %}

**Return Values**\
`Employee` Type: Variable (Player, string or nil)\
`Player` Type: Player\
`Door` Type: Door Model
{% endtab %}

{% tab title="Example" %}

```lua
API.Service.CheckedIn.Event:Connect(function(Employee, Player, Door)
    if Employee then
        if type(Employee) == 'string' then
        -- You have now discovered the Player used Self Check In
        else
        -- You have now discovered Employee exists.
        end
    end
end)
```

{% endtab %}
{% endtabs %}

### Checked Out

{% tabs %}
{% tab title="Info" %}
`API.Service.CheckedOut.Event:Connect(function(Employee, Player, Door)`

This event fires when a user is checked out.

{% hint style="info" %}

* This event fires when players disconnect. The employee property will be set to 'DISCONNECT' (string).
* This event fires when the employee who sent a check out request leaves the game before it is accepted. In this case, the employee property will be set to nil.
* This event fires when self check out is used. The employee property will be set to 'SCI' (string).
  {% endhint %}

**Return Values**\
`Employee` Type: Variable (Player, string or nil)\
`Player` Type: Player\
`Door` Type: Door Model
{% endtab %}

{% tab title="Example" %}

```lua
API.Service.CheckedOut.Event:Connect(function(Employee, Player, Door)
    print(Player.Name .. ' was checked out.')
end)
```

{% endtab %}
{% endtabs %}

### Force Check In

{% tabs %}
{% tab title="Info" %}
`API.Service.ForceCheckIn:Fire(Player, RoomType)`

Forcefully checks specified player into specified RoomType. Ignores game pass requirements.

{% hint style="info" %}
When no room is available, this function will do nothing.
{% endhint %}

**Arguments**\
\&#xNAN;**`Player`** Type: Player\
\&#xNAN;**`RoomType`** Type: String (must be a valid room type, case sensitive)
{% endtab %}

{% tab title="Example" %}
See the Tutorial section for more advanced examples.

{% content-ref url="/pages/-M7wbdwqGco6OGN4gDmt" %}
[Roblox Premium Rooms](/tutorials/roblox-premium-rooms.md)
{% endcontent-ref %}

```lua
API.Service.ForceCheckIn:Fire(game.Players.wind_o,'Premium Suite')
```

{% endtab %}
{% endtabs %}

### Force Check Out

{% tabs %}
{% tab title="Info" %}
`API.Service.ForceCheckOut:Fire(Player)`

Forcefully checks out specified player.

{% hint style="info" %}
If `Player` is not checked in, this function will do nothing.
{% endhint %}

**Arguments**\
\&#xNAN;**`Player`** Type: Player
{% endtab %}

{% tab title="Example" %}

```lua
API.Service.ForceCheckOut:Fire(game.Players.wind_o)
```

{% endtab %}
{% endtabs %}

### ExceededLimit

{% tabs %}
{% tab title="Info" %}
`API.Service.ExceededLimit.Event:Connect(function(Player)`

This event fires when Player is spamming remote events. Exact configuration of the Cooldown system can be found here.

{% hint style="info" %}
You should read the Cooldown Service tutorial before using this function.
{% endhint %}

**Return Values**\
`Player` Type: Player
{% endtab %}
{% endtabs %}

### Get Points

{% tabs %}
{% tab title="Info" %}
`API.Web.GetPoints:Invoke(userId)`

Returns Points value of specified player.

**Arguments**\
\&#xNAN;**`userId`** Type: UserId\
**Return Values**\
`Points` Type: Integer (amount of points player has)
{% endtab %}

{% tab title="Example" %}

```lua
if API.Web.GetPoints:Invoke(game.Players.wind_o.UserId) > 100 then
    print('wind_o is rich!')
end
```

{% endtab %}
{% endtabs %}

### Reward Points

{% tabs %}
{% tab title="Info" %}
`API.Web.RewardPoints:Fire(userId, amount)`

Awards points to specified player.

{% hint style="info" %}

* When no `amount` is specified, the function will reward the normal amount of points, set in the Configuration module. This value can be found at Workspace.CheckMeIn.Configuration.Points.Reward
* The target player must be online in the server for this function to work.
  {% endhint %}

**Arguments**\
\&#xNAN;**`userId`** Type: UserId\
`amount` Type: Integer
{% endtab %}

{% tab title="Example" %}

```lua
API.Web.RewardPoints:Fire(game.Players.wind_o.UserId, 1337)
```

{% endtab %}
{% endtabs %}

### Set Points

{% tabs %}
{% tab title="Info" %}
`API.Web.SetPoints:Fire(userId, amount)`

Sets the Points value of the specified player.

{% hint style="danger" %}
**SetPoints will overwrite any existing data. Please be careful with this command.**
{% endhint %}

{% hint style="info" %}

* The target player must be online in the server for this function to work.
  {% endhint %}

**Arguments**\
\&#xNAN;**`userId`** Type: UserId\
\&#xNAN;**`amount`** Type: Integer
{% endtab %}

{% tab title="Example" %}

```lua
--Wind_o's been mean. He needs his points reset.
API.Web.SetPoints:Fire(game.Players.wind_o.UserId, 0)
```

{% endtab %}
{% endtabs %}

### Get Tutorial State

{% tabs %}
{% tab title="Info" %}
`API.Web.GetTutorialState(Player)`

Gets tutorial state (whether the CheckMeIn tutorial was completed) for the specified Player.

**Arguments**\
\&#xNAN;**`Player`** Type: Player\
**Return Values**\
`TutorialState` Type: Boolean
{% endtab %}

{% tab title="Example" %}

```lua
game.Players.PlayerAdded:Connect(function(Player)
    local TutorialState = API.Web.GetTutorialState:Invoke(Player)
    
    if not TutorialState then
    --CheckMeIn Tutorial not completed, perhaps show them the ropes
    --of the entire game?
    end
end)
```

{% endtab %}
{% endtabs %}

### Webhook

> Deprecated

{% tabs %}
{% tab title="Info" %}
`API.Web.Webhook:Fire(Message)`

Sends `Message` to your Discord Webhook.

{% hint style="danger" %}
**The Discord Webhook in CheckMeIn is deprecated and does not respect rate limits.**\
**Do not use this function to prevent your Discord account from being deleted.**
{% endhint %}

**Arguments**\
\&#xNAN;**`Message`** Type: String
{% endtab %}

{% tab title="Example" %}

```lua
API.Web.Webhook:Fire('Hello world!')
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.checkmein.cloud/api-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
