Authorize an immutable Library source upload
Requires current Library authority and tenant ownership. Content directives are full, masked_identifiers or none; masked documents omit protected identity values. Commands accept only their documented JSON keys and reject query-string fields. Required Idempotency-Key is 8-128 URL-safe characters; changed payload under the same key conflicts. Reserves one API-proxied admission, without uploading bytes. Requires storage readiness and current document boundary. Both current-version fields must be present and jointly null or populated. File names cannot contain slashes, backslashes or controls. Google Drive-managed sources reject manual uploads.
curl --request POST \
--url https://api.gratona.com/v1/admin/workspace-library/upload-admissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"document": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_document_record_version": 2,
"expected_current_document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_current_document_version_number": 2
},
"original_file_name": "<string>",
"file_extension": "<string>",
"declared_size_bytes": 4503599627370496,
"intended_document_type": "<string>",
"sensitivity_class": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/workspace-library/upload-admissions"
payload = {
"document": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_document_record_version": 2,
"expected_current_document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_current_document_version_number": 2
},
"original_file_name": "<string>",
"file_extension": "<string>",
"declared_size_bytes": 4503599627370496,
"intended_document_type": "<string>",
"sensitivity_class": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
document: {
document_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expected_document_record_version: 2,
expected_current_document_version_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expected_current_document_version_number: 2
},
original_file_name: '<string>',
file_extension: '<string>',
declared_size_bytes: 4503599627370496,
intended_document_type: '<string>',
sensitivity_class: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/workspace-library/upload-admissions', 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.gratona.com/v1/admin/workspace-library/upload-admissions",
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([
'document' => [
'document_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expected_document_record_version' => 2,
'expected_current_document_version_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expected_current_document_version_number' => 2
],
'original_file_name' => '<string>',
'file_extension' => '<string>',
'declared_size_bytes' => 4503599627370496,
'intended_document_type' => '<string>',
'sensitivity_class' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.gratona.com/v1/admin/workspace-library/upload-admissions"
payload := strings.NewReader("{\n \"document\": {\n \"document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_document_record_version\": 2,\n \"expected_current_document_version_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_current_document_version_number\": 2\n },\n \"original_file_name\": \"<string>\",\n \"file_extension\": \"<string>\",\n \"declared_size_bytes\": 4503599627370496,\n \"intended_document_type\": \"<string>\",\n \"sensitivity_class\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.gratona.com/v1/admin/workspace-library/upload-admissions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_document_record_version\": 2,\n \"expected_current_document_version_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_current_document_version_number\": 2\n },\n \"original_file_name\": \"<string>\",\n \"file_extension\": \"<string>\",\n \"declared_size_bytes\": 4503599627370496,\n \"intended_document_type\": \"<string>\",\n \"sensitivity_class\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-library/upload-admissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {\n \"document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_document_record_version\": 2,\n \"expected_current_document_version_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_current_document_version_number\": 2\n },\n \"original_file_name\": \"<string>\",\n \"file_extension\": \"<string>\",\n \"declared_size_bytes\": 4503599627370496,\n \"intended_document_type\": \"<string>\",\n \"sensitivity_class\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contract_family": "workspace-blob-admission.v1",
"contract_version": "workspace-blob-admission-result.v1",
"outcome": "upload_authorized",
"admission": {
"admission_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"admission_generation": 2
},
"document": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_document_record_version": 2,
"expected_current_document_version_id": "<string>",
"expected_current_document_version_number": "<string>"
},
"upload_session": {
"upload_session_id": "<string>",
"upload_path": "<string>"
},
"admission_policy_sha256": "<string>",
"idempotency_key_sha256": "<string>",
"request_sha256": "<string>",
"result_sha256": "<string>",
"recorded_at": "2023-11-07T05:31:56Z"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Headers
Request key; replay the same key only with the same payload.
8 - 128^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Show child attributes
Show child attributes
Validation: required|string|min:1|max:512.
1 - 512Validation: required|string|min:1|max:32.
1 - 32^[A-Za-z0-9][A-Za-z0-9._+-]*$Validation: required|integer|min:1|max:9007199254740991.
1 <= x <= 9007199254740991Validation: required|string|min:1|max:128.
1 - 128^[A-Za-z0-9][A-Za-z0-9._:-]*$Validation: required|string|min:1|max:128.
1 - 128^[A-Za-z0-9][A-Za-z0-9._:-]*$Response
Authorize an immutable Library source upload response.
workspace-blob-admission.v1 workspace-blob-admission-result.v1 upload_authorized Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
^[a-f0-9]{64}$^[a-f0-9]{64}$^[a-f0-9]{64}$^[a-f0-9]{64}$curl --request POST \
--url https://api.gratona.com/v1/admin/workspace-library/upload-admissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"document": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_document_record_version": 2,
"expected_current_document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_current_document_version_number": 2
},
"original_file_name": "<string>",
"file_extension": "<string>",
"declared_size_bytes": 4503599627370496,
"intended_document_type": "<string>",
"sensitivity_class": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/workspace-library/upload-admissions"
payload = {
"document": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_document_record_version": 2,
"expected_current_document_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_current_document_version_number": 2
},
"original_file_name": "<string>",
"file_extension": "<string>",
"declared_size_bytes": 4503599627370496,
"intended_document_type": "<string>",
"sensitivity_class": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
document: {
document_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expected_document_record_version: 2,
expected_current_document_version_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expected_current_document_version_number: 2
},
original_file_name: '<string>',
file_extension: '<string>',
declared_size_bytes: 4503599627370496,
intended_document_type: '<string>',
sensitivity_class: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/workspace-library/upload-admissions', 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.gratona.com/v1/admin/workspace-library/upload-admissions",
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([
'document' => [
'document_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expected_document_record_version' => 2,
'expected_current_document_version_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expected_current_document_version_number' => 2
],
'original_file_name' => '<string>',
'file_extension' => '<string>',
'declared_size_bytes' => 4503599627370496,
'intended_document_type' => '<string>',
'sensitivity_class' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.gratona.com/v1/admin/workspace-library/upload-admissions"
payload := strings.NewReader("{\n \"document\": {\n \"document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_document_record_version\": 2,\n \"expected_current_document_version_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_current_document_version_number\": 2\n },\n \"original_file_name\": \"<string>\",\n \"file_extension\": \"<string>\",\n \"declared_size_bytes\": 4503599627370496,\n \"intended_document_type\": \"<string>\",\n \"sensitivity_class\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.gratona.com/v1/admin/workspace-library/upload-admissions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_document_record_version\": 2,\n \"expected_current_document_version_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_current_document_version_number\": 2\n },\n \"original_file_name\": \"<string>\",\n \"file_extension\": \"<string>\",\n \"declared_size_bytes\": 4503599627370496,\n \"intended_document_type\": \"<string>\",\n \"sensitivity_class\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-library/upload-admissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {\n \"document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_document_record_version\": 2,\n \"expected_current_document_version_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_current_document_version_number\": 2\n },\n \"original_file_name\": \"<string>\",\n \"file_extension\": \"<string>\",\n \"declared_size_bytes\": 4503599627370496,\n \"intended_document_type\": \"<string>\",\n \"sensitivity_class\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contract_family": "workspace-blob-admission.v1",
"contract_version": "workspace-blob-admission-result.v1",
"outcome": "upload_authorized",
"admission": {
"admission_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"admission_generation": 2
},
"document": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_document_record_version": 2,
"expected_current_document_version_id": "<string>",
"expected_current_document_version_number": "<string>"
},
"upload_session": {
"upload_session_id": "<string>",
"upload_path": "<string>"
},
"admission_policy_sha256": "<string>",
"idempotency_key_sha256": "<string>",
"request_sha256": "<string>",
"result_sha256": "<string>",
"recorded_at": "2023-11-07T05:31:56Z"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}