> ## 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 vaultcredentials



## OpenAPI

````yaml /openapi.json post /vault/credentials
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: []
tags:
  - name: Agents
    description: Create and manage AI agents with email and phone capabilities
  - name: Inboxes
    description: Manage email inboxes and their configurations
  - name: Messages
    description: Send, receive, and search email messages
  - name: Webhooks
    description: Register and manage webhook subscriptions for real-time events
  - name: Organizations
    description: Manage organizations and team settings
  - name: Domains
    description: Configure and verify custom email domains
  - name: Phone
    description: Manage phone numbers and SMS/voice capabilities
  - name: Invoices
    description: Track invoices, match receipts, and reconcile payments
  - name: Billing
    description: View usage, tiers, and billing information
  - name: Security
    description: Configure security policies and access controls
  - name: Vault
    description: Store and retrieve encrypted secrets
  - name: API Keys
    description: Create and manage API keys for programmatic access
paths:
  /vault/credentials:
    post:
      operationId: vault.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                agentId:
                  anyOf:
                    - type: string
                      pattern: ^[0-9a-z]+$
                    - type: string
                      pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
                  description: >-
                    Agent identifier. Optional when using an agent API key
                    (resolved automatically); required when using a master key.
                type:
                  enum:
                    - login
                    - secure_note
                    - card
                    - identity
                    - oauth_token
                    - api_key
                    - certificate
                  type: string
                  description: Type of credential to create
                name:
                  type: string
                  minLength: 1
                  description: Display name for the credential
                notes:
                  type: string
                  description: Free-form notes to attach
                login:
                  type: object
                  properties:
                    username:
                      type: string
                      description: Login username or email
                    password:
                      type: string
                      description: Login password
                    uris:
                      type: array
                      items:
                        type: object
                        properties:
                          uri:
                            type: string
                            description: URI associated with the credential
                          match:
                            enum:
                              - domain
                              - host
                              - starts_with
                              - regex
                              - never
                            type: string
                            description: URI matching strategy for auto-fill
                        required:
                          - uri
                        description: URI entry with matching rules for credential auto-fill
                      description: URIs associated with this login
                    totp:
                      type: string
                      description: TOTP secret for two-factor authentication
                  description: Login data, required when type is login
                card:
                  type: object
                  properties:
                    cardholderName:
                      type: string
                      description: Name on the payment card
                    brand:
                      type: string
                      description: Card brand (e.g. Visa, Mastercard)
                    number:
                      type: string
                      description: Full card number
                    expMonth:
                      type: string
                      description: Card expiration month
                    expYear:
                      type: string
                      description: Card expiration year
                    code:
                      type: string
                      description: Card security code (CVV/CVC)
                  description: Card data, required when type is card
                identity:
                  type: object
                  properties:
                    firstName:
                      type: string
                      description: First name
                    lastName:
                      type: string
                      description: Last name
                    email:
                      type: string
                      format: email
                      description: Email address
                    phone:
                      type: string
                      description: Phone number
                    address1:
                      type: string
                      description: Street address
                    city:
                      type: string
                      description: City
                    state:
                      type: string
                      description: State or province
                    postalCode:
                      type: string
                      description: Postal or ZIP code
                    country:
                      type: string
                      description: Country code or name
                    company:
                      type: string
                      description: Company or organization name
                    ssn:
                      type: string
                      description: Social security number
                  description: Identity data, required when type is identity
                oauthToken:
                  type: object
                  properties:
                    provider:
                      type: string
                      description: OAuth provider name (e.g. google, github, slack)
                    accessToken:
                      type: string
                      description: Encrypted OAuth access token
                    refreshToken:
                      type: string
                      description: Encrypted OAuth refresh token
                    tokenEndpoint:
                      type: string
                      description: OAuth token endpoint URL for refreshing tokens
                    clientId:
                      type: string
                      description: Encrypted OAuth client ID
                    clientSecret:
                      type: string
                      description: Encrypted OAuth client secret
                    scopes:
                      type: array
                      items:
                        type: string
                      description: OAuth scopes granted to this token
                    expiresAt:
                      type: string
                      format: date-time
                      description: Token expiration timestamp
                    autoRefresh:
                      default: true
                      type: boolean
                      description: Whether to automatically refresh the token before expiry
                  required:
                    - provider
                    - accessToken
                    - refreshToken
                    - tokenEndpoint
                    - clientId
                    - scopes
                    - expiresAt
                  description: OAuth token data, required when type is oauth_token
                apiKey:
                  type: object
                  properties:
                    provider:
                      type: string
                      description: API provider name (e.g. openai, anthropic, stripe)
                    key:
                      type: string
                      description: Encrypted API key
                    prefix:
                      type: string
                      description: Display prefix for the key (e.g. 'sk-...abc')
                    rateLimit:
                      type: object
                      properties:
                        requests:
                          type: integer
                          minimum: 0
                          description: Maximum number of requests allowed
                        window:
                          type: string
                          description: >-
                            Time window for rate limiting (e.g. '1m', '1h',
                            '1d')
                      required:
                        - requests
                        - window
                      description: Rate limit configuration for this key
                    expiresAt:
                      type: string
                      format: date-time
                      description: Optional key expiration timestamp
                    scopes:
                      type: array
                      items:
                        type: string
                      description: Optional scopes or permissions for this key
                  required:
                    - provider
                    - key
                  description: API key data, required when type is api_key
                certificate:
                  type: object
                  properties:
                    format:
                      enum:
                        - pem
                        - p12
                        - jks
                      type: string
                      description: Certificate format
                    certificate:
                      type: string
                      description: Encrypted certificate content
                    privateKey:
                      type: string
                      description: Encrypted private key
                    chain:
                      type: array
                      items:
                        type: string
                      description: Encrypted certificate chain
                    expiresAt:
                      type: string
                      format: date-time
                      description: Certificate expiration timestamp
                  required:
                    - format
                    - certificate
                    - privateKey
                    - expiresAt
                  description: Certificate data, required when type is certificate
                fields:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: Field name
                      value:
                        type: string
                        description: Field value
                      type:
                        enum:
                          - text
                          - hidden
                          - boolean
                        type: string
                        description: Field display type
                    required:
                      - name
                      - value
                      - type
                    description: Custom key-value field attached to a credential
                  description: Custom fields to attach
                favorite:
                  default: false
                  type: boolean
                  description: Mark the credential as a favorite
                folderId:
                  type: string
                  description: Folder to place the credential in
                organizationId:
                  type: string
                  description: Organization to scope the credential to
                collectionIds:
                  type: array
                  items:
                    type: string
                  description: Collections to share the credential with
              required:
                - type
                - name
              description: Input for creating a new vault credential
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique credential identifier
                  type:
                    enum:
                      - login
                      - secure_note
                      - card
                      - identity
                      - oauth_token
                      - api_key
                      - certificate
                    type: string
                    description: Credential type
                  name:
                    type: string
                    description: User-defined credential name
                  notes:
                    type: string
                    description: Free-form notes attached to the credential
                  login:
                    type: object
                    properties:
                      username:
                        type: string
                        description: Login username or email
                      password:
                        type: string
                        description: Login password
                      uris:
                        type: array
                        items:
                          type: object
                          properties:
                            uri:
                              type: string
                              description: URI associated with the credential
                            match:
                              enum:
                                - domain
                                - host
                                - starts_with
                                - regex
                                - never
                              type: string
                              description: URI matching strategy for auto-fill
                          required:
                            - uri
                          description: >-
                            URI entry with matching rules for credential
                            auto-fill
                        description: URIs associated with this login
                      totp:
                        type: string
                        description: TOTP secret for two-factor authentication
                    description: Login credential data, present when type is login
                  card:
                    type: object
                    properties:
                      cardholderName:
                        type: string
                        description: Name on the payment card
                      brand:
                        type: string
                        description: Card brand (e.g. Visa, Mastercard)
                      number:
                        type: string
                        description: Full card number
                      expMonth:
                        type: string
                        description: Card expiration month
                      expYear:
                        type: string
                        description: Card expiration year
                      code:
                        type: string
                        description: Card security code (CVV/CVC)
                    description: Card credential data, present when type is card
                  identity:
                    type: object
                    properties:
                      firstName:
                        type: string
                        description: First name
                      lastName:
                        type: string
                        description: Last name
                      email:
                        type: string
                        format: email
                        description: Email address
                      phone:
                        type: string
                        description: Phone number
                      address1:
                        type: string
                        description: Street address
                      city:
                        type: string
                        description: City
                      state:
                        type: string
                        description: State or province
                      postalCode:
                        type: string
                        description: Postal or ZIP code
                      country:
                        type: string
                        description: Country code or name
                      company:
                        type: string
                        description: Company or organization name
                      ssn:
                        type: string
                        description: Social security number
                    description: Identity credential data, present when type is identity
                  oauthToken:
                    type: object
                    properties:
                      provider:
                        type: string
                        description: OAuth provider name (e.g. google, github, slack)
                      accessToken:
                        type: string
                        description: Encrypted OAuth access token
                      refreshToken:
                        type: string
                        description: Encrypted OAuth refresh token
                      tokenEndpoint:
                        type: string
                        description: OAuth token endpoint URL for refreshing tokens
                      clientId:
                        type: string
                        description: Encrypted OAuth client ID
                      clientSecret:
                        type: string
                        description: Encrypted OAuth client secret
                      scopes:
                        type: array
                        items:
                          type: string
                        description: OAuth scopes granted to this token
                      expiresAt:
                        type: string
                        format: date-time
                        description: Token expiration timestamp
                      autoRefresh:
                        default: true
                        type: boolean
                        description: >-
                          Whether to automatically refresh the token before
                          expiry
                    required:
                      - provider
                      - accessToken
                      - refreshToken
                      - tokenEndpoint
                      - clientId
                      - scopes
                      - expiresAt
                    description: OAuth token data, present when type is oauth_token
                  apiKey:
                    type: object
                    properties:
                      provider:
                        type: string
                        description: API provider name (e.g. openai, anthropic, stripe)
                      key:
                        type: string
                        description: Encrypted API key
                      prefix:
                        type: string
                        description: Display prefix for the key (e.g. 'sk-...abc')
                      rateLimit:
                        type: object
                        properties:
                          requests:
                            type: integer
                            minimum: 0
                            description: Maximum number of requests allowed
                          window:
                            type: string
                            description: >-
                              Time window for rate limiting (e.g. '1m', '1h',
                              '1d')
                        required:
                          - requests
                          - window
                        description: Rate limit configuration for this key
                      expiresAt:
                        type: string
                        format: date-time
                        description: Optional key expiration timestamp
                      scopes:
                        type: array
                        items:
                          type: string
                        description: Optional scopes or permissions for this key
                    required:
                      - provider
                      - key
                    description: API key data, present when type is api_key
                  certificate:
                    type: object
                    properties:
                      format:
                        enum:
                          - pem
                          - p12
                          - jks
                        type: string
                        description: Certificate format
                      certificate:
                        type: string
                        description: Encrypted certificate content
                      privateKey:
                        type: string
                        description: Encrypted private key
                      chain:
                        type: array
                        items:
                          type: string
                        description: Encrypted certificate chain
                      expiresAt:
                        type: string
                        format: date-time
                        description: Certificate expiration timestamp
                    required:
                      - format
                      - certificate
                      - privateKey
                      - expiresAt
                    description: Certificate data, present when type is certificate
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Field name
                        value:
                          type: string
                          description: Field value
                        type:
                          enum:
                            - text
                            - hidden
                            - boolean
                          type: string
                          description: Field display type
                      required:
                        - name
                        - value
                        - type
                      description: Custom key-value field attached to a credential
                    description: Custom fields attached to the credential
                  favorite:
                    type: boolean
                    description: Whether the credential is marked as a favorite
                  folderId:
                    type: string
                    description: Folder the credential belongs to
                  organizationId:
                    type: string
                    description: Organization the credential is scoped to
                  collectionIds:
                    type: array
                    items:
                      type: string
                    description: Collections the credential is shared with
                  createdAt:
                    type: string
                    format: date-time
                    description: Timestamp when the credential was created
                  updatedAt:
                    type: string
                    format: date-time
                    description: Timestamp when the credential was last updated
                required:
                  - id
                  - type
                  - name
                  - favorite
                  - createdAt
                  - updatedAt
                description: Full credential record returned from the vault
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>'

````