> For the complete documentation index, see [llms.txt](https://dsf3342.gitbook.io/luashield-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dsf3342.gitbook.io/luashield-documentation/api-documentation/projects/user-management.md).

# User Management

## Quick Tips

{% hint style="warning" %}
Usernames cannot exceed a length of 20 and they must have a minimum length of 3, they also cannot contain any special characters
{% endhint %}

{% hint style="warning" %}
User notes cannot exceed a length of 20 and they must have a minimum length of 3
{% endhint %}

## Get Users

<mark style="color:blue;">`GET`</mark> `https://api.luashield.com/projects/:project_id/users`

Get all users for your project

#### Path Parameters

| Name                                          | Type   | Description        |
| --------------------------------------------- | ------ | ------------------ |
| project\_id<mark style="color:red;">\*</mark> | String | ID of your project |

#### Headers

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| LuaShield-API-Key<mark style="color:red;">\*</mark> | String | API Key     |

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

```json
[
	{
		"id": "cf62582a-932d-48e2-9d09-5b436ba33337",
		"Key": "9c50a05d869a459dcf271b76757b8d47ab7a4c1fb89373fb3cbca7c44d751d70e3d0530a97e580b9ccf8b02aa6cdaf68d38aa6133c5451bde091395ec640b5e6",
		"Username": "balls",
		"HWID": null,
		"ProjectID": "3851df88-139e-4e1d-8229-02ed58595e9b",
		"Executions": 0,
		"CrackAttempts": 0,
		"Exploit": null,
		"Whitelisted": true,
		"CreatedAt": "2023-04-10T04:28:57.674Z",
		"ExpireAt": null,
		"MaxExecutions": 0,
		"Note": "dsf",
		"DiscordID": "787086729470541844"
	},
	{
		"id": "16b6eb05-c472-4dcd-8945-1081880d8ec7",
		"Key": "0ba6138c137b18db762cc5f2d1690723a0084d24f6a6ecb0c821a40ff9cc1776be758755e18a40bc4092ce6eece56bcc17dca0ea3a7435e655a9122a54a1f2dc",
		"Username": "dsflikesmen",
		"HWID": null,
		"ProjectID": "3851df88-139e-4e1d-8229-02ed58595e9b",
		"Executions": 0,
		"CrackAttempts": 0,
		"Exploit": null,
		"Whitelisted": true,
		"CreatedAt": "2023-04-10T04:29:05.241Z",
		"ExpireAt": null,
		"MaxExecutions": 0,
		"Note": "dsf",
		"DiscordID": "787086729470541844"
	}
]
```

{% endtab %}

{% tab title="402: Payment Required Subscription Expired" %}

```json
{
    "error": "Your subscription has expired"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```json
{
    "error": "Invalid API Key"
}
```

{% endtab %}

{% tab title="403: Forbidden You don't own this project" %}

```json
{
    "error": "You don't own this project"
}
```

{% endtab %}

{% tab title="404: Not Found This project doesn't exist" %}

{% endtab %}
{% endtabs %}

## Create User

{% hint style="warning" %}
This will return the users license key unhashed
{% endhint %}

<mark style="color:green;">`POST`</mark> `https://api.luashield.com/projects/:project_id/users`

Create a user

#### Path Parameters

| Name                                          | Type   | Description        |
| --------------------------------------------- | ------ | ------------------ |
| project\_id<mark style="color:red;">\*</mark> | String | ID of your project |

#### Headers

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| LuaShield-API-Key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                          | Type    | Description                                     |
| --------------------------------------------- | ------- | ----------------------------------------------- |
| username<mark style="color:red;">\*</mark>    | String  | Username to give the user                       |
| whitelisted<mark style="color:red;">\*</mark> | Boolean | User is whitelisted?                            |
| discord\_id                                   | String  | Users Discord ID                                |
| max\_executions                               | Int     | Limit users executions                          |
| expire                                        | Int     | Unix Epoch timestamp of when user should expire |
| note                                          | String  | Note to give to the user                        |

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

```json
{
	"id": "8f4cdc8c-b6ad-445a-9701-d27696ea1f72",
	"Key": "91990b05-0030-4626-a38a-d597422aa957",
	"Username": "dsflikesmen2",
	"HWID": null,
	"ProjectID": "3851df88-139e-4e1d-8229-02ed58595e9b",
	"Executions": 0,
	"CrackAttempts": 0,
	"Exploit": null,
	"Whitelisted": true,
	"CreatedAt": "2023-04-10T15:10:52.924Z",
	"ExpireAt": null,
	"MaxExecutions": 0,
	"Note": "dsf",
	"DiscordID": "787086729470541844"
}
```

{% endtab %}

{% tab title="403: Forbidden You don't own this project" %}

```json
{
    "error": "You don't own this project"
}
```

{% endtab %}

{% tab title="402: Payment Required Subscription Expired" %}

```json
{
    "error": "Your subscription has expired"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```json
{
    "error": "Invalid API Key"
}
```

{% endtab %}
{% endtabs %}

## Update User

<mark style="color:purple;">`PATCH`</mark> `https://api.luashield.com/projects/:project_id/users`

Update a user

#### Path Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| project\_id | String | Project ID  |

#### Headers

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| LuaShield-API-Key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                          | Type    | Description                                     |
| --------------------------------------------- | ------- | ----------------------------------------------- |
| username<mark style="color:red;">\*</mark>    | String  | Username of the user                            |
| whitelisted<mark style="color:red;">\*</mark> | Boolean | User is whitelisted?                            |
| expire                                        | Int     | Unix Epoch timestamp of when user should expire |
| max\_executions                               | Int     | Limit users executions                          |
| discord\_id                                   | String  | Users Discord ID                                |
| note                                          | String  | User note                                       |

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

```json
{
	"id": "8f4cdc8c-b6ad-445a-9701-d27696ea1f72",
	"Key": "7be331a58cc2b530e747d896b5557f7e7e884e50fab23f7aca4e1256ccc03fcfa8956fd8a121423990fb67340a1ebc7f9026377fb9099abb23fbc2677185bd5a",
	"Username": "dsflikesmen2",
	"HWID": null,
	"ProjectID": "3851df88-139e-4e1d-8229-02ed58595e9b",
	"Executions": 0,
	"CrackAttempts": 0,
	"Exploit": null,
	"Whitelisted": true,
	"CreatedAt": "2023-04-10T15:10:52.924Z",
	"ExpireAt": 1681222821000,
	"MaxExecutions": 0,
	"Note": "omg updated",
	"DiscordID": "78708672947054184"
}
```

{% endtab %}

{% tab title="403: Forbidden You don't own this project" %}

```json
{
    "error": "You don't own this project"
}
```

{% endtab %}

{% tab title="404: Not Found This user doesn't exist" %}

```json
{
    "error": "This user doesn't exist"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```json
{
    "error": "Invalid API Key"
}
```

{% endtab %}

{% tab title="402: Payment Required Subscription Expired" %}

```json
{
    "error": "Your subscription has expired"
}
```

{% endtab %}
{% endtabs %}

## Delete User

<mark style="color:red;">`DELETE`</mark> `https://api.luashield.com/projects/:project_id/users`

Delete User

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| project\_id<mark style="color:red;">\*</mark> | String | Project ID  |

#### Headers

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| LuaShield-API-Key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                       | Type   | Description                    |
| ------------------------------------------ | ------ | ------------------------------ |
| username<mark style="color:red;">\*</mark> | String | Username of the user to delete |

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

```json
{
    "success": true
}
```

{% endtab %}

{% tab title="403: Forbidden You don't own this project" %}

```json
{
    "error": "You don't own this project"
}
```

{% endtab %}

{% tab title="404: Not Found User doesn't exist" %}

```json
{
    "error": "This user doesn't exist"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API key" %}

```json
{
    "error": "Invalid API Key"
}
```

{% endtab %}

{% tab title="402: Payment Required Subscription Expired" %}

```json
{
    "error": "Your subscription has expired"
}
```

{% endtab %}
{% endtabs %}

## Reset Key

<mark style="color:green;">`POST`</mark> `https://api.luashield.com/projects/:project_id/users/reset_key`

Reset Key

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| project\_id<mark style="color:red;">\*</mark> | String | Project ID  |

#### Headers

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| LuaShield-API-Key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                       | Type   | Description          |
| ------------------------------------------ | ------ | -------------------- |
| username<mark style="color:red;">\*</mark> | String | Username of the user |

{% tabs %}
{% tab title="200: OK Successfully reset users key" %}

```json
{
	"Key": "738a2553-83c7-4b72-a5b3-1b2f2b52faa4"
}
```

{% endtab %}

{% tab title="403: Forbidden You don't own this project" %}

```json
{
    "error": "You don't own this project"
}
```

{% endtab %}

{% tab title="404: Not Found This user doesn't exist" %}

```json
{
    "error": "This user doesn't exist"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```json
{
    "error": "Invalid API Key"
}
```

{% endtab %}

{% tab title="402: Payment Required Subscription Expired" %}

```json
{
    "error": "Your subscription has expired"
}
```

{% endtab %}
{% endtabs %}

## Reset HWID

<mark style="color:green;">`POST`</mark> `https://api.luashield.com/projects/:project_id/users/reset_hwid`

Reset users HWID

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| project\_id<mark style="color:red;">\*</mark> | String | Project ID  |

#### Headers

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| LuaShield-API-Key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                       | Type   | Description          |
| ------------------------------------------ | ------ | -------------------- |
| username<mark style="color:red;">\*</mark> | String | Username of the user |

{% tabs %}
{% tab title="200: OK Successfully reset HWID" %}

```json
{
    "success": true
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

{% endtab %}
{% endtabs %}

##


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://dsf3342.gitbook.io/luashield-documentation/api-documentation/projects/user-management.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.
