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

# Create Voting Session

> Create a shareable voting session for an experiment.

Only experiment owner/team members can create sessions.
Returns a unique token that can be used to generate a shareable voting link.



## OpenAPI

````yaml /openapi.json post /v1/experiments/{experiment_id}/voting-sessions
openapi: 3.1.0
info:
  description: Customer-owned evaluation lifecycle API.
  title: HeyBee Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.heybee.app
security: []
paths:
  /v1/experiments/{experiment_id}/voting-sessions:
    post:
      tags:
        - Voting Sessions
      summary: Create Voting Session
      description: >-
        Create a shareable voting session for an experiment.


        Only experiment owner/team members can create sessions.

        Returns a unique token that can be used to generate a shareable voting
        link.
      operationId: >-
        create_voting_session_v1_experiments__experiment_id__voting_sessions_post
      parameters:
        - in: path
          name: experiment_id
          required: true
          schema:
            format: uuid
            title: Experiment Id
            type: string
        - in: header
          name: Idempotency-Key
          required: false
          schema:
            anyOf:
              - maxLength: 255
                type: string
              - type: 'null'
            title: Idempotency-Key
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VotingSessionCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VotingSessionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    VotingSessionCreate:
      description: Request to create a voting session.
      properties:
        audience:
          default: public
          description: >-
            public links allow anonymous voters; internal links require
            authenticated vote permission
          enum:
            - public
            - internal
          title: Audience
          type: string
        expires_in_hours:
          anyOf:
            - maximum: 8760
              minimum: 1
              type: integer
            - type: 'null'
          default: 168
          description: Hours until link expires (defaults to 7 days)
          title: Expires In Hours
        instructions:
          anyOf:
            - maxLength: 4000
              type: string
            - type: 'null'
          description: Optional instructions shown to anonymous participants
          title: Instructions
        max_seats:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: Participant limit (null = unlimited)
          title: Max Seats
        max_votes_per_voter:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: Votes per participant limit (null = unlimited)
          title: Max Votes Per Voter
        name:
          anyOf:
            - maxLength: 255
              type: string
            - type: 'null'
          description: Optional name (auto-generated if not provided)
          title: Name
        spend_cap_credits:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: >-
            Spend cap in credits for this voting link (null = unlimited).
            Preferred over total_vote_limit.
          title: Spend Cap Credits
        total_vote_limit:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: Counted vote limit for this voting link (null = unlimited)
          title: Total Vote Limit
      title: VotingSessionCreate
      type: object
    VotingSessionResponse:
      description: Response for a voting session.
      properties:
        audience:
          default: public
          enum:
            - public
            - internal
          title: Audience
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by:
          format: uuid
          title: Created By
          type: string
        experiment_id:
          format: uuid
          title: Experiment Id
          type: string
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Expires At
        id:
          format: uuid
          title: Id
          type: string
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
        is_active:
          title: Is Active
          type: boolean
        is_canonical_internal:
          default: false
          title: Is Canonical Internal
          type: boolean
        max_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Seats
        max_votes_per_voter:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Votes Per Voter
        name:
          title: Name
          type: string
        non_choice_responses:
          default: 0
          title: Non Choice Responses
          type: integer
        paused_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Paused At
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Revoked At
        spend_cap_credits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Spend Cap Credits
        spend_spent_credits:
          default: 0
          title: Spend Spent Credits
          type: integer
        spend_used:
          default: 0
          title: Spend Used
          type: integer
        status:
          default: active
          title: Status
          type: string
        token:
          title: Token
          type: string
        total_vote_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Vote Limit
        total_votes:
          title: Total Votes
          type: integer
        unique_voters:
          title: Unique Voters
          type: integer
        voting_url:
          title: Voting Url
          type: string
      required:
        - id
        - experiment_id
        - token
        - name
        - voting_url
        - max_seats
        - max_votes_per_voter
        - expires_at
        - is_active
        - revoked_at
        - total_votes
        - unique_voters
        - created_at
        - created_by
      title: VotingSessionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: Supabase JWT
      scheme: bearer
      type: http
    ApiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey

````