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

# Update pinned company views

> Set the company views a user has pinned to the tab bar of the companies table. The ordered list replaces the current one, so a single call pins, unpins and reorders views.

Replaces the company views a user has pinned to the tab bar of the companies table. Send the full ordered list: a single call pins, unpins and reorders views. `viewIds` must contain at least one view.

A user can pin public views, the private views they can access and built-in default views. The update fails, and nothing changes, if `viewIds` contains duplicates or a view the user cannot access.

<RequestExample>
  ```bash cURL theme={null}
  curl --request PUT \
    --url 'https://api.claap.io/v1/companies/views/pinned?userEmail=jane.doe%40example.com' \
    --header 'Content-Type: application/json' \
    --header 'X-Claap-Key: <api-key>' \
    --data '{
    "viewIds": [
      "Default_Recent",
      "Vw5Rm1Xq8Ld4Tn2Hc6Jp9"
    ]
  }'
  ```
</RequestExample>


## OpenAPI

````yaml PUT /v1/companies/views/pinned
openapi: 3.1.0
info:
  title: Claap API
  description: Development documentation
  version: 0.0.0
servers:
  - url: https://api.claap.io/
security:
  - ApiKey: []
paths:
  /v1/companies/views/pinned:
    put:
      description: >-
        Set the company views a user has pinned to the tab bar of the companies
        table. The ordered list replaces the current one, so a single call pins,
        unpins and reorders views.
      operationId: putV1CompaniesViewsPinned
      parameters:
        - in: query
          name: userEmail
          schema:
            type: string
            format: email
            description: >-
              Email address of the user whose pinned views are updated. It must
              belong to an active workspace member.
            example: jane.doe@example.com
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                viewIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    Identifiers of the views to pin, in tab bar order. Replaces
                    the current pinned views. Must contain at least one view;
                    each view must be accessible to the user, and must appear
                    only once.
                  minItems: 1
              required:
                - viewIds
            example:
              viewIds:
                - Default_Recent
                - Vw5Rm1Xq8Ld4Tn2Hc6Jp9
      responses:
        '200':
          description: Pinned company views were successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      $ref: '#/components/schemas/CompanyView'
                required:
                  - result
              example:
                result:
                  - viewId: Default_Recent
                    name: Recent
                    visibility: Public
                    icon: ':clock1:'
                    isDefault: true
                    ownerId: '#global'
                    columns:
                      - type: Default
                        columnId: Name
                        isHidden: false
                      - type: Default
                        columnId: Domain
                        isHidden: false
                      - type: Default
                        columnId: LastInteraction
                        isHidden: false
                    filters: {}
                    sort:
                      - field: LastInteraction
                        order: Desc
                  - viewId: Vw5Rm1Xq8Ld4Tn2Hc6Jp9
                    name: Target accounts
                    visibility: Public
                    icon: ':dart:'
                    isDefault: false
                    ownerId: Xk2Rd7Mv4Bn9Ts1Lq6Wf3
                    columns:
                      - type: Default
                        columnId: Name
                        isHidden: false
                      - type: Default
                        columnId: Domain
                        isHidden: false
                      - type: Default
                        columnId: Deals
                        isHidden: false
                    filters:
                      dealStatusIn:
                        - Open
                      hasInteraction: true
                    sort:
                      - field: Name
                        order: Asc
        '400':
          description: >-
            `userEmail` is not the email address of an active workspace member,
            `viewIds` is empty or contains duplicates, or a view does not exist
            or is not accessible to the user. Nothing is updated.
components:
  schemas:
    CompanyView:
      type: object
      properties:
        viewId:
          type: string
          description: The view identifier.
        name:
          type: string
          description: The view name.
        visibility:
          type: string
          enum:
            - Public
            - Private
          description: >-
            The view visibility. `Private` views are only returned by the pinned
            views endpoints; the other endpoints only access `Public` views.
        icon:
          type: string
          description: The view icon.
        isDefault:
          type: boolean
          description: >-
            Whether the view is a built-in default view. Default views cannot be
            updated or deleted.
        ownerId:
          type: string
          description: >-
            Claap user identifier of the view owner, or `#global` for built-in
            default views.
        columns:
          type: array
          items:
            $ref: '#/components/schemas/CompanyViewColumn'
          description: The columns of the companies table.
        filters:
          $ref: '#/components/schemas/CompanyViewFilters'
        sort:
          type: array
          items:
            $ref: '#/components/schemas/CompanyViewSortDimension'
          description: The sort order of the companies table.
      required:
        - viewId
        - name
        - visibility
        - isDefault
        - ownerId
        - columns
        - filters
        - sort
      description: A saved view of the companies table.
    CompanyViewColumn:
      type: object
      properties:
        columnId:
          type: string
          description: The built-in column identifier.
        isHidden:
          type: boolean
          description: Whether the column is hidden in the table.
          default: false
        type:
          type: string
          enum:
            - Default
          description: The column type. Only `Default` is supported today.
          default: Default
        width:
          type: number
          description: The column width, in pixels.
      required:
        - columnId
      description: A column of the companies table.
    CompanyViewFilters:
      type: object
      properties:
        contactIdIn:
          type: array
          items:
            type: string
          description: >-
            Only include companies linked to one of these CRM contact
            identifiers.
          default: []
        contactIdNotIn:
          type: array
          items:
            type: string
          description: Exclude companies linked to one of these CRM contact identifiers.
          default: []
        dealIdIn:
          type: array
          items:
            type: string
          description: Only include companies linked to one of these deal identifiers.
          default: []
        dealIdNotIn:
          type: array
          items:
            type: string
          description: Exclude companies linked to one of these deal identifiers.
          default: []
        dealStatusIn:
          type: array
          items:
            type: string
            enum:
              - Lost
              - Open
              - Won
          description: Only include companies with a deal in one of these statuses.
          default: []
        dealStatusNotIn:
          type: array
          items:
            type: string
            enum:
              - Lost
              - Open
              - Won
          description: Exclude companies with a deal in one of these statuses.
          default: []
        hasInteraction:
          type: boolean
          description: >-
            Only include companies with (true) or without (false) at least one
            interaction.
      description: >-
        The filters applied by the view to the companies table. All set filters
        must match.
    CompanyViewSortDimension:
      type: object
      properties:
        field:
          type: string
          enum:
            - ContactName
            - CreatedAt
            - DealCreatedAt
            - DealName
            - Domain
            - LastInteraction
            - Name
          description: The field to sort companies by.
        order:
          type: string
          enum:
            - Asc
            - Desc
          description: The sort direction.
      required:
        - field
        - order
      description: A sort dimension of the companies table.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Claap-Key

````

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