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

# Save a view

> Saves a grid view of accounts, contacts or opportunities as the app's Save view does: a name, the page (or tab) it belongs to, and optionally its filter (conditions, list_type), columns and sort. Private unless shared is true; default also makes it your default view of that page. A name you already use is a 409. Returns the view (201). By the app's rules: a key acts as the member who created it (a person's key as that person), and holds views:update to act as an admin.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/views
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/views:
    post:
      tags:
        - views
      summary: Save a view
      description: >-
        Saves a grid view of accounts, contacts or opportunities as the app's
        Save view does: a name, the page (or tab) it belongs to, and optionally
        its filter (conditions, list_type), columns and sort. Private unless
        shared is true; default also makes it your default view of that page. A
        name you already use is a 409. Returns the view (201). By the app's
        rules: a key acts as the member who created it (a person's key as that
        person), and holds views:update to act as an admin.
      operationId: views_create
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                columns:
                  anyOf:
                    - items:
                        $ref: '#/components/schemas/ColumnIn'
                      maxItems: 200
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    The grid's columns, in order, as GET /v1/views/{view_id}
                    shows them (read them, change them, send them back). Each
                    names a field of its object (GET /v1/fields): the view's
                    own, or account on an opportunities view. A field, subfield
                    or object the grid does not have is a 422. null: the page's
                    own columns
                  examples:
                    - - field: name
                      - field: arr
                        object: account
                      - field: manual_health__s_
                        object: account
                        subfields:
                          - manual_health_sentiment__s_
                  title: Columns
                conditions:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  description: >-
                    Which records the view selects: a filter tree in the app's
                    own format, as GET /v1/views/{view_id} shows a view's
                    conditions (read one, change it, send it back). A condition
                    names a field with an operation and a value; a group
                    combines conditions with and/or. A tree the app cannot read,
                    a condition on a field its entity does not have, or more
                    than 200 objects and lists, is a 422. null: every record
                  examples:
                    - and_conditions:
                        - entity: 4
                          field: name
                          operation: begins
                          value: Acme
                  title: Conditions
                default:
                  default: false
                  description: Also make it your default view of its table
                  title: Default
                  type: boolean
                list_type:
                  anyOf:
                    - enum:
                        - my_book
                        - team_book
                        - all_customers
                        - churned
                        - unset
                        - other
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    Whose records: my_book and team_book are the book of the
                    key's creator; null: every record
                  examples:
                    - my_book
                  title: List Type
                name:
                  description: Unique among your views
                  examples:
                    - Enterprise renewals
                  maxLength: 255
                  minLength: 1
                  title: Name
                  type: string
                shared:
                  default: false
                  description: A workspace view, which every member sees
                  title: Shared
                  type: boolean
                sort:
                  anyOf:
                    - items:
                        $ref: '#/components/schemas/SortKey'
                      maxItems: 10
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    The grid's sort, first key first, by a field (or one of its
                    subfields) of the view's own object; another field, or
                    another object's (the opportunities grid does not sort by
                    account columns), is a 422. Empty: unsorted
                  examples:
                    - - column: arr
                        direction: desc
                  title: Sort
                table:
                  description: >-
                    The app page (or page tab) to save it on: accounts, people,
                    opportunities, or a tab such as accounts_customer or
                    opportunities_renewal
                  examples:
                    - accounts
                  maxLength: 255
                  title: Table
                  type: string
              required:
                - name
                - table
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/View'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    ColumnIn:
      additionalProperties: false
      properties:
        field:
          description: The field's key on its object
          examples:
            - arr
          maxLength: 255
          minLength: 1
          title: Field
          type: string
        object:
          anyOf:
            - enum:
                - account
                - contact
                - opportunity
              type: string
            - type: 'null'
          default: null
          description: 'The field''s object. Left out: the view''s object'
          examples:
            - account
          title: Object
        subfields:
          description: >-
            For a field with subfields (GET /v1/fields): the subfields shown,
            each as its own column. Empty: the field itself
          examples:
            - - manual_health_sentiment__s_
          items:
            maxLength: 255
            minLength: 1
            type: string
          maxItems: 50
          title: Subfields
          type: array
      required:
        - field
      title: ColumnIn
      type: object
    SortKey:
      additionalProperties: false
      properties:
        column:
          description: A column's field key
          examples:
            - arr
          maxLength: 255
          minLength: 1
          title: Column
          type: string
        direction:
          default: asc
          description: asc or desc
          enum:
            - asc
            - desc
          title: Direction
          type: string
        object:
          anyOf:
            - enum:
                - account
                - contact
                - opportunity
              type: string
            - type: 'null'
          default: null
          description: 'The field''s object: the view''s own. Left out: the view''s object'
          examples:
            - account
          title: Object
        subfield:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: 'For a field with subfields: the subfield to sort by'
          examples:
            - street
          title: Subfield
      required:
        - column
      title: SortKey
      type: object
    View:
      properties:
        columns:
          anyOf:
            - items:
                $ref: '#/components/schemas/Column'
              type: array
            - type: 'null'
          description: 'The grid''s columns, in order; none: the page''s own'
          title: Columns
        conditions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            The view's filter, in the app's own filter format; none selects
            every record
          title: Conditions
        default:
          default: false
          description: The default view of its table for the key's creator
          title: Default
          type: boolean
        id:
          title: Id
          type: integer
        list_type:
          anyOf:
            - enum:
                - my_book
                - team_book
                - all_customers
                - churned
                - unset
                - other
              type: string
            - type: 'null'
          description: >-
            Whose records the view selects. my_book and team_book are the book
            of the key's creator; none means every record
          title: List Type
        name:
          title: Name
          type: string
        object:
          description: >-
            The records the view selects: pass its id as view_id to this
            object's list
          enum:
            - account
            - contact
            - opportunity
          title: Object
          type: string
        owner:
          anyOf:
            - $ref: '#/components/schemas/ViewOwner'
            - type: 'null'
        shared:
          description: A workspace view, which every member sees
          title: Shared
          type: boolean
        sort:
          description: The grid's sort, first key first
          items:
            $ref: '#/components/schemas/SortOrder'
          title: Sort
          type: array
        table:
          description: >-
            The app page (or page tab) the view belongs to, such as accounts or
            accounts_customer
          title: Table
          type: string
        type:
          enum:
            - view
            - segment
          title: Type
          type: string
      required:
        - id
        - name
        - object
        - table
        - type
        - shared
      title: View
      type: object
    Column:
      properties:
        field:
          description: The field's key on its object
          title: Field
          type: string
        object:
          description: >-
            The field's object: the view's own, or account on an opportunities
            view
          title: Object
          type: string
        subfields:
          description: >-
            For a field with subfields: the subfields shown; empty: the field
            itself
          items:
            type: string
          title: Subfields
          type: array
      required:
        - field
        - object
        - subfields
      title: Column
      type: object
    ViewOwner:
      properties:
        id:
          description: The owner's person id (GET /v1/objects/user/records)
          title: Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      required:
        - id
      title: ViewOwner
      type: object
    SortOrder:
      properties:
        column:
          description: A column's field key
          title: Column
          type: string
        direction:
          enum:
            - asc
            - desc
          title: Direction
          type: string
        object:
          description: 'The field''s object: the view''s own, or another one the app saved'
          title: Object
          type: string
        subfield:
          anyOf:
            - type: string
            - type: 'null'
          description: 'For a field with subfields: the subfield it sorts by'
          title: Subfield
      required:
        - column
        - object
        - subfield
        - direction
      title: SortOrder
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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