Vast.ai API
Team

invite team member

1min
code examples curl location 'https //console vast ai/api/v0/team/invite/' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "email" "", "role" "" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "email" "", "role" "" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //console vast ai/api/v0/team/invite/", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //console vast ai/api/v0/team/invite/") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "email" "", "role" "" }) response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/team/invite/" payload = json dumps({ "email" "", "role" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // invitation sent successfully { "msg" "new invitation sent to ${email}" }// bad request { "msg" "" }// forbidden user not authenticated { "success" false, "error" "", "msg" "" }// team metadata not found { "msg" "team metadata not found" }// too many requests duplicate invitation { "msg" "error invitation already sent to user\@example com only 300 seconds ago " }