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

# Create Share Link

Creates a new public (or org/private) link for an existing conversation. Provide
the `conversationId`, choose `shareType` (`full` versus `partial` with explicit
`messageIds`), and optionally set visibility, expiration, continuation, and
custom copy blocks.

## Request Body

| Field               | Type      | Required | Description                                             |
| ------------------- | --------- | -------- | ------------------------------------------------------- |
| `conversationId`    | string    | ✅        | MongoDB ObjectId of the conversation to share           |
| `shareType`         | string    | ⛔        | `full` (default) or `partial`                           |
| `messageIds`        | string\[] | ⛔        | Required when `shareType` is `partial`                  |
| `visibility`        | string    | ⛔        | `public` (default), `private`, or `organization`        |
| `allowContinuation` | boolean   | ⛔        | Allow viewers to fork the conversation (default: false) |
| `expiresInDays`     | number    | ⛔        | Days until expiration (1-365)                           |
| `customTitle`       | string    | ⛔        | Custom title for the share (max 200 chars)              |
| `customDescription` | string    | ⛔        | Description for the share (max 500 chars)               |


## OpenAPI

````yaml POST /api/v1/share
openapi: 3.1.0
info:
  title: Handa Uncle API
  version: 1.0.0
  description: Public specification for the Handa Uncle web and mobile APIs.
  contact:
    name: Handa Uncle Engineering
    email: hello@handauncle.com
servers:
  - url: https://handauncle-backend-prod-205012263523.asia-south1.run.app
    description: Prod API base (Cloud Run)
  - url: https://api.handauncle.com
    description: Production
  - url: https://staging-api.handauncle.com
    description: Staging
  - url: http://localhost:8080
    description: Local development
security: []
tags:
  - name: Mobile App
    description: Endpoints used by the native Handa Uncle app.
  - name: Platform
    description: Cross-service operational endpoints.
  - name: Auth
    description: Authentication endpoints handled by the backend adapter.
  - name: AI
    description: LLM chat endpoints supporting streaming and device-auth guests.
  - name: OTP
    description: Phone OTP lifecycle powered by Exotel.
  - name: Webhooks
    description: Server-to-server hooks invoked by Auth0.
  - name: Conversations
    description: Authenticated user conversation management.
  - name: Chat Share
    description: Create, manage, and consume shared conversations.
  - name: Files
    description: Upload, list, and delete user files.
  - name: Prompt management
    description: Admin and public APIs for managing masked pre-prompts.
  - name: User Profile
    description: Profile card collection and user data for personalized AI responses.
  - name: Visual Embeds
    description: Manage visual embed images that attach to AI chat responses.
  - name: Second Opinion
    description: Admin and public APIs for Second Opinion suggestion cards.
  - name: Profile Cards
    description: >-
      APIs for managing profile card questions used in onboarding and
      personalization.
paths:
  /api/v1/share:
    post:
      tags:
        - Chat Share
      summary: Create share link
      operationId: createShare
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareCreateRequest'
      responses:
        '200':
          description: Share created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareCreateResponseEnvelope'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    ShareCreateRequest:
      type: object
      required:
        - conversationId
      properties:
        conversationId:
          type: string
        shareType:
          type: string
          enum:
            - full
            - partial
          default: full
        messageIds:
          type: array
          items:
            type: string
        visibility:
          type: string
          enum:
            - public
            - private
            - organization
          default: public
        allowContinuation:
          type: boolean
          default: false
        expires_in_days:
          type: integer
          minimum: 1
          maximum: 365
        customTitle:
          type: string
          maxLength: 200
        customDescription:
          type: string
          maxLength: 500
    ShareCreateResponseEnvelope:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            shareId:
              type: string
            shareUrl:
              type: string
              format: uri
            conversation:
              $ref: '#/components/schemas/SharedConversation'
          required:
            - shareId
            - shareUrl
            - conversation
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      required:
        - success
        - data
        - meta
    SharedConversation:
      type: object
      properties:
        id:
          type: string
        shareId:
          type: string
        userId:
          type: string
        conversationId:
          type: string
        shareType:
          type: string
          enum:
            - full
            - partial
        messageIds:
          type: array
          items:
            type: string
          nullable: true
        visibility:
          type: string
          enum:
            - public
            - private
            - organization
        allowContinuation:
          type: boolean
        customTitle:
          type: string
          nullable: true
        customDescription:
          type: string
          nullable: true
        viewCount:
          type: integer
        lastViewedAt:
          type: string
          format: date-time
          nullable: true
        continuationCount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
          nullable: true
        revokedAt:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - active
            - expired
            - revoked
      required:
        - id
        - shareId
        - userId
        - conversationId
        - shareType
        - visibility
        - allowContinuation
        - viewCount
        - continuationCount
        - createdAt
        - updatedAt
        - status
    ResponseMeta:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        requestId:
          type: string
          description: Server generated correlation identifier.
      required:
        - timestamp
        - requestId
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ErrorObject'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      required:
        - success
        - error
        - meta
    ErrorObject:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message describing the issue.
          example: Please enter a valid 10-digit phone number (e.g., 9876543210)
        code:
          type: string
          description: Error code for programmatic handling.
          example: VALIDATION_ERROR
        details:
          type: array
          description: >-
            Array of field-specific validation errors (for VALIDATION_ERROR
            responses).
          items:
            type: object
            properties:
              field:
                type: string
                description: Field name that failed validation.
                example: phone
              message:
                type: string
                description: Specific validation error message for this field.
                example: Please enter a valid 10-digit phone number (e.g., 9876543210)
            required:
              - field
              - message
      required:
        - message
  responses:
    ValidationError:
      description: The request payload or headers were invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedError:
      description: Authentication failed or is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenError:
      description: Caller is not allowed to access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ConflictError:
      description: Request conflicts with the current resource state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Auth0 access token for registered users.

````