NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

This documentation is generated automatically.

Introduction

We provide a simple REST API to integrate KeyJoker credit payouts into your business or application.

This API reference provides information on available endpoints and how to interact with them.

API Access

Please note that you need to get whitelisted to use this API. You can write an email to [email protected] to apply for API access.

Errors

All responses that have an HTTP status code that is not in the 200 range are error responses.

Error responses always contain an error message.

Account

API endpoints for managing your own account.

Show account


Requires authentication This endpoint shows your account details, including your current credits balance.

Example request:

curl -X GET -G "https://www.keyjoker.com/api/account" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://www.keyjoker.com/api/account");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 1,
        "name": "Gaben",
        "email": "[email protected]",
        "credits": 9959130
    }
}

HTTP Request

GET api/account

Transactions

API endpoints for managing transactions.

Create transaction


Requires authentication This endpoint allows users to transfer their KeyJoker credits to another user.

Example request:

curl -X POST "https://www.keyjoker.com/api/transactions" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"steamid":76561197972450702,"amount":50000}'
const url = new URL("https://www.keyjoker.com/api/transactions");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "steamid": 76561197972450702,
    "amount": 50000
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (201):

{
    "data": {
        "id": 3137498,
        "type": "User Transaction",
        "amount": -50000
    }
}

Example response (404):

{
    "error": "The user was not found."
}

HTTP Request

POST api/transactions

Body Parameters

Parameter Type Status Description
steamid integer required The steamid64 of the recipient user.
amount integer required The amount of credits to transfer.

Users

API endpoints for managing users.

Show user


Requires authentication This endpoint shows a single user for the provided steamid64.

Example request:

curl -X GET -G "https://www.keyjoker.com/api/users/{steamid}" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://www.keyjoker.com/api/users/{steamid}");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 734821,
        "name": "Gaben"
    }
}

Example response (404):

{
    "error": "The user was not found."
}

HTTP Request

GET api/users/{steamid}