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

# Utwórz grupę zasobów postaci

> Utwórz grupę zasobów postaci CometAPI na potrzeby odwołań Seedance. Grupy wirtualne stają się aktywne od razu, a grupy osób rzeczywistych wymagają weryfikacji.

Utwórz grupę przed przesłaniem obrazu postaci. Przekaż niezmodyfikowany token dostępu w nagłówku `Authorization`, bez prefiksu `Bearer`.

```bash theme={null}
curl \
  https://api.cometapi.com/api/asset/groups \
  -H "Authorization: $COMETAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-character",
    "type": "virtual"
  }'
```

## Pola żądania

| Pole | Typ | Opis |
| - | - | - |
| `name` | string | Nazwa grupy zawierająca od 1 do 64 znaków. |
| `type` | string | Użyj `virtual` dla postaci wirtualnej lub `real` dla osoby rzeczywistej. |

Odpowiedź zapisuje identyfikator grupy CometAPI w `data.id`. Grupa `virtual` zwraca `data.status=active`. Grupa `real` zwraca `data.status=pending` i zawiera podpisane `data.liveness.platform_wrapper_url`.

## Pola odpowiedzi

| Pole | Opis |
| - | - |
| `data.id` | Identyfikator grupy używany przez punkty końcowe przesyłania i grup. |
| `data.group_type` | Typ przesłanej grupy. |
| `data.status` | `active`, `pending` lub `expired`. |
| `data.liveness` | Występuje w oczekującej grupie osoby rzeczywistej. |

W przypadku grupy osoby rzeczywistej przejdź do stron [Pobierz grupę zasobów postaci](https://apidoc.cometapi.com/pl/api/video/seedance/get-character-asset-group.md) i [Aktywuj weryfikację osoby rzeczywistej](https://apidoc.cometapi.com/pl/api/video/seedance/activate-character-asset-liveness.md). W przypadku grupy wirtualnej przejdź do strony [Prześlij zasób postaci](https://apidoc.cometapi.com/pl/api/video/seedance/upload-character-asset.md).


## OpenAPI

````yaml api/openapi/video/seedance/post-create-character-asset-group.openapi.json POST /api/asset/groups
openapi: 3.1.0
info:
  title: Create character asset group API
  version: 1.0.0
  description: Create a CometAPI character asset group for Seedance references.
servers:
  - url: https://api.cometapi.com
security:
  - accessTokenAuth: []
paths:
  /api/asset/groups:
    post:
      summary: Create a character asset group
      description: >-
        Create a character asset group. Virtual groups become active
        immediately. Real-person groups begin in pending status and require
        liveness verification.
      operationId: seedance_create_character_asset_group
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGroupRequest'
            examples:
              virtual:
                summary: Create a virtual character group
                value:
                  name: my-character
                  type: virtual
              real:
                summary: Create a real-person group
                value:
                  name: my-real-character
                  type: real
      responses:
        '200':
          description: Character asset group created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - data
                properties:
                  success:
                    type: boolean
                    description: Whether the request succeeded.
                  message:
                    type: string
                    description: Status or error message.
                  data:
                    $ref: '#/components/schemas/GroupView'
              examples:
                success:
                  summary: Active virtual group
                  value:
                    success: true
                    message: ''
                    data:
                      id: ag-example
                      name: my-character
                      group_type: virtual
                      status: active
                      created_at: 1777385418
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: invalid request body
        '401':
          description: The access token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: unauthorized
      x-codeSamples:
        - lang: Shell
          label: Character asset request
          source: |-
            curl https://api.cometapi.com/api/asset/groups \
              -H "Authorization: $COMETAPI_ACCESS_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{"name":"my-character","type":"virtual"}'
        - lang: Python
          label: Character asset request
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/api/asset/groups",
                headers={"Authorization": os.environ["COMETAPI_ACCESS_TOKEN"]},
                json={"name": "my-character", "type": "virtual"},
                timeout=30,
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Character asset request
          source: >
            const response = await
            fetch("https://api.cometapi.com/api/asset/groups", {
              method: "POST",
              headers: {
                Authorization: process.env.COMETAPI_ACCESS_TOKEN,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({ name: "my-character", type: "virtual" }),
            });


            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
components:
  schemas:
    CreateGroupRequest:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 64
          description: Group name.
          example: my-character
        type:
          type: string
          enum:
            - virtual
            - real
          description: Character type.
    GroupView:
      type: object
      required:
        - id
        - name
        - group_type
        - status
        - created_at
      properties:
        id:
          type: string
          description: CometAPI group ID.
          example: ag-example
        name:
          type: string
          description: Group name.
          example: my-character
        group_type:
          type: string
          enum:
            - virtual
            - real
          description: Character type.
        status:
          type: string
          enum:
            - pending
            - active
            - expired
          description: Group status.
        created_at:
          type: integer
          description: Creation time as a Unix timestamp in seconds.
        liveness:
          type: object
          description: Present for a pending real-person group.
          properties:
            platform_wrapper_url:
              type: string
              format: uri
              description: Signed verification URL.
            activated:
              type: boolean
              description: Whether a verification session is active.
            hint:
              type: string
              description: Optional action hint.
          required:
            - platform_wrapper_url
            - activated
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Description of the request error.
        data:
          type:
            - object
            - array
            - 'null'
          description: Error details when returned.
      additionalProperties: true
  securitySchemes:
    accessTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Raw CometAPI access token. Do not prefix it with Bearer.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.