{"openapi":"3.1.0","info":{"title":"API NiBoites v1","description":"API publique pour scripter vos bo\u00eetes : bots, monitoring, CI.\n\nCr\u00e9ez un jeton sur ni-boites.fr (Compte \u2192 API), puis envoyez-le dans l\u0027en-t\u00eate `Authorization: Bearer nb_\u2026`.\n\nScopes : `read` (bo\u00eetes + serveurs), `power` (start\/stop\/restart\/kill).\n\nLimite : 60 requ\u00eates\/minute par jeton \u2014 au-del\u00e0, `429` avec `Retry-After`.","version":"1.0.0"},"servers":[{"url":"https:\/\/ni-boites.fr"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"nb_ prefix"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}}},"Boite":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"specs":{"$ref":"#\/components\/schemas\/Specs"}}},"Specs":{"type":"object","properties":{"memoryMb":{"type":"integer"},"cpu":{"type":"integer","description":"pourcentage ; 100 = 1 vCPU"},"diskMb":{"type":"integer"},"maxServers":{"type":"integer"}}},"Server":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"game":{"type":"string","example":"minecraft"},"status":{"type":"string"},"boiteId":{"type":"string","format":"uuid"},"memoryMb":{"type":"integer"},"cpu":{"type":"integer"},"diskMb":{"type":"integer"}}}}},"security":[{"bearerAuth":[]}],"paths":{"\/v1\/me":{"get":{"tags":["identity"],"summary":"Qui suis-je \u2014 identit\u00e9 et scopes du jeton","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Propri\u00e9taire du jeton","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"description":"Jeton manquant ou invalide","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/v1\/boites":{"get":{"tags":["boites"],"summary":"Lister vos bo\u00eetes (poss\u00e9d\u00e9es + partag\u00e9es)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Liste des bo\u00eetes","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Boite"}}}}}}},"401":{"description":"Non autoris\u00e9","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"403":{"description":"Jeton sans le scope read","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/v1\/boites\/{id}\/servers":{"get":{"tags":["boites"],"summary":"Lister les serveurs d\u0027une bo\u00eete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Liste des serveurs","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Server"}}}}}}},"404":{"description":"Bo\u00eete inconnue","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/v1\/servers\/{id}":{"get":{"tags":["servers"],"summary":"D\u00e9tail d\u0027un serveur","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Serveur","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Server"}}}},"404":{"description":"Serveur inconnu","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/v1\/servers\/{id}\/backups":{"get":{"tags":["serveurs"],"summary":"Lister les sauvegardes d\u0027un serveur","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Liste des sauvegardes","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"description":"Jeton manquant ou invalide","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Serveur inconnu","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"post":{"tags":["serveurs"],"summary":"Lancer une sauvegarde","description":"N\u00e9cessite le scope `power` et la permission console. Corps optionnel : `{ \u0022name\u0022: \u0022avant-maj\u0022 }` (100 caract\u00e8res max). La suppression et la restauration restent dans le panel.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100}}}}}},"responses":{"201":{"description":"Sauvegarde lanc\u00e9e","content":{"application\/json":{"schema":{"type":"object"}}}},"403":{"description":"Jeton sans le scope power (ou permission console manquante)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Nom invalide","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"502":{"description":"Refus du backend de jeu (slot de sauvegarde satur\u00e9 ?)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/v1\/servers\/{id}\/command":{"post":{"tags":["serveurs"],"summary":"Envoyer une commande console","description":"N\u00e9cessite le scope `power` et la permission console. Corps : `{ \u0022command\u0022: \u0022say hello\u0022 }` \u2014 une seule ligne, 500 caract\u00e8res max.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"command":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Commande envoy\u00e9e","content":{"application\/json":{"schema":{"type":"object"}}}},"403":{"description":"Jeton sans le scope power (ou permission console manquante)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Commande invalide (vide, multiligne, \u003E 500 caract\u00e8res)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"502":{"description":"Refus du backend de jeu (serveur arr\u00eat\u00e9 ?)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/v1\/servers\/{id}\/power":{"post":{"tags":["servers"],"summary":"Action d\u0027alimentation (start, stop, restart, kill)","description":"N\u00e9cessite le scope `power`. signal : start | stop | restart | kill","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"signal","in":"query","required":true,"schema":{"type":"string","enum":["start","stop","restart","kill"]}}],"responses":{"200":{"description":"Signal envoy\u00e9","content":{"application\/json":{"schema":{"type":"object"}}}},"403":{"description":"Jeton sans le scope power","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Signal invalide","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"502":{"description":"Refus du backend de jeu","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}}}}