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

# Generate a WebSocket secret

> Creates a new per-member WebSocket secret used to authenticate against the organization realtime activity stream. The plaintext secret is returned ONCE in the response and is never retrievable again — store it immediately. The secret belongs to the calling member; any active member manages their own secrets. The realtime feature is gated on the org's live subscription tier (resolved from the subscription row, not the denormalised cache). Requires a Nevermined API key. Requires active organization membership. Requires the organization to be on the Enterprise tier.



## OpenAPI

````yaml /api-reference/organizations-openapi.json post /organizations/{orgId}/realtime/secrets
openapi: 3.0.0
info:
  title: Nevermined Organizations API
  description: >-
    Manage a Nevermined organization programmatically — members, tiers, groups &
    budgets, treasury wallets, customers, webhooks, analytics, and
    agent-discovery surfaces.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.sandbox.nevermined.app/api/v1
    description: Sandbox
  - url: https://api.live.nevermined.app/api/v1
    description: Live
security: []
tags:
  - name: Organizations
    x-group: General
    description: Organization settings, members & roles, and workspace context.
  - name: Organizations - Billing
    x-group: Billing
    description: Tiers, subscriptions, invoices, checkout, and the public tier catalog.
  - name: Groups
    x-group: Groups & Budgets
    description: Organization groups, per-group budgets, and shared payment methods.
  - name: Organizations - Wallets
    x-group: Wallets
    description: Custodial stablecoin treasury wallets.
  - name: Organizations - Customers
    x-group: Customers
    description: The white-label customer CRM (Enterprise).
  - name: Organizations - Analytics
    x-group: Analytics
    description: Revenue, MRR, usage, conversion, and per-member metrics.
  - name: Organizations - Webhooks
    x-group: Webhooks
    description: Outbound webhook subscriptions and deliveries.
  - name: Organizations - Activity
    x-group: Activity
    description: The organization activity feed.
  - name: Organizations - Realtime
    x-group: Realtime
    description: Realtime WebSocket secret management (Enterprise).
  - name: Invitations
    x-group: Invitations
    description: Invite people to an organization.
  - name: Organizations - Integration
    x-group: Agent Discovery
    description: >-
      Public agent-discovery surfaces (llms.txt, agentic-instructions.md,
      ai-catalog.json).
paths:
  /organizations/{orgId}/realtime/secrets:
    post:
      tags:
        - Organizations - Realtime
      summary: Generate a WebSocket secret
      description: >-
        Creates a new per-member WebSocket secret used to authenticate against
        the organization realtime activity stream. The plaintext secret is
        returned ONCE in the response and is never retrievable again — store it
        immediately. The secret belongs to the calling member; any active member
        manages their own secrets. The realtime feature is gated on the org's
        live subscription tier (resolved from the subscription row, not the
        denormalised cache). Requires a Nevermined API key. Requires active
        organization membership. Requires the organization to be on the
        Enterprise tier.
      operationId: RealtimeSecretsController_create
      parameters:
        - name: orgId
          required: true
          in: path
          description: Organization ID
          schema:
            type: string
            example: org-abc123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWsSecretDto'
      responses:
        '201':
          description: >-
            Secret created. The plaintext secret is included once and never
            again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WsSecretResponseDto'
        '401':
          description: Missing or invalid Nevermined API key
        '403':
          description: >-
            Caller is not a member of the organization, or the org is not on the
            Enterprise tier
      security:
        - Authorization: []
components:
  schemas:
    CreateWsSecretDto:
      type: object
      properties:
        label:
          type: string
          description: Human-readable label for the secret, e.g. "MacBook ops".
          maxLength: 80
          example: MacBook ops
      required:
        - label
    WsSecretResponseDto:
      type: object
      properties:
        id:
          type: string
          example: rts-3f2b…
        label:
          type: string
          example: MacBook ops
        secret:
          type: string
          description: >-
            Plaintext secret — shown ONCE. Copy it now; it is never retrievable
            again.
          example: wss_J8x…
        lastFour:
          type: string
          description: Last 4 chars (the dashboard masks it as wss_…XXXX).
          example: a1B2
        createdAt:
          format: date-time
          type: string
      required:
        - id
        - label
        - secret
        - lastFour
        - createdAt
  securitySchemes:
    Authorization:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

## Related topics

- [Revoke a WebSocket secret](/docs/api-reference/organizations--realtime/revoke-a-websocket-secret.md)
- [Rotate a WebSocket secret](/docs/api-reference/organizations--realtime/rotate-a-websocket-secret.md)
- [List the caller's own WebSocket secrets](/docs/api-reference/organizations--realtime/list-the-callers-own-websocket-secrets.md)
- [Activity & Events](/docs/solutions/organizations/activity-and-events.md)
- [Rotate a webhook signing secret](/docs/api-reference/organizations--webhooks/rotate-a-webhook-signing-secret.md)
