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

# Upload image

> Uploads an image by either URL or file. If both a URL and file are provided, the URL will be used over the file. A URL can be provided without a file, and vice versa.



## OpenAPI

````yaml /swagger/management-api.json put /api/v1/{team_slug}/{app_slug}/images
openapi: 3.0.0
info:
  contact:
    email: support@enad.io
    name: API support
    url: http://enad.io/support
  description: This is the documentation for Public API v1
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://enad.io/terms/
  title: Public API
  version: '1.0'
servers:
  - url: //api.enad.io
security: []
paths:
  /api/v1/{team_slug}/{app_slug}/images:
    put:
      tags:
        - Images
      summary: Upload image
      description: >-
        Uploads an image by either URL or file. If both a URL and file are
        provided, the URL will be used over the file. A URL can be provided
        without a file, and vice versa.
      parameters:
        - description: App slug
          in: path
          name: app_slug
          required: true
          schema:
            type: string
        - description: Team slug
          in: path
          name: team_slug
          required: true
          schema:
            type: string
        - description: >-
            Try to connect the image to a product or variant using the filename.
            If filename matches an existing product or variant do we connect it.
            Priority can be set via a numeric suffix (sku_3) or an uppercase
            letter suffix A-Z (sku_A, where A=1 through Z=26). If the format
            don't match sku_priority (e.g sku.jpeg) do we fallback to priority
            10
          in: query
          name: connect_to_sku
          schema:
            type: boolean
        - description: >-
            Try to connect the image to a product usign the filename. If
            filename matches an existing product do we connect it. Priority can
            be set via a numeric suffix (slug_3) or an uppercase letter suffix
            A-Z (slug_A, where A=1 through Z=26). If the format don't match
            slug_priority (e.g slug.jpeg) do we fallback to priority 10
          in: query
          name: connect_to_slug
          schema:
            type: boolean
        - description: >-
            Try to connect the image to a variant group using the filename.
            Format: productNumber_variantGroupSlug[_priority].extension where
            priority is numeric or uppercase A-Z (A=1 through Z=26). Example:
            2512301_102.jpg links product 2512301 variant group slug 102.
          in: query
          name: connect_to_variant_group
          schema:
            type: boolean
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                title:
                  description: Image title
                  type: string
                alt:
                  description: Alternative image text
                  type: string
                copyright:
                  description: Image copyright text
                  type: string
                image:
                  description: Image file to upload
                  type: string
                  format: binary
                url:
                  description: Url to source file. Url will be used if provided over file
                  type: string
                status:
                  description: Status for image. One of `active`, `inactive`, `draft`
                  type: string
                filename:
                  description: Custom filename (without extension)
                  type: string
                blurhash:
                  description: >-
                    Optional precomputed blurhash. If provided, generation is
                    skipped
                  type: string
                parent_id:
                  description: Parent image ID
                  type: string
      responses:
        '200':
          description: Image uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.OkResponseImage'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
      security:
        - BearerAuth: []
components:
  schemas:
    internal_pkg_webserver_v1.OkResponseImage:
      properties:
        data:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageWithUsedBy
        details:
          description: >-
            Additional contextual information about the response. Used to
            provide supplementary details beyond the main data payload, such as
            validation warnings or processing notes
          items:
            type: string
          type: array
        success:
          type: boolean
      type: object
    internal_pkg_webserver_v1.ErrorMessage:
      properties:
        details:
          items:
            type: string
          type: array
        message:
          type: string
        success:
          type: boolean
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageWithUsedBy:
      properties:
        alt:
          type: string
        app_id:
          type: string
        attributes:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Attribute
          type: array
        blurhash:
          type: string
        copyright:
          type: string
        custom:
          additionalProperties:
            type: string
          type: object
        folder_id:
          type: string
        id:
          type: string
        parent_id:
          type: string
        public:
          type: boolean
        source_app_id:
          type: string
        source_id:
          type: string
        status:
          type: string
        title:
          type: string
        translations:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageTranslation
        url:
          type: string
        used_by:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.AssetConsumer
          type: array
        variants:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Image
          type: array
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.Attribute:
      properties:
        created_at:
          type: string
        description:
          type: string
        filterable:
          type: boolean
        id:
          type: string
        key:
          type: string
        name:
          type: string
        template_key:
          type: string
        template_name:
          type: string
        translatable:
          type: boolean
        translations:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.AttributeTranslations
        updated_at:
          type: string
        values:
          additionalProperties:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.AttributeValue
          type: object
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageTranslation:
      properties:
        alt:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation
          type: array
        copyright:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation
          type: array
        title:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation
          type: array
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.AssetConsumer:
      properties:
        created_at:
          type: string
        id:
          type: string
        name:
          type: string
        priority:
          type: integer
        slug:
          type: string
        type:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageConsumerType
        updated_at:
          type: string
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.Image:
      properties:
        alt:
          type: string
        app_id:
          type: string
        attributes:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Attribute
          type: array
        blurhash:
          type: string
        copyright:
          type: string
        custom:
          additionalProperties:
            type: string
          type: object
        folder_id:
          type: string
        id:
          type: string
        parent_id:
          type: string
        public:
          type: boolean
        source_app_id:
          type: string
        source_id:
          type: string
        status:
          type: string
        title:
          type: string
        translations:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageTranslation
        url:
          type: string
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.AttributeTranslations:
      properties:
        description:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation
          type: array
        name:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation
          type: array
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.AttributeValue:
      properties:
        field_id:
          type: string
        id:
          type: string
        image_id:
          type: string
        image_object:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Image
        translations:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.AttributeValueTranslations
        type:
          type: string
        value:
          type: string
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation:
      properties:
        id:
          type: string
        locale:
          type: string
        value:
          type: string
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.ImageConsumerType:
      enum:
        - product
        - variant
        - attribute
      type: string
      x-enum-varnames:
        - ProductImageConsumer
        - VariantImageConsumer
        - AttributeImageConsumer
    github_com_enadhq_nabbit_internal_pkg_webserver_models.AttributeValueTranslations:
      properties:
        value:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.Translation
          type: array
      type: object

````