> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useanima.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Post vaultshare



## OpenAPI

````yaml /openapi.json post /vault/share
openapi: 3.1.1
info:
  title: Anima API
  version: 0.1.0
  description: >-
    The Anima API provides programmatic access to unified infrastructure for AI
    agents: create and manage agents; send and receive email; place phone calls
    and send/receive SMS and voice; store and retrieve vault credentials; manage
    agent identity; and configure webhooks for real-time events. Authenticate
    using a Bearer token or an API key passed via the X-API-Key header.
  contact:
    name: Anima Labs
    url: https://useanima.sh
    email: support@useanima.sh
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.useanima.sh/v1
    description: Production
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /vault/share:
    post:
      operationId: vault.share
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                credentialId:
                  type: string
                  description: ID of the credential to share
                sourceAgentId:
                  anyOf:
                    - type: string
                      pattern: ^[0-9a-z]+$
                    - type: string
                      pattern: ^[cC][^\s-]{8,}$
                  description: Agent that owns the credential
                targetAgentId:
                  anyOf:
                    - type: string
                      pattern: ^[0-9a-z]+$
                    - type: string
                      pattern: ^[cC][^\s-]{8,}$
                  description: Agent to share the credential with
                permission:
                  default: READ
                  enum:
                    - READ
                    - USE
                    - MANAGE
                  type: string
                  description: Permission level for the share
                expiresAt:
                  type: string
                  format: date-time
                  description: Optional expiration time for the share
                expiresInSeconds:
                  type: integer
                  minimum: 1
                  maximum: 31536000
                  description: >-
                    Relative TTL in seconds — alternative to expiresAt. Max 1
                    year.
              required:
                - credentialId
                - sourceAgentId
                - targetAgentId
              description: Input for sharing a credential between agents
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique share record identifier
                  credentialId:
                    type: string
                    description: Shared credential identifier
                  orgId:
                    type: string
                    description: Organization identifier
                  sourceAgentId:
                    type: string
                    description: Agent that owns the credential
                  targetAgentId:
                    type: string
                    description: Agent that received access
                  permission:
                    enum:
                      - READ
                      - USE
                      - MANAGE
                    type: string
                    description: Permission level
                  expiresAt:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                    description: When the share expires
                  grantedBy:
                    type: string
                    description: Who created the share
                  revokedAt:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                    description: When the share was revoked, if applicable
                  createdAt:
                    type: string
                    format: date-time
                    description: Timestamp when the share was created
                  updatedAt:
                    type: string
                    format: date-time
                    description: Timestamp when the share was last updated
                required:
                  - id
                  - credentialId
                  - orgId
                  - sourceAgentId
                  - targetAgentId
                  - permission
                  - expiresAt
                  - grantedBy
                  - revokedAt
                  - createdAt
                  - updatedAt
                description: Credential share record details
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token obtained from authentication. Pass as: Authorization:
        Bearer <token>
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key for programmatic access. Pass as: X-API-Key: <your-key>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.