Grant a user or organization Model API access
Add a user or organization as Owner, Editor, Operator, or Viewer. Organizations may be Owners. Set isOrganization to true for an organization id and false for a user id; Domino does not look up the id to confirm the type or that the principal exists.
If that id is already assigned (user or organization), the request fails. Use PUT to change an existing role. Do not use this endpoint to change public vs private visibility. Only current Owners can add collaborators.
Related:
- GET /api/modelServing/beta/modelApis//collaborators (list after the change)
- PUT /api/modelServing/beta/modelApis//collaborators/ (change an existing role)
- DELETE /api/modelServing/beta/modelApis//collaborators/ (revoke access)
curl --request POST \
--url https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"id": "507f1f77bcf86cd799439011",
"isOrganization": false,
"role": "Operator"
}
'import requests
url = "https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators"
payload = {
"id": "507f1f77bcf86cd799439011",
"isOrganization": False,
"role": "Operator"
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '507f1f77bcf86cd799439011', isOrganization: false, role: 'Operator'})
};
fetch('https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators', 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://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators",
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([
'id' => '507f1f77bcf86cd799439011',
'isOrganization' => false,
'role' => 'Operator'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$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://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators"
payload := strings.NewReader("{\n \"id\": \"507f1f77bcf86cd799439011\",\n \"isOrganization\": false,\n \"role\": \"Operator\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<api-key>")
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://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"507f1f77bcf86cd799439011\",\n \"isOrganization\": false,\n \"role\": \"Operator\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"507f1f77bcf86cd799439011\",\n \"isOrganization\": false,\n \"role\": \"Operator\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"isOrganization": true,
"role": "Owner"
}Authorizations
Path Parameters
Model API id (24-character hex). Obtain from GET /api/modelServing/v1/modelApis or the Model API details URL.
Body
Domino user or organization id (24-character hex ObjectId). This pattern applies
to GET, POST, and PUT because they share this schema. Responses use the same
shape: stored collaborator refs are Mongo ObjectIds, so non-hex ids are not
returned. Copy id from GET /api/modelServing/beta/modelApis/{modelApiId}/collaborators,
or use a user or organization id from the Domino UI. Set isOrganization to match
the type; Domino does not look up the id to confirm it exists.
^[0-9a-fA-F]{24}$Whether id identifies an organization.
Collaborator role. Management APIs accept Owner, Editor, Operator, and Viewer.
Owner, Editor, Operator, Viewer Response
The newly created collaborator.
Domino user or organization id (24-character hex ObjectId). This pattern applies
to GET, POST, and PUT because they share this schema. Responses use the same
shape: stored collaborator refs are Mongo ObjectIds, so non-hex ids are not
returned. Copy id from GET /api/modelServing/beta/modelApis/{modelApiId}/collaborators,
or use a user or organization id from the Domino UI. Set isOrganization to match
the type; Domino does not look up the id to confirm it exists.
^[0-9a-fA-F]{24}$Whether id identifies an organization.
Collaborator role. Management APIs accept Owner, Editor, Operator, and Viewer.
Owner, Editor, Operator, Viewer Was this page helpful?
curl --request POST \
--url https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"id": "507f1f77bcf86cd799439011",
"isOrganization": false,
"role": "Operator"
}
'import requests
url = "https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators"
payload = {
"id": "507f1f77bcf86cd799439011",
"isOrganization": False,
"role": "Operator"
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '507f1f77bcf86cd799439011', isOrganization: false, role: 'Operator'})
};
fetch('https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators', 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://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators",
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([
'id' => '507f1f77bcf86cd799439011',
'isOrganization' => false,
'role' => 'Operator'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$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://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators"
payload := strings.NewReader("{\n \"id\": \"507f1f77bcf86cd799439011\",\n \"isOrganization\": false,\n \"role\": \"Operator\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<api-key>")
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://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"507f1f77bcf86cd799439011\",\n \"isOrganization\": false,\n \"role\": \"Operator\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/modelServing/beta/modelApis/{modelApiId}/collaborators")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"507f1f77bcf86cd799439011\",\n \"isOrganization\": false,\n \"role\": \"Operator\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"isOrganization": true,
"role": "Owner"
}