Skip to main content
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
}
'
{
  "id": "<string>",
  "credentialId": "<string>",
  "orgId": "<string>",
  "sourceAgentId": "<string>",
  "targetAgentId": "<string>",
  "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

Authorization
string
header
required

JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer

Body

application/json

Input for sharing a credential between agents

credentialId
string
required

ID of the credential to share

sourceAgentId
required

Agent that owns the credential

Pattern: ^[0-9a-z]+$
targetAgentId
required

Agent to share the credential with

Pattern: ^[0-9a-z]+$
permission
enum<string>
default:READ

Permission level for the share

Available options:
READ,
USE,
MANAGE
expiresAt
string<date-time>

Optional expiration time for the share

expiresInSeconds
integer

Relative TTL in seconds — alternative to expiresAt. Max 1 year.

Required range: 1 <= x <= 31536000

Response

200 - application/json

OK

Credential share record details

id
string
required

Unique share record identifier

credentialId
string
required

Shared credential identifier

orgId
string
required

Organization identifier

sourceAgentId
string
required

Agent that owns the credential

targetAgentId
string
required

Agent that received access

permission
enum<string>
required

Permission level

Available options:
READ,
USE,
MANAGE
expiresAt
string<date-time> | null
required

When the share expires

grantedBy
string
required

Who created the share

revokedAt
string<date-time> | null
required

When the share was revoked, if applicable

createdAt
string<date-time>
required

Timestamp when the share was created

updatedAt
string<date-time>
required

Timestamp when the share was last updated