Each request has to contain an apikey generated by CTFPad as HTTP header
field X-Apikey
Returns the username to the provided apikey
Response body:
{
"username": "username"
}
Returns the scope of the current user
Response body:
{
"scope": 1
}
Sets the scope of the current user
Request body:
{
"scope": 2
}
Response body:
{
"scope": 2
}
Sets the scope of the current user to the newest CTF
Response body:
{
"scope": 4
}
Lists all available CTFs
Response body:
{
"ctfs": [ {
"id": 1,
"name": "some ctf"
}, {
"id": 2,
"name": "anyCTF"
} ]
}
Creates a new CTF with the given name
Request body:
{
"name": "new CTF"
}
Response body:
{
"ctf": {
"id": 3,
"name": "new CTF"
}
}
Returns details about a specific CTF by id
Response body:
{
"ctf": {
"id": 2,
"name": "anyCTF"
}
}
Lists challenges for a specific CTF
Response body:
{
"challenges": [ {
"id": 1,
"title": "random web",
"category": "web",
"points": 100,
"done": false
}, {
"id": 2,
"title": "crypto awesome"
"category": "crypto",
"points": 250,
"done": true
} ]
}
Creates a new challenge for a CTF
Request body:
{
"challenge": {
"title": "new chal",
"category": "reversing",
"points": 300
}
}
Response body:
{
"challenge": {
"id": 3,
"title": "new chal",
"category": "reversing",
"points": 300,
"done": false
}
}
Lists all available files for a ctf
Response body:
{
"files": [ {
"id": "4fb15f2bac64cccd6470753b9333534f2065ed14aca439043399a267cba7c6fb",
"name": "test.py",
"user": "stratumauhuur",
"path": "/files/4fb15f2bac64cccd6470753b9333534f2065ed14aca439043399a267cba7c6fb/test.py"
} ]
}
Upload a file for a ctf
Request body:
{
"files": @file
}
Response body:
{
"success": true,
"id": "4a1da276d9cd0d245d6d186dc28148e2bc8c10b8aa19bdfeaf2e5d9dcc0ecd22"
}
Returns details about a specific challenge
Response body:
{
"challenge": {
"id": 3,
"title": "new chal",
"category": "reversing",
"points": 300,
"done": false,
"ctf": 1
"filecount": 2,
"assigned": [
"stratumauhuur"
]
}
}
Assigns the current user to the specified challenge
Response body:
{
"assigned": [
"stratumauhuur",
"username"
]
}
Unassigns the current user from the specified challenge
Response body:
{
"assgined": [
"stratumauhuur"
]
}
Marks the challenge as done
Marks the challenge as not done
Lists the files for a specific challenge
Response body:
{
"files": [ {
"id": "4fb15f2bac64cccd6470753b9333534f2065ed14aca439043399a267cba7c6fb",
"name": "test.py",
"user": "stratumauhuur",
"path": "/files/4fb15f2bac64cccd6470753b9333534f2065ed14aca439043399a267cba7c6fb/test.py"
} ]
}
Upload a file for a challenge
Request body:
{
"files": @file
}
Response body:
{
"success": true,
"id": "4a1da276d9cd0d245d6d186dc28148e2bc8c10b8aa19bdfeaf2e5d9dcc0ecd22"
}