curl --request POST \
--url https://api.opal.dev/v1/groups/{group_id}/users/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration_minutes": 60,
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
}
'import requests
url = "https://api.opal.dev/v1/groups/{group_id}/users/{user_id}"
payload = {
"duration_minutes": 60,
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
}
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({
duration_minutes: 60,
access_level_remote_id: 'arn:aws:iam::590304332660:role/AdministratorAccess'
})
};
fetch('https://api.opal.dev/v1/groups/{group_id}/users/{user_id}', 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.opal.dev/v1/groups/{group_id}/users/{user_id}",
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([
'duration_minutes' => 60,
'access_level_remote_id' => 'arn:aws:iam::590304332660:role/AdministratorAccess'
]),
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.opal.dev/v1/groups/{group_id}/users/{user_id}"
payload := strings.NewReader("{\n \"duration_minutes\": 60,\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\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://api.opal.dev/v1/groups/{group_id}/users/{user_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration_minutes\": 60,\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/groups/{group_id}/users/{user_id}")
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 \"duration_minutes\": 60,\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n}"
response = http.request(request)
puts response.read_body{
"full_name": "Jake Barnes",
"user_id": "29827fb8-f2dd-4e80-9576-28e31e9934ac",
"group_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"expiration_date": "2022-01-23T04:56:07.000Z",
"email": "jake@company.dev"
}Adds a user to this group.
curl --request POST \
--url https://api.opal.dev/v1/groups/{group_id}/users/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration_minutes": 60,
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
}
'import requests
url = "https://api.opal.dev/v1/groups/{group_id}/users/{user_id}"
payload = {
"duration_minutes": 60,
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
}
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({
duration_minutes: 60,
access_level_remote_id: 'arn:aws:iam::590304332660:role/AdministratorAccess'
})
};
fetch('https://api.opal.dev/v1/groups/{group_id}/users/{user_id}', 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.opal.dev/v1/groups/{group_id}/users/{user_id}",
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([
'duration_minutes' => 60,
'access_level_remote_id' => 'arn:aws:iam::590304332660:role/AdministratorAccess'
]),
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.opal.dev/v1/groups/{group_id}/users/{user_id}"
payload := strings.NewReader("{\n \"duration_minutes\": 60,\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\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://api.opal.dev/v1/groups/{group_id}/users/{user_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration_minutes\": 60,\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/groups/{group_id}/users/{user_id}")
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 \"duration_minutes\": 60,\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n}"
response = http.request(request)
puts response.read_body{
"full_name": "Jake Barnes",
"user_id": "29827fb8-f2dd-4e80-9576-28e31e9934ac",
"group_id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"expiration_date": "2022-01-23T04:56:07.000Z",
"email": "jake@company.dev"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the group.
The ID of the user to add.
Query Parameters
The duration for which the group can be accessed (in minutes). Use 0 to set to indefinite.
x <= 153722867The remote ID of the access level to grant to this user. If omitted, the default access level remote ID value (empty string) is used.
Body
The duration for which the group can be accessed (in minutes). Use 0 to set to indefinite.
60
The remote ID of the access level to grant to this user. If omitted, the default access level remote ID value (empty string) is used.
"arn:aws:iam::590304332660:role/AdministratorAccess"
Response
The GroupUser that was created.
Group Access User Object
Description
The GroupAccessUser object is used to represent a user with access to a group.
Usage Example
Fetch from the LIST GroupUsers endpoint.
The ID of the group.
"1b978423-db0a-4037-a4cf-f79c60cb67b3"
The name of the group.
"API Group"
The description of the group.
"Group required to request API's"
The ID of the user.
"29827fb8-f2dd-4e80-9576-28e31e9934ac"
The user's full name.
"Jake Barnes"
The user's email.
"jake@company.dev"
Access Level Object
Description
The GroupAccessLevel object is used to represent the level of access that a user has to a group or a group has to a group. The "default" access
level is a GroupAccessLevel object whose fields are all empty strings.
Usage Example
View the GroupAccessLevel of a group/user or group/group pair to see the level of access granted to the group.
Show child attributes
Show child attributes
{
"access_level_name": "Developer",
"access_level_remote_id": 20
}
The day and time the user's access will expire.
"2022-01-23T04:56:07.000Z"
The state of whether the push action was propagated to the remote system. If this is null, the access was synced from the remote system.
Show child attributes
Show child attributes
Was this page helpful?