Create a SCIM organization role mapping
curl --request POST \
--url https://openrouter.ai/api/v1/scim/organization-role-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "member",
"scim_group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://openrouter.ai/api/v1/scim/organization-role-mappings"
payload = {
"role": "member",
"scim_group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'member', scim_group_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://openrouter.ai/api/v1/scim/organization-role-mappings', 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://openrouter.ai/api/v1/scim/organization-role-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'role' => 'member',
'scim_group_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://openrouter.ai/api/v1/scim/organization-role-mappings"
payload := strings.NewReader("{\n \"role\": \"member\",\n \"scim_group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://openrouter.ai/api/v1/scim/organization-role-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"member\",\n \"scim_group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/scim/organization-role-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"role\": \"member\",\n \"scim_group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": "2025-08-24T10:30:00.000Z",
"id": "scimgrm_2abc123",
"precedence": 1,
"role": "member",
"scim_group_display_name": "Engineering",
"scim_group_id": "550e8400-e29b-41d4-a716-446655440000",
"updated_at": "2025-08-24T10:30:00.000Z"
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 409,
"message": "Resource conflict. Please try again later."
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}SCIM
Create a SCIM organization role mapping
Map a SCIM group to an organization role (admin or member). Members of the group receive that organization role on their next SCIM sync. Organization role mapping must be enabled for the SCIM directory in the dashboard; otherwise writes return 409. Management key required.
POST
/
scim
/
organization-role-mappings
Create a SCIM organization role mapping
curl --request POST \
--url https://openrouter.ai/api/v1/scim/organization-role-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "member",
"scim_group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://openrouter.ai/api/v1/scim/organization-role-mappings"
payload = {
"role": "member",
"scim_group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'member', scim_group_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://openrouter.ai/api/v1/scim/organization-role-mappings', 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://openrouter.ai/api/v1/scim/organization-role-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'role' => 'member',
'scim_group_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://openrouter.ai/api/v1/scim/organization-role-mappings"
payload := strings.NewReader("{\n \"role\": \"member\",\n \"scim_group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://openrouter.ai/api/v1/scim/organization-role-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"member\",\n \"scim_group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/scim/organization-role-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"role\": \"member\",\n \"scim_group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": "2025-08-24T10:30:00.000Z",
"id": "scimgrm_2abc123",
"precedence": 1,
"role": "member",
"scim_group_display_name": "Engineering",
"scim_group_id": "550e8400-e29b-41d4-a716-446655440000",
"updated_at": "2025-08-24T10:30:00.000Z"
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 409,
"message": "Resource conflict. Please try again later."
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}Body
application/json
Response
SCIM organization role mapping created
Was this page helpful?