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

# Delete assets and the files behind them

> Deletes the entries and the files behind them, and answers `204` with no body. At most 50 entry keys per call.

The files are deleted before the entries. The same entry keys can be initialized again straight away.



## OpenAPI

````yaml /api-reference/openapi/assets.json delete /v1/assets/{dataSourceId}
openapi: 3.2.0
info:
  title: Assets API
  description: >-
    Upload files into an Occtoo data source. Tenant identity comes from the
    credential, never from the route or request body.


    ## The upload flow


    1. `POST /v1/assets/<dataSourceId>` registers the assets and returns a
    signed upload link per entry key.

    2. `PUT` each file to its link. The bytes go straight to Azure Blob Storage
    and never pass through Occtoo.

    3. `POST /v1/assets/<dataSourceId>/complete` confirms the uploads and
    creates the files.


    Everything is keyed by entry key. `GET` reads asset state, `DELETE` removes
    assets and the files behind them, `PUT` creates assets or replaces their
    files, and `/uploadLinks` re-signs a link that expired before the `PUT`
    happened.


    ## Authentication and access


    Select **Authorize** to reuse the existing Occtoo browser session, provide a
    tenant-scoped bearer token, or send an organization API key through
    `x-api-key`. Every operation accepts any one of `write:media`,
    `write:sources` or the established `import-datasource` permission.


    ## Batch ceilings


    - 100 assets per initialize call.

    - 25 assets per `PUT` call.

    - 50 assets per `/uploadLinks`, `/complete`, `GET` and `DELETE` call.

    - Entry keys must be unique within a request, compared case-insensitively,
    and allow letters, digits, `_` and `-`.


    ## Responses


    Successful responses return resource data directly. `DELETE` answers `204`
    with no body. The batch operations answer `200` with the keys that succeeded
    and a `failed` map of entry key to reason, so one bad asset doesn't sink the
    call.


    Errors use ProblemDetails (RFC 9457) with the `application/problem+json`
    content type. A `400` carries per-property failures under `errors`. Retry
    `429` and transient `5xx` responses with bounded exponential backoff,
    honouring `Retry-After` where present.


    Machine-readable contract:
    [OpenAPI](https://api.occtoo.com/openapi/assets.json)
  version: 1.0.0
  summary: Upload files into a data source and read the state of what was uploaded.
servers:
  - url: https://api.occtoo.com
    description: Occtoo public API
security: []
tags:
  - name: Assets
paths:
  /v1/assets/{dataSourceId}:
    delete:
      tags:
        - Assets
      summary: Delete assets and the files behind them
      description: >-
        Deletes the entries and the files behind them, and answers `204` with no
        body. At most 50 entry keys per call.


        The files are deleted before the entries. The same entry keys can be
        initialized again straight away.
      operationId: deleteAssets
      parameters:
        - name: dataSourceId
          in: path
          description: Stable customer-facing source id within the authenticated tenant.
          required: true
          schema:
            minLength: 1
            type: string
            example: product-images
          example: product-images
        - name: key
          in: query
          description: >-
            Entry key to act on. Repeat the parameter for several keys:
            `?key=sku-1&key=sku-2`. At most 50 per call.
          required: true
          schema:
            type: array
            items:
              type: string
          example: sku-1
      responses:
        '204':
          description: The entries were deleted.
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/HttpValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          headers:
            Retry-After:
              description: Optional number of seconds to wait before retrying.
              schema:
                minimum: 1
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - kindeOAuth: []
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    HttpValidationProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
  securitySchemes:
    kindeOAuth:
      type: oauth2
      description: >-
        Sign in with the existing Occtoo Studio identity and selected
        organization.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.occtoo.com/oauth2/auth?audience=https%3A%2F%2Fapi-weu.occtoo.com
          tokenUrl: https://auth.occtoo.com/oauth2/token
          scopes:
            openid: Authenticate the user with OpenID Connect.
            profile: Read the user's basic profile.
            email: Read the user's email address.
            offline: Refresh the access token without another interactive sign-in.
          x-usePkce: SHA-256
          x-scalar-redirect-uri: https://api.occtoo.com/docs/
    bearerAuth:
      type: http
      description: >-
        Tenant-scoped Occtoo access token, including Kinde machine-to-machine
        application tokens.
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      description: Occtoo organization API key.
      name: x-api-key
      in: header

````

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