Tournaments
Create Tournament
Create a tournament
POST
/
tournament
/
create
Create a tournament
curl --request POST \
--url https://api.nexra.xyz/tournament/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"name": "Battle of Nexra",
"description": "An intense tournament for top gamers",
"entryFee": 50,
"startTime": "2025-11-10T18:00:00Z",
"endTime": "2025-11-10T21:00:00Z"
}
'import requests
url = "https://api.nexra.xyz/tournament/create"
payload = {
"name": "Battle of Nexra",
"description": "An intense tournament for top gamers",
"entryFee": 50,
"startTime": "2025-11-10T18:00:00Z",
"endTime": "2025-11-10T21:00:00Z"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Battle of Nexra',
description: 'An intense tournament for top gamers',
entryFee: 50,
startTime: '2025-11-10T18:00:00Z',
endTime: '2025-11-10T21:00:00Z'
})
};
fetch('https://api.nexra.xyz/tournament/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nexra.xyz/tournament/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Battle of Nexra',
'description' => 'An intense tournament for top gamers',
'entryFee' => 50,
'startTime' => '2025-11-10T18:00:00Z',
'endTime' => '2025-11-10T21:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nexra.xyz/tournament/create"
payload := strings.NewReader("{\n \"name\": \"Battle of Nexra\",\n \"description\": \"An intense tournament for top gamers\",\n \"entryFee\": 50,\n \"startTime\": \"2025-11-10T18:00:00Z\",\n \"endTime\": \"2025-11-10T21:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nexra.xyz/tournament/create")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Battle of Nexra\",\n \"description\": \"An intense tournament for top gamers\",\n \"entryFee\": 50,\n \"startTime\": \"2025-11-10T18:00:00Z\",\n \"endTime\": \"2025-11-10T21:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexra.xyz/tournament/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Battle of Nexra\",\n \"description\": \"An intense tournament for top gamers\",\n \"entryFee\": 50,\n \"startTime\": \"2025-11-10T18:00:00Z\",\n \"endTime\": \"2025-11-10T21:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"schema": {
"message": "Tournament created successfully",
"tournament": {
"game": {
"_id": "68f9ce6d27a07cdb23dd65c7",
"name": "Battle Arenaa",
"id": "68f9ce6d27a07cdb23dd65c7"
},
"name": "Battle of Nexra",
"description": "An intense tournament for top gamers",
"entryFee": 50,
"prizePool": 0,
"status": "pending",
"startTime": "2025-11-10T18:00:00.000Z",
"endTime": "2025-11-10T21:00:00.000Z",
"winner": null,
"_id": "68fa2b750366dd5ff66d599d",
"createdAt": "2025-10-23T13:19:49.620Z",
"updatedAt": "2025-10-23T13:19:49.620Z",
"id": "68fa2b750366dd5ff66d599d"
}
}
}Headers
Game API key for authentication
Example:
"abc123xyz456"
Body
application/json
Tournament name
Example:
"Battle of Nexra"
Tournament description
Example:
"An intense tournament for top gamers"
Gamers entry fee for the tournament
Example:
50
Tournament start time
Example:
"2025-11-10T18:00:00Z"
Tournament end time
Example:
"2025-11-10T21:00:00Z"
Response
201 - application/json
Tournament created successfully
⌘I
Create a tournament
curl --request POST \
--url https://api.nexra.xyz/tournament/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"name": "Battle of Nexra",
"description": "An intense tournament for top gamers",
"entryFee": 50,
"startTime": "2025-11-10T18:00:00Z",
"endTime": "2025-11-10T21:00:00Z"
}
'import requests
url = "https://api.nexra.xyz/tournament/create"
payload = {
"name": "Battle of Nexra",
"description": "An intense tournament for top gamers",
"entryFee": 50,
"startTime": "2025-11-10T18:00:00Z",
"endTime": "2025-11-10T21:00:00Z"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Battle of Nexra',
description: 'An intense tournament for top gamers',
entryFee: 50,
startTime: '2025-11-10T18:00:00Z',
endTime: '2025-11-10T21:00:00Z'
})
};
fetch('https://api.nexra.xyz/tournament/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nexra.xyz/tournament/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Battle of Nexra',
'description' => 'An intense tournament for top gamers',
'entryFee' => 50,
'startTime' => '2025-11-10T18:00:00Z',
'endTime' => '2025-11-10T21:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nexra.xyz/tournament/create"
payload := strings.NewReader("{\n \"name\": \"Battle of Nexra\",\n \"description\": \"An intense tournament for top gamers\",\n \"entryFee\": 50,\n \"startTime\": \"2025-11-10T18:00:00Z\",\n \"endTime\": \"2025-11-10T21:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nexra.xyz/tournament/create")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Battle of Nexra\",\n \"description\": \"An intense tournament for top gamers\",\n \"entryFee\": 50,\n \"startTime\": \"2025-11-10T18:00:00Z\",\n \"endTime\": \"2025-11-10T21:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexra.xyz/tournament/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Battle of Nexra\",\n \"description\": \"An intense tournament for top gamers\",\n \"entryFee\": 50,\n \"startTime\": \"2025-11-10T18:00:00Z\",\n \"endTime\": \"2025-11-10T21:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"schema": {
"message": "Tournament created successfully",
"tournament": {
"game": {
"_id": "68f9ce6d27a07cdb23dd65c7",
"name": "Battle Arenaa",
"id": "68f9ce6d27a07cdb23dd65c7"
},
"name": "Battle of Nexra",
"description": "An intense tournament for top gamers",
"entryFee": 50,
"prizePool": 0,
"status": "pending",
"startTime": "2025-11-10T18:00:00.000Z",
"endTime": "2025-11-10T21:00:00.000Z",
"winner": null,
"_id": "68fa2b750366dd5ff66d599d",
"createdAt": "2025-10-23T13:19:49.620Z",
"updatedAt": "2025-10-23T13:19:49.620Z",
"id": "68fa2b750366dd5ff66d599d"
}
}
}