cURL
curl --request POST \
--url https://api.useanima.sh/v1/vault/share \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credentialId": "<string>",
"sourceAgentId": "<string>",
"targetAgentId": "<string>",
"permission": "READ",
"expiresAt": "2023-11-07T05:31:56Z",
"expiresInSeconds": 15768000
}
'import requests
url = "https://api.useanima.sh/v1/vault/share"
payload = {
"credentialId": "<string>",
"sourceAgentId": "<string>",
"targetAgentId": "<string>",
"permission": "READ",
"expiresAt": "2023-11-07T05:31:56Z",
"expiresInSeconds": 15768000
}
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({
credentialId: '<string>',
sourceAgentId: '<string>',
targetAgentId: '<string>',
permission: 'READ',
expiresAt: '2023-11-07T05:31:56Z',
expiresInSeconds: 15768000
})
};
fetch('https://api.useanima.sh/v1/vault/share', 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.useanima.sh/v1/vault/share",
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([
'credentialId' => '<string>',
'sourceAgentId' => '<string>',
'targetAgentId' => '<string>',
'permission' => 'READ',
'expiresAt' => '2023-11-07T05:31:56Z',
'expiresInSeconds' => 15768000
]),
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.useanima.sh/v1/vault/share"
payload := strings.NewReader("{\n \"credentialId\": \"<string>\",\n \"sourceAgentId\": \"<string>\",\n \"targetAgentId\": \"<string>\",\n \"permission\": \"READ\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"expiresInSeconds\": 15768000\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.useanima.sh/v1/vault/share")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credentialId\": \"<string>\",\n \"sourceAgentId\": \"<string>\",\n \"targetAgentId\": \"<string>\",\n \"permission\": \"READ\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"expiresInSeconds\": 15768000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/vault/share")
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 \"credentialId\": \"<string>\",\n \"sourceAgentId\": \"<string>\",\n \"targetAgentId\": \"<string>\",\n \"permission\": \"READ\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"expiresInSeconds\": 15768000\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"credentialId": "<string>",
"orgId": "<string>",
"sourceAgentId": "<string>",
"targetAgentId": "<string>",
"permission": "READ",
"expiresAt": "2023-11-07T05:31:56Z",
"grantedBy": "<string>",
"revokedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}API Reference
Post vaultshare
POST
/
vault
/
share
cURL
curl --request POST \
--url https://api.useanima.sh/v1/vault/share \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credentialId": "<string>",
"sourceAgentId": "<string>",
"targetAgentId": "<string>",
"permission": "READ",
"expiresAt": "2023-11-07T05:31:56Z",
"expiresInSeconds": 15768000
}
'import requests
url = "https://api.useanima.sh/v1/vault/share"
payload = {
"credentialId": "<string>",
"sourceAgentId": "<string>",
"targetAgentId": "<string>",
"permission": "READ",
"expiresAt": "2023-11-07T05:31:56Z",
"expiresInSeconds": 15768000
}
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({
credentialId: '<string>',
sourceAgentId: '<string>',
targetAgentId: '<string>',
permission: 'READ',
expiresAt: '2023-11-07T05:31:56Z',
expiresInSeconds: 15768000
})
};
fetch('https://api.useanima.sh/v1/vault/share', 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.useanima.sh/v1/vault/share",
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([
'credentialId' => '<string>',
'sourceAgentId' => '<string>',
'targetAgentId' => '<string>',
'permission' => 'READ',
'expiresAt' => '2023-11-07T05:31:56Z',
'expiresInSeconds' => 15768000
]),
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.useanima.sh/v1/vault/share"
payload := strings.NewReader("{\n \"credentialId\": \"<string>\",\n \"sourceAgentId\": \"<string>\",\n \"targetAgentId\": \"<string>\",\n \"permission\": \"READ\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"expiresInSeconds\": 15768000\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.useanima.sh/v1/vault/share")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credentialId\": \"<string>\",\n \"sourceAgentId\": \"<string>\",\n \"targetAgentId\": \"<string>\",\n \"permission\": \"READ\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"expiresInSeconds\": 15768000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/vault/share")
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 \"credentialId\": \"<string>\",\n \"sourceAgentId\": \"<string>\",\n \"targetAgentId\": \"<string>\",\n \"permission\": \"READ\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"expiresInSeconds\": 15768000\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"credentialId": "<string>",
"orgId": "<string>",
"sourceAgentId": "<string>",
"targetAgentId": "<string>",
"permission": "READ",
"expiresAt": "2023-11-07T05:31:56Z",
"grantedBy": "<string>",
"revokedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
BearerAuthApiKeyAuth
JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer
Body
application/json
Input for sharing a credential between agents
ID of the credential to share
Agent that owns the credential
Pattern:
^[0-9a-z]+$Agent to share the credential with
Pattern:
^[0-9a-z]+$Permission level for the share
Available options:
READ, USE, MANAGE Optional expiration time for the share
Relative TTL in seconds — alternative to expiresAt. Max 1 year.
Required range:
1 <= x <= 31536000Response
200 - application/json
OK
Credential share record details
Unique share record identifier
Shared credential identifier
Organization identifier
Agent that owns the credential
Agent that received access
Permission level
Available options:
READ, USE, MANAGE When the share expires
Who created the share
When the share was revoked, if applicable
Timestamp when the share was created
Timestamp when the share was last updated
