# Ranker

{% hint style="warning" %}
**Important:** Only work with whitelisted games and authorized API keys. Misuse can lead to failed requests or security issues.
{% endhint %}

### **Endpoint URL**

```
POST https://api.panora.cc/v1/ranker?placeid=<PLACE_ID>
```

* `placeid` → The **Roblox Place ID** where the rank promotion is being triggered.

***

### **Headers**

| Header        | Value                   | Required |
| ------------- | ----------------------- | -------- |
| Authorization | `Bearer <YOUR_API_KEY>` | ✅ Yes    |
| Content-Type  | `application/json`      | ✅ Yes    |

***

### **Request Body**

The request body must be a JSON object with the following fields:

| Field      | Type   | Description                                                 |
| ---------- | ------ | ----------------------------------------------------------- |
| rankerName | string | Name of the user performing the rank action                 |
| rankerId   | number | Roblox User ID of the ranker                                |
| rankeeName | string | Name of the user being promoted                             |
| rankeeId   | number | Roblox User ID of the rankee                                |
| newRankId  | number | ID of the new rank being assigned                           |
| command    | string | Optional description or system name (e.g., “Points System”) |

**Example Request Body:**

```json
{
  "rankerName": "BuyABmw",
  "rankerId": 2691895016,
  "rankeeName": "Tivarie",
  "rankeeId": 1028245588,
  "newRankId": 120,
  "command": "Points System"
}
```

***

### **Example Usage in Roblox Lua**

```lua
local HttpService = game:GetService("HttpService")

local rankData = {
  rankerName = player.Name,
  rankerId = player.UserId,
  rankeeName = player.Name,
  rankeeId = player.UserId,
  newRankId = rankId,
  command = "Points System"
}

local success, response = pcall(function()
  return HttpService:RequestAsync({
    Url = "https://api.panora.cc/v1/ranker?placeid=" .. game.GameId,
    Method = "POST",
    Headers = {
      ["Authorization"] = "Bearer APIKEY",
      ["Content-Type"] = "application/json"
    },
    Body = HttpService:JSONEncode(rankData)
  })
end)

if success then
    print("Rank updated successfully:", response.Body)
else
    warn("Failed to update rank:", response)
end
```

> 🔐 **Tip:** Replace `"APIKEY"` with your Elite Plan API key. Ensure your game is whitelisted in the Panora Dashboard.

***

### **Response**

A successful response returns a JSON object confirming the rank promotion:

```json
{
  "success": true,
  "message": "Rank updated successfully",
  "rankeeId": 87654321,
  "newRankId": 120
}
```

If the request fails, the API will return a descriptive error message with the appropriate HTTP status code.

***

### **Notes**

* Only one rank change per request is allowed.
* Ensure the `newRankId` corresponds to a valid rank in your Roblox group.
* Include the correct `placeid` to match your whitelisted game.
* Always handle responses using `pcall` or equivalent error handling in Lua.


---

# 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://docs.panora.cc/api/endpoints/ranker.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.
