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

# Favorite a TTS voice

> Mark or unmark a TTS voice as Favorite.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/tts/voices/{id}/favourite
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v2/tts/voices/{id}/favourite:
    post:
      summary: Favorite a TTS voice
      description: Mark or unmark a TTS voice as Favorite.
      parameters:
        - in: path
          name: id
          required: true
          description: Voice identifier.
          schema:
            type: string
            format: uuid
            example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
        - in: query
          name: projectId
          required: true
          description: Project identifier.
          schema:
            type: string
            example: ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FavoriteTtsVoiceRequest'
      responses:
        '200':
          description: Favourite updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FavoriteTtsVoiceResponse'
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorResponse'
        '404':
          description: Voice not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FavoriteTtsVoiceRequest:
      type: object
      required:
        - isFavourite
      properties:
        isFavourite:
          type: boolean
          example: true
    FavoriteTtsVoiceResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
        - type: object
          properties:
            message:
              type: string
              example: favourite updated successfully
    ValidationErrorResponse:
      type: object
      properties:
        code:
          type: integer
          example: 9400
        message:
          type: string
          example: Field must be a string!
        messageKey:
          type: string
          example: FieldMustBeString
    ForbiddenErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: integer
          example: 403
        message:
          type: string
          example: You are not authorized to perform this action
    NotFoundResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: integer
          example: 404
        message:
          type: string
          example: Resource not found
    InternalServerErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: integer
          example: 500
        message:
          type: string
          example: Internal server error
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Operation completed successfully
        messageKey:
          type: string
          example: OPERATION_SUCCESSFUL
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````