Anything Assets API

The Assets API from Anything — 2 operation(s) for assets.

OpenAPI Specification

anything-assets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Anything Assets API
  version: 0.1.0
  description: The Anything API is the fastest way for agents to build and launch mobile and web apps.
servers:
- url: /
tags:
- name: Assets
paths:
  /v0/api/projects/{projectGroupId}/assets:
    post:
      summary: Upload an asset
      description: Uploads an image asset to a project group. Send the file as multipart/form-data under the `file` field, with an optional display `name`.
      tags:
      - Assets
      security:
      - basicAuth: []
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: projectGroupId
        in: path
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 'Image file to upload. Allowed types: image/png, image/jpeg, image/gif, image/svg+xml, image/webp.'
                  format: binary
                name:
                  type: string
              required:
              - file
      responses:
        '201':
          description: Asset uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  url:
                    type: string
                  mimeType:
                    type: string
                  createdAt:
                    type: string
                    format: date-time
                required:
                - id
                - name
                - url
                - mimeType
                - createdAt
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '404':
          description: Not found — the referenced resource does not exist (including malformed resource IDs)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '413':
          description: File too large
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
    get:
      summary: List assets
      description: Returns the image assets uploaded to a project group, optionally filtered by a search query and paginated.
      tags:
      - Assets
      security:
      - basicAuth: []
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: projectGroupId
        in: path
      - schema:
          type: string
        required: false
        name: query
        in: query
      - schema:
          type: integer
          exclusiveMinimum: 0
          maximum: 100
        required: false
        name: limit
        in: query
      - schema:
          type:
          - integer
          - 'null'
          minimum: 0
        required: false
        name: offset
        in: query
      responses:
        '200':
          description: Assets list
          content:
            application/json:
              schema:
                type: object
                properties:
                  assets:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                        url:
                          type: string
                        mimeType:
                          type: string
                        createdAt:
                          type: string
                          format: date-time
                      required:
                      - id
                      - name
                      - url
                      - mimeType
                      - createdAt
                  total:
                    type: number
                required:
                - assets
                - total
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '404':
          description: Not found — the referenced resource does not exist (including malformed resource IDs)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
  /v0/api/projects/{projectGroupId}/assets/{assetId}:
    delete:
      summary: Delete an asset
      description: Removes an asset from a project group.
      tags:
      - Assets
      security:
      - basicAuth: []
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: projectGroupId
        in: path
      - schema:
          type: string
          format: uuid
        required: true
        name: assetId
        in: path
      responses:
        '204':
          description: Asset deleted
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
        '404':
          description: Asset not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                - error
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: 'Use your Anything API key as the Basic auth username and leave the password empty. Example credentials: anything_xxx:'