Rybbit
Teams

Create Team

Creates a team in an organization. Requires admin/owner role.

POST /api/organizations/:organizationId/teams

Creates a team in an organization. Requires admin/owner role.

Path Parameters

Prop

Type

Request Body

Prop

Type

Response

Returns the created team with HTTP 201.

Prop

Type

Request
curl -X POST "https://app.rybbit.io/api/organizations/org_abc123/teams" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Marketing", "memberUserIds": ["user_123"], "siteIds": [123]}'
Request
const organizationId = 'org_abc123';
const response = await fetch(
  `https://app.rybbit.io/api/organizations/${organizationId}/teams`,
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Marketing',
      memberUserIds: ['user_123'],
      siteIds: [123]
    })
  }
);

const data = await response.json();
Request
import requests

organization_id = 'org_abc123'
response = requests.post(
    f'https://app.rybbit.io/api/organizations/{organization_id}/teams',
    json={
        'name': 'Marketing',
        'memberUserIds': ['user_123'],
        'siteIds': [123]
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$organizationId = 'org_abc123';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://app.rybbit.io/api/organizations/{$organizationId}/teams");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'name' => 'Marketing',
    'memberUserIds' => ['user_123'],
    'siteIds' => [123]
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer your_api_key_here',
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
Request
require 'net/http'
require 'json'

organization_id = 'org_abc123'
uri = URI("https://app.rybbit.io/api/organizations/#{organization_id}/teams")
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
req['Content-Type'] = 'application/json'
req.body = {
  name: 'Marketing',
  memberUserIds: ['user_123'],
  siteIds: [123]
}.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
Request
organizationId := "org_abc123"
body := bytes.NewBuffer([]byte(`{
  "name": "Marketing",
  "memberUserIds": ["user_123"],
  "siteIds": [123]
}`))
req, _ := http.NewRequest("POST", "https://app.rybbit.io/api/organizations/"+organizationId+"/teams", body)
req.Header.Set("Authorization", "Bearer your_api_key_here")
req.Header.Set("Content-Type", "application/json")

client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()

var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
Request
let organization_id = "org_abc123";
let client = reqwest::Client::new();
let res = client
    .post(format!("https://app.rybbit.io/api/organizations/{}/teams", organization_id))
    .header("Authorization", "Bearer your_api_key_here")
    .json(&serde_json::json!({
        "name": "Marketing",
        "memberUserIds": ["user_123"],
        "siteIds": [123]
    }))
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
String organizationId = "org_abc123";
HttpClient client = HttpClient.newHttpClient();
String json = "{\"name\": \"Marketing\", \"memberUserIds\": [\"user_123\"], \"siteIds\": [123]}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/organizations/" + organizationId + "/teams"))
    .header("Authorization", "Bearer your_api_key_here")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
var organizationId = "org_abc123";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");

var content = new StringContent(
    "{\"name\": \"Marketing\", \"memberUserIds\": [\"user_123\"], \"siteIds\": [123]}",
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync($"https://app.rybbit.io/api/organizations/{organizationId}/teams", content);
var data = await response.Content.ReadAsStringAsync();
Response
{
  "id": "team_xyz789",
  "name": "Marketing",
  "organizationId": "org_abc123",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "members": ["user_123"],
  "siteIds": [123]
}