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

# Insights

> What the workspace's events say: brand answers per week, release adoption and who still loads a replaced version, the most fetched assets by surface, searches that found nothing, the use-check log (refusals by reason, what was offered and whether it was taken), delivery traffic and portal page views. Events never hold an IP address, a person's name or a full URL, and never leave this server.

Scope: `write`.



## OpenAPI

````yaml /openapi.json get /api/v1/insights
openapi: 3.1.0
info:
  title: artbucket
  version: '1'
  description: >-
    Agent-first asset management. The web UI is built on this API and nothing
    else, beside signing in at /api/auth. Send `Authorization: Bearer <key>`: a
    key works in one workspace with one scope, and scopes are a ladder: read <
    propose < write < admin. People signed in to the app carry a session cookie
    instead, and their scope is what their grants add up to: on the
    organization, the workspace, or single collections and assets. A scope shown
    as needed on the workspace is also enough on the one collection or asset a
    route acts on. Agents (MCP at POST /api/v1/mcp) usually get `propose`: what
    they add waits for a human.
servers:
  - url: http://localhost:3000
security:
  - bearer: []
  - session: []
  - {}
paths:
  /api/v1/insights:
    get:
      summary: Insights
      description: >-
        What the workspace's events say: brand answers per week, release
        adoption and who still loads a replaced version, the most fetched assets
        by surface, searches that found nothing, the use-check log (refusals by
        reason, what was offered and whether it was taken), delivery traffic and
        portal page views. Events never hold an IP address, a person's name or a
        full URL, and never leave this server.


        Scope: `write`.
      responses:
        '200':
          description: Insights
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      days:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: How far back the lists go
                      weeks:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          How many weeks the weekly charts have, oldest first,
                          quiet weeks at zero
                      answers:
                        type: array
                        items:
                          type: object
                          properties:
                            week:
                              type: string
                              description: The Monday (UTC) the week starts, YYYY-MM-DD
                            person:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            agent:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            anonymous:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - week
                            - person
                            - agent
                            - anonymous
                          additionalProperties: false
                        description: >-
                          Brand answers per week, by who got them: files served,
                          BrandHub files read, uses checked, searches that found
                          something
                      adoption:
                        type: array
                        items:
                          type: object
                          properties:
                            week:
                              type: string
                              description: The Monday (UTC) the week starts, YYYY-MM-DD
                            current:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            superseded:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - week
                            - current
                            - superseded
                          additionalProperties: false
                        description: >-
                          Fetches per week of a current version, and of one
                          already replaced when it was fetched
                      stale:
                        type: array
                        items:
                          type: object
                          properties:
                            asset:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  pattern: >-
                                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                title:
                                  type: string
                                version:
                                  anyOf:
                                    - type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                    - type: 'null'
                                  description: >-
                                    Its version in its stack; null for an asset
                                    with one
                                preview:
                                  type: boolean
                                  description: Whether /a/{id} can make a picture of it
                                supersededBy:
                                  anyOf:
                                    - type: string
                                      format: uuid
                                      pattern: >-
                                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                    - type: 'null'
                              required:
                                - id
                                - title
                                - version
                                - preview
                                - supersededBy
                              additionalProperties: false
                            replacement:
                              anyOf:
                                - type: object
                                  properties:
                                    id:
                                      type: string
                                      format: uuid
                                      pattern: >-
                                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                    title:
                                      type: string
                                    version:
                                      anyOf:
                                        - type: integer
                                          minimum: -9007199254740991
                                          maximum: 9007199254740991
                                        - type: 'null'
                                      description: >-
                                        Its version in its stack; null for an
                                        asset with one
                                    preview:
                                      type: boolean
                                      description: Whether /a/{id} can make a picture of it
                                    supersededBy:
                                      anyOf:
                                        - type: string
                                          format: uuid
                                          pattern: >-
                                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                        - type: 'null'
                                  required:
                                    - id
                                    - title
                                    - version
                                    - preview
                                    - supersededBy
                                  additionalProperties: false
                                - type: 'null'
                              description: What replaced it
                            referrer:
                              description: >-
                                The host that loaded it; null when the request
                                didn't say
                              type:
                                - string
                                - 'null'
                            fetches:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            last:
                              type: string
                              description: The last day it was fetched
                          required:
                            - asset
                            - replacement
                            - referrer
                            - fetches
                            - last
                          additionalProperties: false
                        description: >-
                          Still on the old release: replaced versions fetched
                          lately, by referrer, most first
                      top:
                        type: array
                        items:
                          type: object
                          properties:
                            asset:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  pattern: >-
                                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                title:
                                  type: string
                                version:
                                  anyOf:
                                    - type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                    - type: 'null'
                                  description: >-
                                    Its version in its stack; null for an asset
                                    with one
                                preview:
                                  type: boolean
                                  description: Whether /a/{id} can make a picture of it
                                supersededBy:
                                  anyOf:
                                    - type: string
                                      format: uuid
                                      pattern: >-
                                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                    - type: 'null'
                              required:
                                - id
                                - title
                                - version
                                - preview
                                - supersededBy
                              additionalProperties: false
                            total:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            surfaces:
                              type: object
                              propertyNames:
                                type: string
                                enum:
                                  - app
                                  - api
                                  - mcp
                                  - portal
                                  - share
                                  - hub
                                  - link
                                  - public
                              additionalProperties:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              description: >-
                                Fetches through each surface: app, api, mcp,
                                portal, share, hub, link (a signed URL), public
                          required:
                            - asset
                            - total
                            - surfaces
                          additionalProperties: false
                        description: >-
                          The ten most fetched assets, with their fetches by
                          surface
                      gaps:
                        type: array
                        items:
                          type: object
                          properties:
                            q:
                              type: string
                            searches:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            last:
                              type: string
                          required:
                            - q
                            - searches
                            - last
                          additionalProperties: false
                        description: Searches that found nothing, most asked first
                      checks:
                        type: object
                        properties:
                          allowed:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          refused:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          reasons:
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: string
                                count:
                                  type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                              required:
                                - code
                                - count
                              additionalProperties: false
                            description: >-
                              Refusals by blocking reason, most first; one
                              refusal can have several
                          log:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  pattern: >-
                                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                at:
                                  type: string
                                  format: date-time
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                                asset:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      format: uuid
                                      pattern: >-
                                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                    title:
                                      type: string
                                    version:
                                      anyOf:
                                        - type: integer
                                          minimum: -9007199254740991
                                          maximum: 9007199254740991
                                        - type: 'null'
                                      description: >-
                                        Its version in its stack; null for an
                                        asset with one
                                    preview:
                                      type: boolean
                                      description: Whether /a/{id} can make a picture of it
                                    supersededBy:
                                      anyOf:
                                        - type: string
                                          format: uuid
                                          pattern: >-
                                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                        - type: 'null'
                                  required:
                                    - id
                                    - title
                                    - version
                                    - preview
                                    - supersededBy
                                  additionalProperties: false
                                surface:
                                  type: string
                                  enum:
                                    - app
                                    - api
                                    - mcp
                                    - portal
                                    - share
                                    - hub
                                    - link
                                    - public
                                client:
                                  description: >-
                                    The agent's key name; null for a person or
                                    nobody in particular
                                  type:
                                    - string
                                    - 'null'
                                context:
                                  type:
                                    - string
                                    - 'null'
                                reasons:
                                  type: array
                                  items:
                                    type: string
                                offered:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      asset:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            format: uuid
                                            pattern: >-
                                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                          title:
                                            type: string
                                          version:
                                            anyOf:
                                              - type: integer
                                                minimum: -9007199254740991
                                                maximum: 9007199254740991
                                              - type: 'null'
                                            description: >-
                                              Its version in its stack; null for an
                                              asset with one
                                          preview:
                                            type: boolean
                                            description: Whether /a/{id} can make a picture of it
                                          supersededBy:
                                            anyOf:
                                              - type: string
                                                format: uuid
                                                pattern: >-
                                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                              - type: 'null'
                                        required:
                                          - id
                                          - title
                                          - version
                                          - preview
                                          - supersededBy
                                        additionalProperties: false
                                      taken:
                                        type: boolean
                                        description: >-
                                          The same client fetched it, or checked
                                          it and was allowed, afterwards
                                    required:
                                      - asset
                                      - taken
                                    additionalProperties: false
                                  description: What was offered instead
                              required:
                                - id
                                - at
                                - asset
                                - surface
                                - client
                                - context
                                - reasons
                                - offered
                              additionalProperties: false
                            description: The latest refusals, newest first
                        required:
                          - allowed
                          - refused
                          - reasons
                          - log
                        additionalProperties: false
                        description: >-
                          The use-check log: check_use and POST /api/v1/check
                          answers
                      delivery:
                        type: array
                        items:
                          type: object
                          properties:
                            day:
                              type: string
                            requests:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            bytes:
                              type: number
                          required:
                            - day
                            - requests
                            - bytes
                          additionalProperties: false
                        description: What /a/{id} served in this workspace, per day
                      pageViews:
                        type: array
                        items:
                          type: object
                          properties:
                            portal:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  pattern: >-
                                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                name:
                                  type: string
                              required:
                                - id
                                - name
                              additionalProperties: false
                            brand:
                              type: object
                              properties:
                                slug:
                                  type: string
                                name:
                                  type: string
                              required:
                                - slug
                                - name
                              additionalProperties: false
                            page:
                              type: string
                            views:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - portal
                            - brand
                            - page
                            - views
                          additionalProperties: false
                        description: Portal pages read, most first
                    required:
                      - days
                      - weeks
                      - answers
                      - adoption
                      - stale
                      - top
                      - gaps
                      - checks
                      - delivery
                      - pageViews
                    additionalProperties: false
                required:
                  - data
                additionalProperties: false
        default:
          description: An error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      detail: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: 'An API key: ab_...'
    session:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Signed in, at /api/auth

````