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

# Update a view

> Renames a view, changes its description, replaces its whole definition, or sets or clears `conversion` (an owner, admin, developer or key only). Send at least one change. Dashboards that show it show the new question. [Views](/views#list-and-change-views)



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/views/{id}
openapi: 3.1.0
info:
  title: Lurk API
  version: 1.0.0
  description: Events in, rules decide, units change, receipts out.
servers:
  - url: https://api.getlurk.com
security: []
tags:
  - name: events
    description: Send what your users do. Lurk runs your live rules on each event.
    x-group: Events
    x-displayName: Events
  - name: units
    description: What people collect and hold, and their balances.
    x-group: Units
    x-displayName: Units
  - name: rules
    description: What Lurk does when an event comes in. A person takes a rule live.
    x-group: Rules
    x-displayName: Rules
  - name: activity
    description: A receipt for every change, with why it happened.
    x-group: Receipts
    x-displayName: Receipts
  - name: users
    description: The people your events are about.
    x-group: People
    x-displayName: People
  - name: webhook_endpoints
    description: Where Lurk sends signed notices of what changed.
    x-group: Webhooks
    x-displayName: Webhooks
  - name: known_values
    description: The properties of your own events whose values Lurk remembers.
    x-group: Known values
    x-displayName: Known values
  - name: feedback
    description: Tell the Lurk team about a bug, a gap or an idea.
    x-group: Feedback
    x-displayName: Feedback
  - name: annotations
    description: >-
      Short notes on a day of the project, such as a release or a campaign
      start.
    x-group: Annotations
    x-displayName: Annotations
  - name: trusted_issuers
    description: The sign-in providers a project trusts for its app's users.
    x-group: Trusted issuers
    x-displayName: Trusted issuers
  - name: client_events
    description: The events a signed-in device may send, and their caps.
    x-group: Client events
    x-displayName: Client events
  - name: issuer_identities
    description: Which person each sign-in subject is bound to.
    x-group: Issuer identities
    x-displayName: Issuer identities
  - name: proposals
    description: Changes an agent or Lurky asks for and a person approves or declines.
    x-group: Proposals
    x-displayName: Proposals
  - name: holds
    description: Changes a rule parked for a person to give or refuse.
    x-group: Holds
    x-displayName: Holds
  - name: audiences
    description: The groups of people that rules can read.
    x-group: Audiences
    x-displayName: Audiences
  - name: budgets
    description: What each live rule's budgets have given in the window they are in now.
    x-group: Budgets
    x-displayName: Budgets
  - name: templates
    description: Kits that add units and rules to a project in one go.
    x-group: Templates
    x-displayName: Templates
  - name: views
    description: Saved questions about a project, with their answers.
    x-group: Views
    x-displayName: Views
  - name: integrations
    description: Every way events reach Lurk or state leaves it, and the state of each.
    x-group: Integrations
    x-displayName: Integrations
  - name: projects
    description: Where units, rules and events live. An organization can have several.
    x-group: Projects
    x-displayName: Projects
  - name: clocks
    description: A test project's clock, which can be moved to try schedules and expiries.
    x-group: Clocks
    x-displayName: Clocks
paths:
  /v1/views/{id}:
    patch:
      tags:
        - views
      summary: Update a view
      description: >-
        Renames a view, changes its description, replaces its whole definition,
        or sets or clears `conversion` (an owner, admin, developer or key only).
        Send at least one change. Dashboards that show it show the new question.
        [Views](/views#list-and-change-views)
      operationId: views.update
      parameters:
        - schema:
            type: string
            description: A view_… ID or the view's key
          required: true
          description: A view_… ID or the view's key
          name: id
          in: path
        - schema:
            type: string
            description: W3C Trace Context; joins your trace to ours
          required: false
          description: W3C Trace Context; joins your trace to ours
          name: traceparent
          in: header
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: A retry with the same key and body returns the first response
          required: true
          description: A retry with the same key and body returns the first response
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                  description: A new name, 1 to 80 characters
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 280
                  description: A new note, up to 280 characters; null removes it
                definition:
                  type: object
                  properties:
                    who:
                      $ref: '#/components/schemas/ViewWho'
                    what:
                      type: array
                      items:
                        $ref: '#/components/schemas/ViewMeasure'
                      minItems: 1
                      maxItems: 4
                      description: >-
                        What to count: 1 to 4 measures. A list ranks by the
                        first and shows the others as columns
                    over:
                      $ref: '#/components/schemas/ViewRange'
                    shape:
                      $ref: '#/components/schemas/ViewShape'
                    source:
                      type: string
                      enum:
                        - trusted
                        - platform
                        - onchain
                        - web_identified
                        - any
                      description: >-
                        Whose events this view counts. Left out is the same as
                        platform: trusted and chat platform events (chat is not
                        available yet). trusted: only your server, an agent or a
                        person in Lurk. onchain: only Lurk's on-chain
                        observations (not available yet). web_identified:
                        server-verified web identification (not available yet).
                        any: all sources; devices, on-chain observations and web
                        identification are not available yet. Units given, spent
                        and held, and new people are counted whatever this says
                  required:
                    - who
                    - what
                    - over
                    - shape
                  additionalProperties: false
                  description: Replaces the whole definition
                conversion:
                  type: boolean
                  description: 'Set or clear the mark. Left out: unchanged'
              additionalProperties: false
      responses:
        '200':
          description: Update a view
          headers:
            Request-Id:
              schema:
                type: string
                description: Quote this when you contact support
              required: true
              description: Quote this when you contact support
            traceparent:
              schema:
                type: string
                description: W3C Trace Context for this call, in the caller's trace
              required: true
              description: W3C Trace Context for this call, in the caller's trace
            RateLimit:
              schema:
                type: string
                description: The tightest limit now, e.g. `"ingest-key";r=5999;t=42`
              required: true
              description: The tightest limit now, e.g. `"ingest-key";r=5999;t=42`
            RateLimit-Policy:
              schema:
                type: string
                description: Its quota and window, e.g. `"ingest-key";q=6000;w=60`
              required: true
              description: Its quota and window, e.g. `"ingest-key";q=6000;w=60`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/View'
        '429':
          description: Too many requests. Wait `Retry-After` seconds.
          headers:
            Request-Id:
              schema:
                type: string
                description: Quote this when you contact support
              required: true
              description: Quote this when you contact support
            traceparent:
              schema:
                type: string
                description: W3C Trace Context for this call, in the caller's trace
              required: true
              description: W3C Trace Context for this call, in the caller's trace
            RateLimit:
              schema:
                type: string
                description: The tightest limit now, e.g. `"ingest-key";r=5999;t=42`
              required: true
              description: The tightest limit now, e.g. `"ingest-key";r=5999;t=42`
            RateLimit-Policy:
              schema:
                type: string
                description: Its quota and window, e.g. `"ingest-key";q=6000;w=60`
              required: true
              description: Its quota and window, e.g. `"ingest-key";q=6000;w=60`
            Retry-After:
              schema:
                type: string
                description: Seconds to wait
              required: true
              description: Seconds to wait
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    ViewWho:
      anyOf:
        - type: string
          enum:
            - everyone
        - type: object
          properties:
            audience:
              type: string
              minLength: 1
              maxLength: 128
              description: An aud_… ID or the audience's key
          required:
            - audience
          additionalProperties: false
      description: 'Whose numbers: `everyone`, or the people of one audience'
    ViewMeasure:
      oneOf:
        - type: object
          properties:
            measure:
              type: string
              enum:
                - active_users
                - returning_users
                - new_users
              description: >-
                `active_users`: people with an event in the range.
                `returning_users`: those of them first seen before the range.
                `new_users`: people first seen in the range
          required:
            - measure
          additionalProperties: false
        - type: object
          properties:
            measure:
              type: string
              enum:
                - events
              description: Count events
            event:
              type: string
              maxLength: 100
              pattern: ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$
              description: Leave it out to count every event
            where:
              type: object
              properties:
                property:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: The property's name, as the event carries it (`plan`)
                equals:
                  anyOf:
                    - type: string
                      maxLength: 256
                    - type: number
                    - type: boolean
                  description: >-
                    The value it must have, compared exactly as text: 5 and
                    `"5"` match each other, `Pro` and `pro` do not
              required:
                - property
                - equals
              additionalProperties: false
              description: >-
                Only the events whose property has this value. Needs a named
                event.
          required:
            - measure
          additionalProperties: false
        - type: object
          properties:
            measure:
              type: string
              enum:
                - given
                - spent
                - held
              description: >-
                `given`: units added in the range. `spent`: units taken, as a
                positive number. `held`: what everyone holds at the end of the
                range
            unit:
              type: string
              pattern: ^[a-z][a-z0-9_-]{0,63}$
              description: The unit's key
          required:
            - measure
            - unit
          additionalProperties: false
      description: One thing to count. Each becomes one series in the answer
    ViewRange:
      type: string
      enum:
        - now
        - today
        - this_week
        - last_week
        - last_7_days
        - last_14_days
        - last_30_days
        - last_90_days
        - this_month
        - all_time
      description: >-
        The span a view covers, in the project's time zone; a week is Monday to
        Sunday. `now` is a moment, so only `held` can be read for it
    ViewShape:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - number
              description: One number for each measure
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - over_time
              description: A series for each measure, one point per `every`
            every:
              type: string
              enum:
                - day
                - week
                - month
              description: How long each point covers
          required:
            - type
            - every
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - list
              description: A ranked list, best first
            by:
              type: string
              enum:
                - user
                - rule
                - property
              description: >-
                Rank users, rank rules, or rank the values of one property of
                the event counted
            property:
              type: string
              minLength: 1
              maxLength: 64
              description: >-
                With `by: property`: the property's name, as the event carries
                it (`path`, `target`). A value that looks personal is counted
                under one row, Hidden (a best-effort check, not a guarantee:
                ranked values are as readable as a person's history)
            size:
              type: integer
              minimum: 1
              maximum: 100
              description: How many rows
          required:
            - type
            - by
            - size
          additionalProperties: false
      description: >-
        How the answer comes back: a number, a series over time, or a ranked
        list
    View:
      type: object
      properties:
        id:
          type: string
          pattern: ^view_[0-7][0-9a-hjkmnp-tv-z]{25}$
          description: A view ID, starting with `view_`.
        key:
          type: string
          pattern: ^[a-z][a-z0-9-]{0,63}$
          description: >-
            The view's key, unique in the project: lowercase words joined by
            dashes. It stands in for the ID in paths
        name:
          type: string
          description: The view's name
        shape:
          type: string
          enum:
            - number
            - over_time
            - list
          description: How its answer comes back, the type of its `definition.shape`
        visibility:
          $ref: '#/components/schemas/ViewVisibility'
        conversion:
          type: boolean
          description: >-
            Whether this view is a conversion: something you want people to do.
            Only a view that counts one named event can be one.
        updated_at:
          type: string
          format: date-time
          description: 'When it last changed: UTC, ISO 8601'
        description:
          type:
            - string
            - 'null'
          description: A note about the view; null if it has none
        definition:
          $ref: '#/components/schemas/ViewDefinition'
        endpoint:
          type: string
          description: 'Where it answers: /v1/views/returning-users'
        made_by:
          type: string
          enum:
            - template
            - member
            - key
            - agent
          description: >-
            Who saved it: a `template` installed, a `member` in the dashboard, a
            project `key`, or an `agent`
        template:
          type:
            - string
            - 'null'
          pattern: ^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$
          description: A template ID, starting with `tpl_`.
        dashboards:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                pattern: ^dash_[0-7][0-9a-hjkmnp-tv-z]{25}$
                description: A dashboard ID, starting with `dash_`.
              name:
                type: string
                description: The dashboard's name
            required:
              - id
              - name
          description: The dashboards that show this view
        created_at:
          type: string
          format: date-time
          description: 'When it was created: UTC, ISO 8601'
      required:
        - id
        - key
        - name
        - shape
        - visibility
        - conversion
        - updated_at
        - description
        - definition
        - endpoint
        - made_by
        - template
        - dashboards
        - created_at
      examples:
        - id: view_01m6gqxf40ermrwm4d7fx1w909
          key: top-earners
          name: Top earners
          shape: list
          visibility: team
          conversion: false
          updated_at: '2026-11-03T13:00:00.000Z'
          description: Who earned the most points this month
          definition:
            who: everyone
            what:
              - measure: given
                unit: points
            over: this_month
            shape:
              type: list
              by: user
              size: 10
          endpoint: /v1/views/top-earners
          made_by: key
          template: null
          dashboards: []
          created_at: '2026-11-03T13:00:00.000Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: integer
            code:
              type: string
              enum:
                - invalid_json
                - invalid_key
                - forbidden
                - approval_required
                - not_found
                - idempotency_conflict
                - conflict
                - unblock_clock_reversed
                - insufficient_balance
                - reference_used
                - validation_failed
                - rate_limited
                - internal
                - unavailable
            message:
              type: string
            param:
              type: string
            next_step:
              type: string
              description: >-
                What to do about this kind of error, in one sentence. Always
                sent by current servers
            request_id:
              type: string
            doc_url:
              type: string
              format: uri
          required:
            - status
            - code
            - message
            - request_id
            - doc_url
      required:
        - error
    ViewVisibility:
      type: string
      enum:
        - team
      description: 'Who can see the view. Only `team` exists: the project''s members'
    ViewDefinition:
      type: object
      properties:
        who:
          $ref: '#/components/schemas/ViewWho'
        what:
          type: array
          items:
            $ref: '#/components/schemas/ViewMeasure'
          minItems: 1
          maxItems: 4
          description: >-
            What to count: 1 to 4 measures. A list ranks by the first and shows
            the others as columns
        over:
          $ref: '#/components/schemas/ViewRange'
        shape:
          $ref: '#/components/schemas/ViewShape'
        source:
          type: string
          enum:
            - trusted
            - platform
            - onchain
            - web_identified
            - any
          description: >-
            Whose events this view counts. Left out is the same as platform:
            trusted and chat platform events (chat is not available yet).
            trusted: only your server, an agent or a person in Lurk. onchain:
            only Lurk's on-chain observations (not available yet).
            web_identified: server-verified web identification (not available
            yet). any: all sources; devices, on-chain observations and web
            identification are not available yet. Units given, spent and held,
            and new people are counted whatever this says
      required:
        - who
        - what
        - over
        - shape
      additionalProperties: false
      description: >-
        The question: whose numbers, what to count, over which range, as which
        shape
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A project key (Developers → API keys). Keep it on your server, not in an
        app.

````

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