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

# Create embed context

> Creates a new embed context from an avatar (model style), voice, background, and prompt. The response includes the context's `id` (used to manage it via this API) and its `context_id` (the public key the embed snippet uses to launch the widget).



## OpenAPI

````yaml /specs/openapi-interactive.json post /api/console/b2c/contexts/
openapi: 3.0.3
info:
  title: Perso Interactive API
  version: 0.0.0
servers:
  - url: https://platform.perso.ai
security: []
tags:
  - name: Embed
paths:
  /api/console/b2c/contexts/:
    post:
      tags:
        - Embed
      summary: Create embed context
      description: >-
        Creates a new embed context from an avatar (model style), voice,
        background, and prompt. The response includes the context's `id` (used
        to manage it via this API) and its `context_id` (the public key the
        embed snippet uses to launch the widget).
      operationId: console_b2c_contexts_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContextRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ContextRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ContextRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Context'
          description: ''
      security:
        - PersoPlatform-APIKey: []
        - cookieAuth: []
components:
  schemas:
    ContextRequest:
      type: object
      description: Console serializer for Context CRUD.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        greeting:
          type: string
        instructions:
          type: string
        tts_type:
          type: string
          minLength: 1
        model_style:
          type: string
          minLength: 1
        background_image:
          type: string
          minLength: 1
          nullable: true
        max_session_sec:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        is_active:
          type: boolean
        embed_config: {}
      required:
        - model_style
        - name
        - tts_type
    Context:
      type: object
      description: Console serializer for Context CRUD.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        context_id:
          type: string
          readOnly: true
        name:
          type: string
          maxLength: 200
        greeting:
          type: string
        instructions:
          type: string
        tts_type:
          type: string
        model_style:
          type: string
        background_image:
          type: string
          nullable: true
        max_session_sec:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        is_active:
          type: boolean
        embed_config: {}
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - context_id
        - created_at
        - id
        - model_style
        - name
        - tts_type
        - updated_at
  securitySchemes:
    PersoPlatform-APIKey:
      type: apiKey
      in: header
      name: PersoPlatform-APIKey
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid

````