curl --request PUT \
--url https://api.varg.ai/v2/me/connection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"team_id": "0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11",
"workspace_id": null
}
'import requests
url = "https://api.varg.ai/v2/me/connection"
payload = {
"team_id": "0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11",
"workspace_id": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({team_id: '0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11', workspace_id: null})
};
fetch('https://api.varg.ai/v2/me/connection', 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.varg.ai/v2/me/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'team_id' => '0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11',
'workspace_id' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.varg.ai/v2/me/connection"
payload := strings.NewReader("{\n \"team_id\": \"0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11\",\n \"workspace_id\": null\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.varg.ai/v2/me/connection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": \"0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11\",\n \"workspace_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/me/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"team_id\": \"0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11\",\n \"workspace_id\": null\n}"
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"team_id": "<string>",
"team_slug": "<string>",
"team_name": "<string>",
"team_owner": true,
"workspace_id": "<string>",
"status": "ok"
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}Set a connection's team binding
Binds an OAuth connection to a team and optional default folder. Send team_id: null (or omit it)
to move the connection back to the personal account. A connected app can only change its own
binding; an app session must pass client_id in the body. API keys have no connection and get 400.
Returns the stored binding.
curl --request PUT \
--url https://api.varg.ai/v2/me/connection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"team_id": "0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11",
"workspace_id": null
}
'import requests
url = "https://api.varg.ai/v2/me/connection"
payload = {
"team_id": "0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11",
"workspace_id": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({team_id: '0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11', workspace_id: null})
};
fetch('https://api.varg.ai/v2/me/connection', 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.varg.ai/v2/me/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'team_id' => '0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11',
'workspace_id' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.varg.ai/v2/me/connection"
payload := strings.NewReader("{\n \"team_id\": \"0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11\",\n \"workspace_id\": null\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.varg.ai/v2/me/connection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": \"0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11\",\n \"workspace_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/me/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"team_id\": \"0b0a3e0e-1f64-4a6e-9a39-6b2f2f0c6a11\",\n \"workspace_id\": null\n}"
response = http.request(request)
puts response.read_body{
"client_id": "<string>",
"team_id": "<string>",
"team_slug": "<string>",
"team_name": "<string>",
"team_owner": true,
"workspace_id": "<string>",
"status": "ok"
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}Authorizations
varg API key (varg_...). Get one at app.varg.ai
or run bunx vargai login. App sessions may alternatively send a
Supabase JWT.
Body
Response
The stored binding
Which team and default folder an OAuth connection works in.
Null means the personal account.
True when the user owns the bound team (owners manage its API keys; members only spend).
Default folder for the connection, if any.
ok means the binding is usable (team_id: null is the normal personal case).
no_team_access means the user can no longer act in the bound team; clients should refuse to
generate rather than fall back to the personal balance.
ok, no_team_access Was this page helpful?