import requests
cookie = "COOKIE HERE"
session = requests.session()
session.cookies[".ROBLOSECURITY"] = cookie
def createBadge(id):
data = {
"name": "test",
"description": "test badge",
"enabled": True,
"iconImageId": 11154174324,
"expectedCost": 0
}
output = session.post(f"https://badges.roblox.com/v1/universes/{id}/badges", data=data)
print(output.text)
createBadge(3944841252)
That error means that you have to include the "x-csrf-token" header. To obtain the token you firstly need to make a request fail and it will be in the response headers.