> For the complete documentation index, see [llms.txt](https://docs.luasentry.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luasentry.com/luasentry-api-documentation.md).

# Luasentry API Documentation

{% hint style="danger" %}

#### ⚠️ ⚠️ ! IMPORTANT ! ⚠️ ⚠️

Luasentry HTTP API is not a public API. It's accessible by Luasentry customers and script developers only.

👉 **You must provide your Developer API Key** on all requests. Keep your key secure and never share it publicly or commit it to client-side scripts.
{% endhint %}

### Top things to always remember: ✅

{% hint style="warning" %}
`Content-Type` header must be set to `application/json` in all of your requests.
{% endhint %}

{% hint style="warning" %}
Each endpoint has its own ratelimits, but in general you can make 60 requests **per minute**. Exceeding this limit will result a `429` status code.
{% endhint %}

{% hint style="info" %}

#### Parameter Types:

* **Path**: `https://api.luasentry.com/api/v1/projects/PARAMETER_HERE/stuff`
* **Query**: `https://api.luasentry.com/api/v1/things?paramName=PARAMETER_HERE`
* **Body**: (In Request body): `{"fieldName": "PARAMETER_HERE"}`
* **Header**: (In Request headers): `{"headerName": "HEADER VALUE"}`
  {% endhint %}

***

## API/Key Management

### Getting API health

`GET` `https://api.luasentry.com/health`

This will return you the version and operational health about the API.

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "version": "v1",
  "active": true,
  "message": "API is up and working!"
}
```

{% endtab %}
{% endtabs %}

### Getting API key details

`GET` `https://api.luasentry.com/api/v1/keys/:api_key/details`

You can get details of your API key. Project/Script IDs, execution amounts, script names etc..

**Example URL:** `https://api.luasentry.com/api/v1/keys/300058fb1987f0e019b0c980ad01/details`

#### Path Parameters

| Name        | Type   | Description               |
| ----------- | ------ | ------------------------- |
| `api_key`\* | String | API key to get details of |

#### Request Headers

| Name        | Type   | Description                                                          |
| ----------- | ------ | -------------------------------------------------------------------- |
| `x-api-key` | String | Your Luasentry Developer API Key (or provide via URL path parameter) |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "message": "Success!",
  "email": "developer@example.com",
  "discord_id": "493827492379239857",
  "expires_at": 1767225599,
  "registered_at": 1740000000,
  "plan": "pro",
  "enabled": 1,
  "projects": [
    {
      "platform": "roblox",
      "id": "proj_987f0e019b0c980ad01",
      "name": "My Script Hub",
      "settings": {
        "reset_hwid_cooldown": 14
      },
      "scripts": [
        {
          "script_name": "server crasher (free)",
          "script_id": "cm0script123",
          "script_version": "1.0.0",
          "ffa": true,
          "silent": false
        },
        {
          "script_name": "premium hub",
          "script_id": "cm0script456",
          "script_version": "1.0.0",
          "ffa": false,
          "silent": false
        }
      ]
    }
  ]
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
  "success": false,
  "message": "Invalid API Key."
}
```

{% endtab %}

{% tab title="403: Forbidden" %}

```json
{
  "success": false,
  "message": "The Developer API is only available for Premium plans."
}
```

{% endtab %}
{% endtabs %}

### Getting API key stats

`GET` `https://api.luasentry.com/api/v1/keys/:api_key/stats`

Returns overall telemetry, total executions, active licenses, and top executors across all your scripts.

**Example URL:** `https://api.luasentry.com/api/v1/keys/300058fb1987f0e019b0c980ad01/stats`

#### Path Parameters

| Name        | Type   | Description             |
| ----------- | ------ | ----------------------- |
| `api_key`\* | String | API key to get stats of |

#### Request Headers

| Name        | Type   | Description                                                          |
| ----------- | ------ | -------------------------------------------------------------------- |
| `x-api-key` | String | Your Luasentry Developer API Key (or provide via URL path parameter) |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "data": {
    "totalExecutions": 48210,
    "activeLicenses": 340,
    "topExecutors": [
      { "executor": "Wave", "count": 19200 },
      { "executor": "Synapse Z", "count": 14100 },
      { "executor": "Swift", "count": 9800 }
    ]
  }
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
  "success": false,
  "message": "Invalid API Key."
}
```

{% endtab %}
{% endtabs %}

***

## User & Key Management

### Basics

User keys (licenses) allow your buyers or users to authenticate and execute scripts protected by Luasentry. Each license is tied to your project, can have an expiration date or lifetime access, and is tracked with hardware ID (HWID) locks.

### Expiry dates & Time limited keys:

Keys can either be lifetime (never expires) or time-limited:

* **UNIX Timestamp**: When creating a key, provide `auth_expire` as an epoch timestamp (in seconds).
* **Relative Duration**: The system calculates the remaining days from `auth_expire`. If omitted, the key is permanent.

***

### Creating a key / user

`POST` `https://api.luasentry.com/api/v1/projects/:projectId/users`

This endpoint will generate a key. If you don't specify the parameters, key will be 'unassigned' which means a user with the key can claim it and automatically assign their HWID / Discord ID to the key.

Users who have their HWIDs linked to the keys will be able to run the script. If they don't include script\_key on top of their script, they will not be able to run the script as long as the FFA mode isn't on.

**Example URL:** `https://api.luasentry.com/api/v1/projects/ef67bc7f7bd0948f4fff336274a4a345/users`

#### Path Parameters

| Name          | Type   | Description                                             |
| ------------- | ------ | ------------------------------------------------------- |
| `projectId`\* | String | ID of the project that you want to add the user key to. |

#### Request Headers

| Name             | Type   | Description                                                         |
| ---------------- | ------ | ------------------------------------------------------------------- |
| `x-api-key`\*    | String | Your Luasentry Developer API Key (or `Authorization: Bearer <key>`) |
| `Content-Type`\* | String | Must be `application/json`                                          |

#### Request Body

| Name                          | Type    | Description                                                                                                                                                                                                          |
| ----------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `identifier` *(optional)*     | String  | Identifier of the user to whitelist. Could be a HWID.                                                                                                                                                                |
| `auth_expire` *(optional)*    | Integer | Unix timestamp (seconds) of expiry date. If you don't provide this field, it will never expire.                                                                                                                      |
| `note` *(optional)*           | String  | Custom note for client. This might make it easier to identify the user.                                                                                                                                              |
| `discord_id` *(optional)*     | String  | Discord ID of the user. If not specified, user won't be able to resethwid on their own. They can still link their discord id to their key using Redeem button on the customer portal / discord bot.                  |
| `key_days` *(optional)*       | Number  | Number of days a key will have once it has been activated by user.                                                                                                                                                   |
| `script_id` *(optional)*      | String  | Script ID to bind this key to. (For single script binding).                                                                                                                                                          |
| `scripts` *(optional)*        | Array   | Array of Script IDs to bind this key to (for binding to multiple scripts, e.g. `["ef67bc7f7bd0948f4fff336274a4a345", "300058fb1987f0e019b0c980ad01"]`). If omitted, key has universal access to all project scripts. |
| `key_type` *(optional)*       | String  | Key type classification (`"standard"`, `"universal"`, or `"custom"`). Defaults to `"universal"`.                                                                                                                     |
| `max_hwid_slots` *(optional)* | Integer | Maximum simultaneous HWID device slots for this key (multi-device support, e.g. `2` or `3`). Defaults to `1`.                                                                                                        |

{% tabs %}
{% tab title="Request Example (Multiple Scripts & 2 HWID Slots)" %}

```json
{
  "key_days": 30,
  "discord_id": "123456789012345678",
  "max_hwid_slots": 2,
  "scripts": [
    "ef67bc7f7bd0948f4fff336274a4a345",
    "300058fb1987f0e019b0c980ad01"
  ],
  "key_type": "standard",
  "note": "Customer order #8491"
}
```

{% endtab %}

{% tab title="201: OK Success" %}

```json
{
  "success": true,
  "user_key": "LS-9F2B8-7E1A4-3D6C5",
  "message": "User key created successfully."
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
  "success": false,
  "message": "Invalid API Key."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "Project not found."
}
```

{% endtab %}
{% endtabs %}

***

### Updating an existing user

`PATCH` `https://api.luasentry.com/api/v1/projects/:projectId/users`

You can use this endpoint to edit an already existing user. If you don't provide a specific field, API will assume that you don't want to change that property, so it's going to stay the same.

**Example URL:** `https://api.luasentry.com/api/v1/projects/ef67bc7f7bd0948f4fff336274a4a345/users`

#### Path Parameters

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| `projectId`\* | String | ID of the project that user belongs to |

#### Request Headers

| Name             | Type   | Description                                                         |
| ---------------- | ------ | ------------------------------------------------------------------- |
| `x-api-key`\*    | String | Your Luasentry Developer API Key (or `Authorization: Bearer <key>`) |
| `Content-Type`\* | String | Must be `application/json`                                          |

#### Request Body

| Name                          | Type    | Description                                                                                                                                       |
| ----------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `user_key`\*                  | String  | Unique user\_key to edit.                                                                                                                         |
| `identifier` *(optional)*     | String  | Identifier of the user to whitelist. Could be a HWID.                                                                                             |
| `auth_expire` *(optional)*    | Int32   | Unix timestamp (seconds) of expiry date. If you don't want it to expire, use negative one (-1) as value.                                          |
| `note` *(optional)*           | String  | Custom note for client. This might make it easier to identify the user.                                                                           |
| `discord_id` *(optional)*     | String  | Discord ID of the user.                                                                                                                           |
| `max_hwid_slots` *(optional)* | Integer | Set explicit maximum HWID device slot limit (e.g. `2`, `3`).                                                                                      |
| `add_hwid_slots` *(optional)* | Integer | Increment allowed HWID device slots by this number (e.g. `1` adds +1 slot).                                                                       |
| `consume_key` *(optional)*    | String  | Another license key from your project to consume/burn in exchange for adding its device slot(s) to this key.                                      |
| `add_scripts` *(optional)*    | Array   | Add / append one or multiple script IDs to this user key without removing existing script bindings (e.g. `["ef67bc7f7bd0948f4fff336274a4a345"]`). |
| `scripts` *(optional)*        | Array   | Replace the entire list of bound scripts with these script IDs.                                                                                   |
| `remove_scripts` *(optional)* | Array   | Remove / unbind one or multiple script IDs from this user key.                                                                                    |
| `script_id` *(optional)*      | String  | Bind or rebind this user key to a single script ID (replaces existing bindings).                                                                  |
| `key_type` *(optional)*       | String  | Update the key type classification (`"standard"`, `"universal"`, etc.).                                                                           |

{% tabs %}
{% tab title="Request Example (Add +1 Device Slot)" %}

```json
{
  "user_key": "LS-9F2B8-7E1A4-3D6C5",
  "add_hwid_slots": 1
}
```

{% endtab %}

{% tab title="Request Example (Add 2nd Script)" %}

```json
{
  "user_key": "LS-9F2B8-7E1A4-3D6C5",
  "add_scripts": [
    "ef67bc7f7bd0948f4fff336274a4a345"
  ]
}
```

{% endtab %}

{% tab title="200: OK Edited successfully" %}

```json
{
  "success": true,
  "message": "Success!"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```json
{
  "success": false,
  "message": "user_key is required in request body or URL path parameter."
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
  "success": false,
  "message": "Invalid API Key."
}
```

{% endtab %}

{% tab title="403: Forbidden" %}

```json
{
  "success": false,
  "message": "The External Developer API is only available for Pro plans."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "License not found in this project."
}
```

{% endtab %}
{% endtabs %}

***

### Redeeming a key

`POST` `https://api.luasentry.com/api/v1/projects/:projectId/redeem`

This endpoint allows custom Discord bots, automated webhooks, or external shops to programmatically redeem license keys on behalf of users. It supports standard script unlocks, multi-device slot upgrades, duration extensions, and instant HWID resets.

**Example URL:** `https://api.luasentry.com/api/v1/projects/ef67bc7f7bd0948f4fff336274a4a345/redeem`

#### Path Parameters

| Name        | Type   | Description                                                          |
| ----------- | ------ | -------------------------------------------------------------------- |
| `projectId` | String | *(Optional if passed in body)* ID of the project that key belongs to |

#### Request Headers

| Name             | Type   | Description                                                         |
| ---------------- | ------ | ------------------------------------------------------------------- |
| `x-api-key`\*    | String | Your Luasentry Developer API Key (or `Authorization: Bearer <key>`) |
| `Content-Type`\* | String | Must be `application/json`                                          |

#### Request Body

| Name                      | Type   | Description                                                                                                  |
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------------ |
| `user_key`\*              | String | The license key to redeem or consume.                                                                        |
| `discord_id`\*            | String | The Discord ID of the user claiming the key.                                                                 |
| `action` *(optional)*     | String | Action: `"new_script"` (default), `"add_device_slot"`, `"extend"`, or `"instant_hwid_reset"`.                |
| `target_key` *(optional)* | String | Target key to receive the upgrade (required for `"add_device_slot"`, `"extend"`, or `"instant_hwid_reset"`). |
| `identifier` *(optional)* | String | Initial HWID to lock/whitelist immediately upon redemption.                                                  |
| `script_id` *(optional)*  | String | Bind or limit key to this specific script ID on redemption.                                                  |

{% tabs %}
{% tab title="Action: Add Device Slot (+1 Multi-HWID)" %}

```json
{
  "user_key": "LS-EXTRA-KEY-TO-CONSUME",
  "discord_id": "123456789012345678",
  "action": "add_device_slot",
  "target_key": "LS-TARGET-EXISTING-KEY"
}
```

{% endtab %}

{% tab title="Action: Standard Script Redeem" %}

```json
{
  "user_key": "LS-9F2B8-7E1A4-3D6C5",
  "discord_id": "123456789012345678",
  "action": "new_script",
  "identifier": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
```

{% endtab %}

{% tab title="Action: Extend Duration" %}

```json
{
  "user_key": "LS-EXTRA-KEY-TO-CONSUME",
  "discord_id": "123456789012345678",
  "action": "extend",
  "target_key": "LS-TARGET-EXISTING-KEY"
}
```

{% endtab %}

{% tab title="200: OK Device Slot Added" %}

```json
{
  "success": true,
  "action": "add_device_slot",
  "message": "Added +1 device slot(s) successfully! Target license now allows 2 device(s).",
  "data": {
    "target_key": "LS-TARGET-EXISTING-KEY",
    "added_slots": 1,
    "max_hwid_slots": 2,
    "active_hwids_count": 1
  }
}
```

{% endtab %}

{% tab title="200: OK Standard Redeem" %}

```json
{
  "success": true,
  "action": "new_script",
  "message": "License key redeemed successfully!",
  "data": {
    "user_key": "LS-9F2B8-7E1A4-3D6C5",
    "status": "active",
    "discord_id": "123456789012345678",
    "maxHwidSlots": 1,
    "expiresAt": "2026-12-31T23:59:59.000Z"
  }
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```json
{
  "success": false,
  "message": "This license key has already been consumed."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "License key not found in project."
}
```

{% endtab %}
{% endtabs %}

***

### Deleting the key

`DELETE` `https://api.luasentry.com/api/v1/projects/:projectId/users/:user_key`

Permanently removes a user key and deletes all associated HWID locks from your project.

**Example URL:** `https://api.luasentry.com/api/v1/projects/proj_987f0e019b0c980ad01/users/LS-9F2B8-7E1A4-3D6C5`

#### Path Parameters

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| `projectId`\* | String | The project ID            |
| `user_key`\*  | String | The license key to delete |

#### Request Headers

| Name          | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| `x-api-key`\* | String | Your Luasentry Developer API Key |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "message": "User key deleted."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "License not found in this project."
}
```

{% endtab %}
{% endtabs %}

***

### Getting users

`GET` `https://api.luasentry.com/api/v1/projects/:projectId/users`

Fetches all user licenses created under your project, including user keys, bound HWIDs, total executions, notes, and expiration dates.

**Example URL:** `https://api.luasentry.com/api/v1/projects/proj_987f0e019b0c980ad01/users`

#### Path Parameters

| Name          | Type   | Description    |
| ------------- | ------ | -------------- |
| `projectId`\* | String | The project ID |

#### Request Headers

| Name          | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| `x-api-key`\* | String | Your Luasentry Developer API Key |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "data": [
    {
      "user_key": "LS-9F2B8-7E1A4-3D6C5",
      "status": "active",
      "isPremium": true,
      "isBanned": false,
      "banReason": null,
      "totalExecutions": 87,
      "totalResets": 1,
      "maxHwidSlots": 1,
      "expiresAt": "2026-12-31T23:59:59.000Z",
      "note": "Discord ID: 123456789012345678",
      "createdAt": "2026-10-18T12:00:00.000Z",
      "hwids": [
        {
          "id": "hwid_cl0192abc",
          "hwid": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
          "createdAt": "2026-10-18T12:05:00.000Z"
        }
      ],
      "scripts": [
        {
          "name": "Main Script Hub"
        }
      ]
    }
  ]
}
```

{% endtab %}

{% tab title="401: Unauthorized" %}

```json
{
  "success": false,
  "message": "Invalid API Key."
}
```

{% endtab %}
{% endtabs %}

***

### Resetting the HWID of a key

`POST` `https://api.luasentry.com/api/v1/projects/:projectId/users/:user_key/reset-hwid`

Instantly wipes all bound hardware ID (HWID) locks and device fingerprints for this key, allowing the user to bind a new device on their next execution.

**Example URL:** `https://api.luasentry.com/api/v1/projects/proj_987f0e019b0c980ad01/users/LS-9F2B8-7E1A4-3D6C5/reset-hwid`

#### Path Parameters

| Name          | Type   | Description                       |
| ------------- | ------ | --------------------------------- |
| `projectId`\* | String | The project ID                    |
| `user_key`\*  | String | The license key to reset HWID for |

#### Request Headers

| Name          | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| `x-api-key`\* | String | Your Luasentry Developer API Key |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "message": "HWID reset successfully."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "License not found in this project."
}
```

{% endtab %}
{% endtabs %}

***

### Linking discord ID to a key

`PUT` `https://api.luasentry.com/api/v1/projects/:projectId/users/:user_key`

You can attach or update a user's Discord ID by updating the license note or metadata field using their user key.

**Example URL:** `https://api.luasentry.com/api/v1/projects/proj_987f0e019b0c980ad01/users/LS-9F2B8-7E1A4-3D6C5`

#### Body Parameters

| Name   | Type   | Description                                                   |
| ------ | ------ | ------------------------------------------------------------- |
| `note` | String | Discord User ID or handle: `"Discord ID: 920805330000000000"` |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "data": {
    "user_key": "LS-9F2B8-7E1A4-3D6C5",
    "note": "Discord ID: 920805330000000000"
  }
}
```

{% endtab %}
{% endtabs %}

***

### Blacklisting a key

`POST` `https://api.luasentry.com/api/v1/projects/:projectId/users/:user_key/blacklist`

Immediately bans and blacklists a license key. Any subsequent execution attempts using this key will be instantly blocked.

**Example URL:** `https://api.luasentry.com/api/v1/projects/proj_987f0e019b0c980ad01/users/LS-9F2B8-7E1A4-3D6C5/blacklist`

#### Path Parameters

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| `projectId`\* | String | The project ID               |
| `user_key`\*  | String | The license key to blacklist |

#### Request Headers

| Name             | Type   | Description                      |
| ---------------- | ------ | -------------------------------- |
| `x-api-key`\*    | String | Your Luasentry Developer API Key |
| `Content-Type`\* | String | Must be `application/json`       |

#### Body Parameters

| Name     | Type   | Description                                                   |
| -------- | ------ | ------------------------------------------------------------- |
| `reason` | String | Reason for blacklisting (e.g. `"Chargeback / ToS Violation"`) |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "message": "User key blacklisted."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "License not found in this project."
}
```

{% endtab %}
{% endtabs %}

***

### Unblacklisting a key

`POST` `https://api.luasentry.com/api/v1/projects/:projectId/users/:user_key/unblacklist`

Lifts an active ban and blacklist on a license key, restoring execution rights.

**Example URL:** `https://api.luasentry.com/api/v1/projects/proj_987f0e019b0c980ad01/users/LS-9F2B8-7E1A4-3D6C5/unblacklist`

#### Path Parameters

| Name          | Type   | Description                    |
| ------------- | ------ | ------------------------------ |
| `projectId`\* | String | The project ID                 |
| `user_key`\*  | String | The license key to unblacklist |

#### Request Headers

| Name          | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| `x-api-key`\* | String | Your Luasentry Developer API Key |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "success": true,
  "message": "User key unblacklisted."
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "success": false,
  "message": "License not found in this project."
}
```

{% endtab %}
{% endtabs %}
