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

# Get view

> Get view details with activity, resource count, and associated templates



## OpenAPI

````yaml /api-reference/cx/swagger.json get /library/view/{view}
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /library/view/{view}:
    get:
      tags:
        - library
      summary: Get view
      description: Get view details with activity, resource count, and associated templates
      parameters:
        - description: View ID
          name: view
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: View details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_library_views.GetViewResponse'
        '400':
          description: Bad request - invalid view ID
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: View not found or no access
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_library_views.GetViewResponse:
      type: object
      properties:
        view:
          $ref: '#/components/schemas/types.View'
    types.View:
      type: object
      properties:
        _id:
          type: string
        activity:
          description: For returning
          type: array
          items:
            $ref: '#/components/schemas/types.Activity'
        created_at:
          type: string
        default_for:
          description: >-
            This will be the default team for resources (clients/plans) that
            meet the criteria

            Sample keys: status, type, etc.
          type: object
          additionalProperties:
            type: string
        deleted_at:
          type: string
        description:
          type: string
        elements:
          type: array
          items:
            $ref: '#/components/schemas/types.Element'
        is_default:
          description: IsDefault is true when DefaultFor has any criteria.
          type: boolean
        n_fields:
          description: >-
            NumFields counts Field elements; headings and paragraphs are
            excluded.
          type: integer
        name:
          type: string
        on_type:
          description: client, plan, project OR all/empty
          type: string
        resource_type:
          description: ResourceType aliases OnType for the views table.
          type: string
        resources:
          description: >-
            Resources is the number of records of OnType that point at this
            view.
          type: integer
        resources_used_in:
          description: >-
            ResourcesUsedIn is the same count as Resources, named for the table
            column.
          type: integer
        team:
          type: string
        templates:
          description: Templates is the project templates that render this view.
          type: array
          items:
            $ref: '#/components/schemas/types.IDTitle'
    types.Activity:
      type: object
      properties:
        _id:
          type: string
        action:
          type: string
        changes:
          type: array
          items:
            $ref: '#/components/schemas/types.Change'
        client:
          type: string
        on_id:
          type: string
        on_py:
          type: integer
        on_type:
          type: string
        team:
          type: string
        timestamp:
          type: string
        user:
          type: string
    types.Element:
      type: object
      properties:
        content:
          type: string
        field:
          description: Field key if applicable
          type: string
        type:
          description: H1, H2, P, Field
          type: string
    types.IDTitle:
      type: object
      properties:
        _id:
          type: string
        title:
          type: string
    types.Change:
      type: object
      properties:
        data:
          type: string
        field:
          type: string
        from:
          type: string
        to:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

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