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

# [PA1] Create Photo Avatar

> Creates a HeyGen Photo Avatar from uploaded photos or AI generation. Upload mode requires base64 photos; generate mode uses age/gender/ethnicity/style params. Returns group_id for status polling.



## OpenAPI

````yaml /api-reference/v1/v1.1.0_openapi.json post /action/heygen_photo_avatar_create_avatar_action
openapi: 3.0.0
info:
  version: 1.1.0
  title: AI Actions - Get Data
  description: API specifications for 'Get Data' category AI actions.
  license:
    name: MIT
servers:
  - url: https://api-lr.agent.ai/v1
security:
  - bearerAuth: []
paths:
  /action/heygen_photo_avatar_create_avatar_action:
    post:
      tags:
        - HeyGen Photo Avatar
      summary: '[PA1] Create Photo Avatar'
      description: >-
        Creates a HeyGen Photo Avatar from uploaded photos or AI generation.
        Upload mode requires base64 photos; generate mode uses
        age/gender/ethnicity/style params. Returns group_id for status polling.
      operationId: heygenPhotoAvatarCreateAvatarAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                source_type:
                  type: string
                  enum:
                    - upload
                    - generate
                  description: How to create the avatar.
                  default: generate
                name:
                  type: string
                  description: 'Display name for the avatar (default: My Avatar).'
                photos_json:
                  type: string
                  x-ui: textarea
                  description: >-
                    JSON array of photo objects: [{"base64": "...", "mimeType":
                    "image/jpeg"}]. Required for upload mode.
                age:
                  type: string
                  enum:
                    - Young Adult
                    - Middle-Aged
                    - Senior
                  description: Age range for generated avatar.
                  default: Young Adult
                gender:
                  type: string
                  enum:
                    - Unspecified
                    - Male
                    - Female
                    - Non-Binary
                  default: Unspecified
                ethnicity:
                  type: string
                  enum:
                    - Unspecified
                    - Asian
                    - Black
                    - Caucasian
                    - Hispanic
                    - Middle Eastern
                    - Mixed
                  default: Unspecified
                orientation:
                  type: string
                  enum:
                    - square
                    - portrait
                    - landscape
                  default: square
                pose:
                  type: string
                  enum:
                    - half_body
                    - close_up
                    - full_body
                  default: half_body
                style:
                  type: string
                  enum:
                    - Realistic
                    - Artistic
                    - Professional
                  default: Realistic
                appearance:
                  type: string
                  x-ui: textarea
                  description: Optional description of desired appearance traits.
                output_variable_name:
                  type: string
                  description: >-
                    Variable name for the result. Access as
                    {{avatar_result.group_id}}, {{avatar_result.status}}.
                  default: avatar_result
                  pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
              required:
                - source_type
                - output_variable_name
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '401':
          description: Unauthorized - invalid or missing bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
components:
  schemas:
    ActionResponse:
      type: object
      properties:
        status:
          type: integer
          format: int32
          description: HTTP status code of the action response
        response:
          type: object
          description: Response data from the action
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from your account
        ([https://agent.ai/user/integrations#api](https://agent.ai/user/integrations#api))

````