Disk Users
Add Disk User
Adds an authorized user to a disk. Users can authenticate via:
- token: A shared token with a nickname and 4-character suffix
- awssts: AWS STS role assumption with an IAM principal ARN
POST
/
api
/
disks
/
{id}
/
users
Add user to disk
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users"
payload = {
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'token',
nickname: '<string>',
principal: '<string>',
tokenSuffix: '<string>'
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users', 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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users",
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([
'type' => 'token',
'nickname' => '<string>',
'principal' => '<string>',
'tokenSuffix' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users"
payload := strings.NewReader("{\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"principal": "<string>",
"nickname": "<string>",
"tokenSuffix": "<string>",
"token": "<string>",
"identifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}Authorizations
API key
Path Parameters
Disk ID (format dsk-{16 hex chars})
Pattern:
^dsk-[0-9a-f]{16}$Example:
"dsk-0123456789abcdef"
Body
application/json
- Option 1
- Option 2
Available options:
token Maximum string length:
255Deprecated. Client-provided token. If omitted, the server generates a cryptographically secure token and returns it in the response.
Maximum string length:
2048Deprecated. Last 4 characters of the token. Required when principal is provided; ignored when the server generates the token.
Required string length:
4Was this page helpful?
⌘I
Add user to disk
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users"
payload = {
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'token',
nickname: '<string>',
principal: '<string>',
tokenSuffix: '<string>'
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users', 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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users",
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([
'type' => 'token',
'nickname' => '<string>',
'principal' => '<string>',
'tokenSuffix' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users"
payload := strings.NewReader("{\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"principal": "<string>",
"nickname": "<string>",
"tokenSuffix": "<string>",
"token": "<string>",
"identifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}