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

> ## Agent Instructions
> Cognite Data Fusion (CDF) is an industrial DataOps platform. Prefer English docs unless the user asks for another locale.
> Follow /_llms/ index links recursively until you reach page URLs ending in .md. Fetch those Markdown twins instead of HTML.
> For REST APIs, default to calendar version 20230101 (stable). Use 20230101-beta or 20230101-alpha only if the user is on a preview API. Cite paths under /api-reference/concepts/<version>/ and the Cdf-Version header. Prefer the Python SDK (cognite-sdk) unless the user is in JavaScript/TypeScript.
> Start here by task: platform overview /cdf/index.md; data modeling /cdf/dm/index.md; data integration /cdf/integration/index.md; access /cdf/access/index.md; CDF Toolkit /cdf/deploy/cdf_toolkit/index.md; REST quickstart /dev/quickstart.md; Python SDK https://cognite-sdk-python.readthedocs-hosted.com/en/stable/; Atlas AI /cdf/atlas_ai/index.md; plan an Atlas AI agent /cdf/atlas_ai/concepts/atlas_ai_agent_planning.md; Flows apps /cdf/flows/index.md; MCP and IDE setup /dev/guides/ide_ai_integration.md.
> For implementation work, also load /skill.md.

# Update access filters for a data product role

> 

> **Required capabilities:** `dataProductsAcl:UPDATE`

Incrementally adds, updates, or removes access filters for the role identified by `roleExternalId` in the request body. At least one of `add`, `update`, or `remove` must be provided. Each list is initially limited to one element. If the request includes `remove` together with `add` or `update`, removals are applied before adds and updates.



## OpenAPI

````yaml https://storage.googleapis.com/cognitedata-api-docs/dist/20230101-alpha.json post /dataproducts/{externalId}/roles/accessfilters/update
openapi: 3.1.0
info:
  title: Cognite API
  description: >-
    Reference documentation for the Cognite Data Fusion (CDF) API. See the [API
    introduction](/api-reference/concepts/20230101/api-description) and [API
    changelog](/api-reference/changelog).
  version: v1
  contact:
    name: Cognite Support
    url: https://support.cognite.com
    email: support@cognite.com
servers:
  - url: https://{cluster}.cognitedata.com/api/v1/projects/{project}
    description: The URL for the CDF cluster to connect to
    variables:
      cluster:
        enum:
          - api
          - az-tyo-gp-001
          - az-eastus-1
          - az-power-no-northeurope
          - westeurope-1
          - asia-northeast1-1
          - gc-dsm-gp-001
        default: api
        description: The CDF cluster to connect to
      project:
        default: publicdata
        description: The CDF project name.
security:
  - oidc-token:
      - https://{cluster}.cognitedata.com/.default
  - oauth2-client-credentials:
      - https://{cluster}.cognitedata.com/.default
  - oauth2-open-industrial-data:
      - https://api.cognitedata.com/.default
  - oauth2-auth-code:
      - https://{cluster}.cognitedata.com/.default
tags:
  - name: Token
  - name: Advanced joins
  - name: Assets
  - name: Data Modeling
    x-uri-format-fragments:
      - resource: Space
        uri-fragment: models/{space}
      - resource: Data Model
        uri-fragment: models/{space}/datamodel/{externalId}/{version}
      - resource: View
        uri-fragment: models/{space}/view/{externalId}/{version}
      - resource: Container
        uri-fragment: models/{space}/container/{externalId}
      - resource: Node
        uri-fragment: models/{space}/node/{externalId}
      - resource: Edge
        uri-fragment: models/{space}/edge/{externalId}
  - name: Streams
  - name: Records
  - name: Events
  - name: Files
  - name: Functions
  - name: Function calls
  - name: Function schedules
  - name: Function Apps
  - name: Function App Calls
  - name: Function App MCP
  - name: 3D
  - name: Time series
  - name: Data point subscriptions
  - name: Synthetic Time Series
  - name: Raw
    x-uri-format-fragments:
      - resource: Database
        uri-fragment: raw/{dbName}
      - resource: Table
        uri-fragment: raw/{dbName}/{tableName}
  - name: Groups
  - name: Projects
  - name: Security categories
  - name: Data sets
  - name: Limits
  - name: Metering
  - name: Sequences
  - name: Labels
  - name: Relationships
  - name: Entity matching
  - name: Entity matching pipelines
  - name: Diagram parsing
  - name: Vision
  - name: Agents
  - name: Skills
  - name: Project Configuration
  - name: Models
  - name: Chat Completions
  - name: Cognite AI
  - name: Documents
  - name: Document preview
    x-displayName: Preview
  - name: Geospatial
  - name: SessionsInternal
  - name: Sessions
  - name: Extraction Pipelines
  - name: Extraction Pipelines Runs
  - name: Extraction Pipelines Config
  - name: Extractors
  - name: Transformations
  - name: Transformation Jobs
  - name: Transformation Schedules
  - name: Transformation Notifications
  - name: Query
  - name: Schema
  - name: Transformation External Data Sources
  - name: Annotations
  - name: User profiles
  - name: Workflows
  - name: Workflow versions
  - name: Workflow executions
  - name: Tasks
  - name: Workflow triggers
  - name: Sources
  - name: Jobs
  - name: Destinations
  - name: Mappings
  - name: Previews
  - name: Postgres Gateway Users
  - name: Postgres Gateway Tables
  - name: SAP Instances
  - name: SAP Endpoints
  - name: Schema Mappings
  - name: Writeback Requests
  - name: Simulators
  - name: Simulator Integrations
  - name: Simulator Routines
  - name: Simulator Models
  - name: Simulation Runs
  - name: Simulator Logs
  - name: Units
  - name: Unit Systems
  - name: Application Data Storage
  - name: Location Filters
  - name: User Preferences
  - name: User History
  - name: Search Config
  - name: Organizations
  - name: Applications
  - name: Integrations
  - name: Integration Tasks
  - name: Integration Actions
  - name: Integration Configuration
  - name: Integration Errors
  - name: Principals
  - name: Signals
  - name: Data products
paths:
  /dataproducts/{externalId}/roles/accessfilters/update:
    post:
      tags:
        - Data products
      summary: Update access filters for a data product role
      description: >-


        > **Required capabilities:** `dataProductsAcl:UPDATE`


        Incrementally adds, updates, or removes access filters for the role
        identified by `roleExternalId` in the request body. At least one of
        `add`, `update`, or `remove` must be provided. Each list is initially
        limited to one element. If the request includes `remove` together with
        `add` or `update`, removals are applied before adds and updates.
      operationId: updateDataProductRoleAccessFilters
      parameters:
        - $ref: '#/components/parameters/dataProductExternalId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/DataProductRoleViewAccessFilterUpdateRequest
      responses:
        '200':
          description: The updated access filters for the role.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/DataProductRoleViewAccessFilter'
        '400':
          $ref: '#/components/responses/400ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    dataProductExternalId:
      name: externalId
      in: path
      description: |
        Data product external identifier
      required: true
      schema:
        $ref: '#/components/schemas/DataProductExternalId'
  schemas:
    DataProductRoleViewAccessFilterUpdateRequest:
      allOf:
        - type: object
          required:
            - roleExternalId
          properties:
            roleExternalId:
              $ref: '#/components/schemas/DataProductRoleExternalId'
        - $ref: '#/components/schemas/DataProductRoleViewAccessFilterPatch'
      description: >-
        Incrementally adds, updates, or removes access filters for the role
        identified by `roleExternalId`.
    DataProductRoleViewAccessFilter:
      type: object
      description: >-
        An access filter that grants a role read access to a single view, and
        optionally upsert and delete access. Omitting `read` means the role is
        granted no read access to the view. Omitting `upsert` or `delete` means
        the role is granted no upsert or delete access to the view. Legacy
        access filters may still include `write`, which can no longer be created
        or updated.
      required:
        - roleExternalId
        - view
        - createdTime
        - lastUpdatedTime
      properties:
        roleExternalId:
          $ref: '#/components/schemas/DataProductRoleExternalId'
        view:
          $ref: '#/components/schemas/DataProductRoleViewReference'
        read:
          description: >-
            A filter that constrains which instances of the view members of this
            role may read. If `read` is omitted, members of this role are not
            granted read access to the view. An empty `and` array grants read
            access to all instances of the view, with no property constraints.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
        write:
          description: >-
            Legacy. Write access filters can no longer be created or updated.
            Only filters created before write access was removed return this
            field.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
        upsert:
          description: >-
            A filter that constrains which instances of the view members of this
            role may upsert. If `upsert` is omitted, members of this role are
            not granted upsert access to the view.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
        delete:
          description: >-
            A filter that constrains which instances of the view members of this
            role may delete. If `delete` is omitted, members of this role are
            not granted delete access to the view.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
        createdTime:
          allOf:
            - $ref: '#/components/schemas/EpochTimestamp'
          readOnly: true
        lastUpdatedTime:
          allOf:
            - $ref: '#/components/schemas/EpochTimestamp'
          readOnly: true
    DataProductExternalId:
      type: string
      description: Data product external identifier
      pattern: ^[a-z]([a-z0-9_-]{0,98}[a-z0-9])?$
      minLength: 1
      maxLength: 100
    DataProductRoleExternalId:
      type: string
      description: >
        The external ID of the data product role. Uniquely identifies the role
        within its data product.
      pattern: ^[a-zA-Z]([a-zA-Z0-9_-]{0,48}[a-zA-Z0-9])?$
      minLength: 1
      maxLength: 50
    DataProductRoleViewAccessFilterPatch:
      type: object
      minProperties: 1
      description: >-
        Incrementally adds, updates, or removes access filters for a role. At
        least one of `add`, `update`, or `remove` must be provided. Each list is
        initially limited to one element.
      properties:
        add:
          type: array
          minItems: 1
          maxItems: 1
          description: >-
            Adds a new access filter. If an access filter for the same `view`
            already exists, the request fails.
          items:
            $ref: '#/components/schemas/DataProductRoleViewAccessFilterCreate'
          example:
            - view:
                space: my-schema-space
                externalId: assetView
              read:
                and:
                  - equals:
                      property: ownerId
                      value:
                        parameter: userIdentifier
        update:
          type: array
          minItems: 1
          maxItems: 1
          description: >-
            Updates an existing access filter identified by its `view`. The
            access filter must already exist.
          items:
            $ref: '#/components/schemas/DataProductRoleViewAccessFilterUpdate'
          example:
            - view:
                space: my-schema-space
                externalId: assetView
              read:
                set:
                  and:
                    - in:
                        property: siteId
                        values:
                          - SITE-001
        remove:
          type: array
          minItems: 1
          maxItems: 1
          uniqueItems: true
          description: >-
            Removes the access filter whose `view` matches the provided
            reference. Access filters that are not currently present are
            silently ignored.
          items:
            $ref: '#/components/schemas/DataProductRoleViewReference'
          example:
            - space: my-schema-space
              externalId: eventView
    DataProductRoleViewReference:
      type: object
      description: >-
        A reference to a data modeling view, identified by its space and
        external ID. The server resolves the view version.
      required:
        - space
        - externalId
      properties:
        space:
          allOf:
            - $ref: '#/components/schemas/Space'
            - description: The space where the view is located.
        externalId:
          $ref: '#/components/schemas/ViewExternalId'
      example:
        space: my-schema-space
        externalId: assetView
    DataProductRoleViewAccessFilterCondition:
      description: >-
        A filter with a mandatory top-level `and` that combines `equals` leaf
        filters, `in` leaf filters, or both. Values are literal strings,
        numbers, or booleans. In `equals` only, a value can be an object with
        `parameter` set to `userIdentifier`. An empty `and` array grants access
        to all instances of the view, with no property constraints.
      example:
        and:
          - equals:
              property:
                - my-schema-space
                - assetView/1
                - ownerId
              value:
                parameter: userIdentifier
          - equals:
              property:
                - my-schema-space
                - assetView/1
                - region
              value: EMEA
          - in:
              property:
                - space
              values:
                - my-instance-space
      type: object
      required:
        - and
      properties:
        and:
          description: >-
            All sub-filters must match. An empty array grants access to all
            instances of the view, with no property constraints.
          type: array
          minItems: 0
          maxItems: 5
          items:
            $ref: '#/components/schemas/DataProductRoleViewAccessFilterLeafFilter'
        resources:
          description: >-
            Resource types linked to the matching instances that this filter
            also grants access to, in addition to the instances themselves. If
            `resources` is omitted or empty, only the instances are covered.
          type: array
          uniqueItems: true
          minItems: 0
          maxItems: 2
          items:
            $ref: '#/components/schemas/DataProductRoleViewAccessFilterResource'
    EpochTimestamp:
      description: >-
        The number of milliseconds since 00:00:00 Thursday, 1 January 1970,
        Coordinated Universal Time (UTC), minus leap seconds.
      type: integer
      minimum: 0
      format: int64
      example: 1730204346000
    Error:
      type: object
      required:
        - code
        - message
      description: Cognite API error.
      properties:
        code:
          type: integer
          description: HTTP status code.
          format: int32
          example: 401
        message:
          type: string
          description: Error message.
          example: Could not authenticate.
        missing:
          type: array
          description: List of lookup objects that do not match any results.
          items:
            type: object
            additionalProperties: true
        duplicated:
          type: array
          description: List of objects that are not unique.
          items:
            type: object
            additionalProperties: true
    DataProductRoleViewAccessFilterCreate:
      type: object
      description: >-
        A new access filter for a role. `read` must be provided, and `upsert`
        and `delete` are optional.
      required:
        - view
        - read
      properties:
        view:
          $ref: '#/components/schemas/DataProductRoleViewReference'
        read:
          description: >-
            A filter that constrains which instances of the view members of this
            role may read. An empty `and` array grants read access to all
            instances of the view, with no property constraints.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
        upsert:
          description: >-
            A filter that constrains which instances of the view members of this
            role may upsert. If omitted, members of this role are not granted
            upsert access to the view.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
        delete:
          description: >-
            A filter that constrains which instances of the view members of this
            role may delete. If omitted, members of this role are not granted
            delete access to the view.
          allOf:
            - $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
    DataProductRoleViewAccessFilterUpdate:
      type: object
      description: >-
        Changes to apply to an existing access filter entry. `read` must be
        provided, and `upsert` and `delete` are optional. An omitted `upsert` or
        `delete` is left unchanged.
      required:
        - view
        - read
      properties:
        view:
          $ref: '#/components/schemas/DataProductRoleViewReference'
        read:
          $ref: >-
            #/components/schemas/SinglePatchDataProductRoleViewAccessFilterCondition
        upsert:
          $ref: >-
            #/components/schemas/SinglePatchDataProductRoleViewAccessFilterCondition
        delete:
          $ref: >-
            #/components/schemas/SinglePatchDataProductRoleViewAccessFilterCondition
    Space:
      type: string
      pattern: ^[a-zA-Z][a-zA-Z0-9_-]{0,41}[a-zA-Z0-9]?$
      minLength: 1
      maxLength: 43
    ViewExternalId:
      type: string
      pattern: ^[a-zA-Z]([a-zA-Z0-9_]{0,253}[a-zA-Z0-9])?$
      minLength: 1
      maxLength: 255
      description: The external ID of the view.
    DataProductRoleViewAccessFilterLeafFilter:
      description: A leaf filter — either an `equals` or an `in` filter.
      type: object
      oneOf:
        - $ref: '#/components/schemas/DataProductRoleViewAccessFilterEqualsFilter'
        - $ref: '#/components/schemas/DataProductRoleViewAccessFilterInFilter'
    DataProductRoleViewAccessFilterResource:
      description: >-
        A resource type linked to instances, such as the files or datapoints of
        a file or time series node.
      type: string
      enum:
        - FILES
        - DATA_POINTS
    SinglePatchDataProductRoleViewAccessFilterCondition:
      title: set
      type: object
      oneOf:
        - $ref: >-
            #/components/schemas/SetDataProductRoleViewAccessFilterConditionField
        - $ref: '#/components/schemas/RemoveField'
      description: >-
        Sets a new filter for this access on the view, or removes the field to
        revoke this access to the view. Omit the field from the update to leave
        its filter unchanged.
    DataProductRoleViewAccessFilterEqualsFilter:
      type: object
      title: equals
      required:
        - equals
      properties:
        equals:
          required:
            - property
            - value
          description: >-
            Matches items where the property equals the given value. The value
            must be a literal string, number, or boolean, or an object with
            `parameter` set to `userIdentifier`.
          type: object
          properties:
            property:
              $ref: '#/components/schemas/DataProductRoleViewAccessFilterProperty'
            value:
              $ref: >-
                #/components/schemas/DataProductRoleViewAccessFilterEqualsFilterValue
    DataProductRoleViewAccessFilterInFilter:
      type: object
      title: in
      required:
        - in
      properties:
        in:
          required:
            - property
            - values
          description: >-
            Matches items where the property exactly matches one of the given
            values. Each value must be a literal string, number, or boolean.
            Parameters are not supported in `in` filters.
          type: object
          properties:
            property:
              $ref: '#/components/schemas/DataProductRoleViewAccessFilterProperty'
            values:
              $ref: >-
                #/components/schemas/DataProductRoleViewAccessFilterInFilterValueList
    SetDataProductRoleViewAccessFilterConditionField:
      type: object
      title: set
      required:
        - set
      properties:
        set:
          $ref: '#/components/schemas/DataProductRoleViewAccessFilterCondition'
    RemoveField:
      title: remove
      type: object
      required:
        - setNull
      properties:
        setNull:
          type: boolean
          example: true
    DataProductRoleViewAccessFilterProperty:
      description: >-
        A property referenced in a view access filter. To reference the space of
        the instance, use `["space"]`. To reference a property through the
        container where it is defined, use `["space", "externalId",
        "identifier"]`. `space` and `externalId` are the space and external ID
        of the container, and `identifier` is one of the property identifiers
        defined in the container. To reference a property through one of the
        views that map it, use `["space", "externalId/version", "identifier"]`.
        `space`, `externalId`, and `version` are the space, external ID, and
        version of the view, and `identifier` is one of the property identifiers
        defined in the view.
      type: array
      minItems: 1
      maxItems: 3
      items:
        type: string
      example:
        - my-schema-space
        - assetView/1
        - region
    DataProductRoleViewAccessFilterEqualsFilterValue:
      description: >-
        A literal string, number, or boolean, or an object with `parameter` set
        to `userIdentifier`.
      oneOf:
        - type: string
        - type: number
        - type: boolean
        - $ref: '#/components/schemas/DataProductRoleViewAccessFilterParameterValue'
    DataProductRoleViewAccessFilterInFilterValueList:
      type: array
      minItems: 1
      maxItems: 19
      items:
        $ref: '#/components/schemas/DataProductRoleViewAccessFilterEqualsFilterValue'
    DataProductRoleViewAccessFilterParameterValue:
      title: parameter
      description: >-
        A parameterized filter value. The `parameter` field selects which
        runtime value to inject. Currently only `userIdentifier` is supported.
      type: object
      required:
        - parameter
      properties:
        parameter:
          $ref: '#/components/schemas/DataProductRoleViewAccessFilterParameter'
    DataProductRoleViewAccessFilterParameter:
      type: string
      enum:
        - userIdentifier
      description: >-
        The parameter to inject when evaluating a filter value. Currently only
        `userIdentifier` is supported. It resolves to the `userIdentifier` of
        the authenticated user.
  responses:
    400ErrorResponse:
      description: The response for a bad request.
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                $ref: '#/components/schemas/Error'
          example:
            error:
              code: 400
              message: '`null` values aren''t allowed.'
    ErrorResponse:
      description: The response for a failed request.
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                $ref: '#/components/schemas/Error'
  securitySchemes:
    oidc-token:
      type: http
      scheme: bearer
      bearerFormat: OpenID Connect or OAuth2 token
      description: >-
        Access token issued by the CDF project's configured identity provider.
        Access token must be an OpenID Connect token, and the project must be
        configured to accept OpenID Connect tokens. Use a header key of
        'Authorization' with a value of 'Bearer $accesstoken'. The token can be
        obtained through any flow supported by the identity provider.
    oauth2-client-credentials:
      type: oauth2
      description: >-
        Access token issued by the CDF project's configured identity provider.
        Access token must be an OpenID Connect token, and the project must be
        configured to accept OpenID Connect tokens. Use a header key of
        'Authorization' with a value of 'Bearer $accesstoken'. The token can be
        obtained through any flow supported by the identity provider.
      flows:
        clientCredentials:
          tokenUrl: https://your-idps.token.url/
          scopes:
            default: https://{cluster}.cognitedata.com/.default
    oauth2-open-industrial-data:
      type: oauth2
      description: >-
        Auth flow for Open Industrial Data. Get your client secret from
        https://hub.cognite.com/open-industrial-data-211.
      flows:
        clientCredentials:
          tokenUrl: >-
            https://login.microsoftonline.com/48d5043c-cf70-4c49-881c-c638f5796997/oauth2/v2.0/token
          scopes:
            default: https://api.cognitedata.com/.default
    oauth2-auth-code:
      type: oauth2
      description: >-
        Access token issued by the CDF project's configured identity provider.
        Access token must be an OpenID Connect token, and the project must be
        configured to accept OpenID Connect tokens. Use a header key of
        'Authorization' with a value of 'Bearer $accesstoken'. The token can be
        obtained through any flow supported by the identity provider.
      flows:
        authorizationCode:
          authorizationUrl: https://your-idps.authorization.url/
          tokenUrl: https://your-idps.token.url/
          scopes:
            default: https://{cluster}.cognitedata.com/.default

````