# Get or create a message thread with a studio owner

> Returns the subscriber's owner-chat thread without sending a message. Requires an active subscription with the owner_chat perk.

`POST /p/{handle}/messages/thread`

## OpenAPI

````yaml openapi/agata-v1.yaml post /p/{handle}/messages/thread
openapi: 3.0.3
info:
  title: Agata canonical API
  version: 1.0.0
  description: Canonical contract of the Agata Go API. Every documented route is
    registered in internal/delivery/http/handler.go. Monetary amounts are
    expressed in cents and local date keys use YYYY-MM-DD.
servers:
  - url: http://localhost:{port}/api
    description: Local server
    variables:
      port:
        default: "8080"
        description: Local HTTP port
  - url: "{scheme}://{host}/api"
    description: Configurable server
    variables:
      scheme:
        default: https
        enum:
          - http
          - https
      host:
        default: api.example.com
tags:
  - name: Health check
    description: Health-check operations.
  - name: Users
    description: Users domain operations.
  - name: Profiles
    description: Studio domain operations.
  - name: Organizations
    description: Company accounts that own people and Studios. Not followable.
  - name: Public profiles
    description: Public studio reads and one-way follows. Membership is not required.
  - name: Membership
    description: Studio membership plans, Connect status, and fan subscriptions.
  - name: Messages
    description: 1:1 owner chat between a studio owner and a subscriber with the
      owner_chat perk.
  - name: Feedback
    description: Feedback domain operations.
  - name: Internal system
    description: Internal system operations.
  - name: AI capabilities
    description: Durable leases, outcomes, and reversible effects for integrated AI actions.
  - name: Finance
    description: Finance domain operations.
  - name: Goals
    description: Goals domain operations.
  - name: Pomodoro
    description: Pomodoro domain operations.
  - name: Activities
    description: Activities domain operations.
  - name: Calendar
    description: Calendar domain operations.
  - name: Library
    description: Library domain operations.
  - name: Health
    description: Health domain operations.
  - name: Nutrition
    description: Nutrition domain operations.
  - name: Notebook
    description: Notebook domain operations.
  - name: Week plan
    description: Week-plan domain operations.
  - name: Files
    description: Files domain operations.
  - name: Tags
    description: Tags domain operations.
  - name: Tasks
    description: Tasks domain operations.
  - name: Projects
    description: Projects domain operations.
  - name: Internal
    description: Internal integrations protected by Bearer session.
  - name: Internal cron
    description: Internal cron operations.
paths:
  /p/{handle}/messages/thread:
    post:
      tags:
        - Messages
      operationId: getOrCreatePublicProfileMessageThread
      summary: Get or create a message thread with a studio owner
      description: Returns the subscriber's owner-chat thread without sending a
        message. Requires an active subscription with the owner_chat perk.
      security:
        - sessionBearer: []
      parameters:
        - name: handle
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/MessagesThread"
                  request_id:
                    type: string
                    format: uuid
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
components:
  schemas:
    MessagesUserPreview:
      type: object
      required:
        - userId
      properties:
        userId:
          type: string
          format: uuid
        name:
          type: string
        avatarUrl:
          type: string
    MessagesProfilePreview:
      type: object
      required:
        - studioId
        - handle
        - name
      properties:
        studioId:
          type: string
          format: uuid
        handle:
          type: string
        name:
          type: string
        imageUrl:
          type: string
    MessagesMessage:
      type: object
      required:
        - id
        - threadId
        - senderUserId
        - body
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        threadId:
          type: string
          format: uuid
        senderUserId:
          type: string
          format: uuid
        body:
          type: string
          maxLength: 4000
        createdAt:
          type: string
          format: date-time
    MessagesThread:
      type: object
      required:
        - id
        - profile
        - subscriber
        - owner
        - unreadCount
        - viewerRole
        - subscriptionActive
        - canOwnerChat
        - blocked
        - canSend
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
        profile:
          $ref: "#/components/schemas/MessagesProfilePreview"
        subscriber:
          $ref: "#/components/schemas/MessagesUserPreview"
        owner:
          $ref: "#/components/schemas/MessagesUserPreview"
        lastMessage:
          $ref: "#/components/schemas/MessagesMessage"
        lastMessageAt:
          type: string
          format: date-time
        unreadCount:
          type: integer
        viewerRole:
          type: string
          enum:
            - owner
            - subscriber
        subscriptionActive:
          type: boolean
        canOwnerChat:
          type: boolean
        blocked:
          type: boolean
        canSend:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorDetail:
      type: object
      required:
        - message
      properties:
        code:
          type: string
          example: VALIDATION_ERROR
        message:
          type: string
          example: The request is not valid.
        limit_key:
          type: string
        limit:
          type: integer
        required_plan:
          type: string
          enum:
            - pro
            - business
        resolution:
          type: string
          enum:
            - upgrade_plan
            - purchase_addon
        addon_key:
          type: string
          enum:
            - extra_members
            - ai_credit_packs
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: "#/components/schemas/ErrorDetail"
        request_id:
          type: string
          format: uuid
  responses:
    Unauthorized:
      description: Missing or invalid authentication.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    Forbidden:
      description: Acceso denegado.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    NotFound:
      description: Recurso no encontrado.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
````
