> ## 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.

# Karakter varlığı yükleyin

> Bir görüntü, video veya ses varlığını etkin bir CometAPI varlık grubuna yükleyerek sonraki Seedance isteklerinde kullanın.

Etkin bir varlık grubuna tek bir kaynak yükleyin. `Authorization` başlığında `Bearer` ön eki olmadan ham erişim belirtecini gönderin. Gerçek kişi grubu yalnızca görüntü varlıklarını kabul eder.

### Dosya yükleme

Yerel kaynak için `file` alanını kullanın:

```bash theme={null}
curl \
  https://api.cometapi.com/api/asset/assets \
  -H "Authorization: $COMETAPI_ACCESS_TOKEN" \
  -F "group_id=<GROUP_ID>" \
  -F "asset_type=image" \
  -F "file=@/path/to/character.png"
```

### Görüntü URL’si yükleme

Herkese açık bir URL’de bulunan kaynak için JSON biçimini kullanın:

```bash theme={null}
curl \
  https://api.cometapi.com/api/asset/assets \
  -H "Authorization: $COMETAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "group_id": "<GROUP_ID>",
    "asset_type": "image",
    "url": "https://your-image-host/character.png"
  }'
```

İstek tam olarak tek bir kaynak içermelidir: `file`, `url` veya `data`. İsteğe bağlı `name` alanı en fazla 64 karakter kabul eder. Yanıttaki `data.id` değerini kaydedin. Yeni varlıklar genellikle `data.status=processing` döndürür. Bu nedenle durum `active` olana kadar [Karakter varlığını al](https://apidoc.cometapi.com/tr/api/video/seedance/get-character-asset.md) sayfasını kullanın.

Grup etkin değilse API, grup durumunu açıklayan bir mesajla birlikte `success: false` döndürür. HTTP yanıtı `200` olsa bile iş hataları için `success` ve `message` alanlarını kontrol edin.


## OpenAPI

````yaml api/openapi/video/seedance/post-upload-character-asset.openapi.json POST /api/asset/assets
openapi: 3.1.0
info:
  title: Upload character asset API
  version: 1.0.0
  description: Upload a media asset to an active CometAPI character asset group.
servers:
  - url: https://api.cometapi.com
security:
  - accessTokenAuth: []
paths:
  /api/asset/assets:
    post:
      summary: Upload a character asset
      description: >-
        Upload one image, video, or audio source to an active group. A
        real-person group accepts image assets only. Provide exactly one source
        field.
      operationId: seedance_upload_character_asset
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadAssetMultipart'
            examples:
              file:
                summary: Upload an image file
                value:
                  group_id: ag-example
                  asset_type: image
                  file: <binary image file>
          application/json:
            schema:
              $ref: '#/components/schemas/UploadAssetJSON'
            examples:
              url:
                summary: Upload an image URL
                value:
                  group_id: ag-example
                  asset_type: image
                  url: https://your-image-host/character.png
      responses:
        '200':
          description: Asset accepted for processing.
          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/AssetView'
              examples:
                success:
                  summary: Successful response
                  value:
                    success: true
                    message: ''
                    data: {}
        '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/assets \
              -H "Authorization: $COMETAPI_ACCESS_TOKEN" \
              -F "group_id=<GROUP_ID>" \
              -F "asset_type=image" \
              -F "file=@/path/to/character.png"
        - lang: Python
          label: Character asset request
          source: |
            import os
            from pathlib import Path
            import requests

            with Path("/path/to/character.png").open("rb") as image:
                response = requests.post(
                    "https://api.cometapi.com/api/asset/assets",
                    headers={"Authorization": os.environ["COMETAPI_ACCESS_TOKEN"]},
                    data={"group_id": "<GROUP_ID>", "asset_type": "image"},
                    files={"file": ("character.png", image, "image/png")},
                    timeout=60,
                )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Character asset request
          source: >
            const form = new FormData();

            form.append("group_id", "<GROUP_ID>");

            form.append("asset_type", "image");

            form.append("file", new Blob([await
            readFile("/path/to/character.png")], { type: "image/png" }),
            "character.png");


            const response = await
            fetch("https://api.cometapi.com/api/asset/assets", {
              method: "POST",
              headers: { Authorization: process.env.COMETAPI_ACCESS_TOKEN },
              body: form,
            });


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

            console.log(await response.json());
components:
  schemas:
    UploadAssetMultipart:
      type: object
      required:
        - group_id
        - asset_type
      properties:
        group_id:
          type: string
          description: Active CometAPI group ID.
          example: ag-example
        asset_type:
          type: string
          enum:
            - image
            - video
            - audio
          description: Asset media type.
        name:
          type: string
          maxLength: 64
          description: Optional asset name.
        file:
          type: string
          format: binary
          description: Local file source.
        url:
          type: string
          format: uri
          pattern: ^https://
          description: Public HTTPS source URL.
        data:
          type: string
          description: Base64 or data URI source.
      description: 'Provide exactly one source: file, url, or data.'
    UploadAssetJSON:
      type: object
      required:
        - group_id
        - asset_type
      properties:
        group_id:
          type: string
          description: Active CometAPI group ID.
          example: ag-example
        asset_type:
          type: string
          enum:
            - image
            - video
            - audio
          description: Asset media type.
        name:
          type: string
          maxLength: 64
          description: Optional asset name.
        url:
          type: string
          format: uri
          pattern: ^https://
          description: Public HTTPS source URL.
        data:
          type: string
          description: Base64 or data URI source.
      description: 'Provide exactly one source: file, url, or data.'
    AssetView:
      type: object
      required:
        - id
        - group_id
        - asset_type
        - status
        - created_at
      properties:
        id:
          type: string
          description: CometAPI asset ID.
          example: as-example
        group_id:
          type: string
          description: Owning group ID.
          example: ag-example
        name:
          type: string
          description: Optional asset name.
        asset_type:
          type: string
          enum:
            - image
            - video
            - audio
          description: Asset media type.
        status:
          type: string
          enum:
            - processing
            - active
            - failed
          description: Asset processing status.
        fail_reason:
          type: string
          description: Sanitized failure reason when processing fails.
        created_at:
          type: integer
          description: Creation time as a Unix timestamp in seconds.
    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.