> ## 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.

# Change a portal Rule

> Replaces a Rule grant's filter. An email or domain grant has none: remove it and add another. A staff grant (a Statisfy person in your workspace) can't call this: it speaks for your workspace.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/portals/{portal_id}/grants/{grant_id}
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/portals/{portal_id}/grants/{grant_id}:
    patch:
      tags:
        - portals
      summary: Change a portal Rule
      description: >-
        Replaces a Rule grant's filter. An email or domain grant has none:
        remove it and add another. A staff grant (a Statisfy person in your
        workspace) can't call this: it speaks for your workspace.
      operationId: portals_update_grant
      parameters:
        - description: >-
            The portal's id, as GET /v1/portals (or the portal_list MCP tool)
            returns it
          in: path
          name: portal_id
          required: true
          schema:
            format: uuid
            type: string
        - description: The grant's id, as GET /v1/portals/{portal_id}/grants returns it
          in: path
          name: grant_id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                segment:
                  additionalProperties: true
                  description: The Rule's new filter. Only a Rule (segment) grant has one
                  title: Segment
                  type: object
              required:
                - segment
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalGrant'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    PortalGrant:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        granted_by:
          description: Who added it
          title: Granted By
          type: string
        grantee_type:
          description: >-
            email (one person), domain (everyone with an email there) or segment
            (a Rule on people's fields)
          enum:
            - email
            - domain
            - segment
          title: Grantee Type
          type: string
        grantee_value:
          description: The email or domain; empty for a Rule
          title: Grantee Value
          type: string
        id:
          description: The grant's id, as GET /v1/portals/{portal_id}/grants returns it
          title: Id
          type: string
        reach:
          anyOf:
            - $ref: '#/components/schemas/GrantReach'
            - type: 'null'
          description: >-
            Who the grant matches today. Whether they can sign in now also
            depends on the external switch: check one address with POST
            /v1/portals/{portal_id}/access-check
        segment:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: 'A Rule''s filter: a CONTACT segment on people''s fields'
          title: Segment
      required:
        - id
        - grantee_type
        - grantee_value
        - segment
        - granted_by
        - created_at
      title: PortalGrant
      type: object
    GrantReach:
      description: >-
        Who a portal grant reaches today. Email grants carry `status` and
        `accounts`; domain and

        Rule grants carry `people`.
      properties:
        accounts:
          anyOf:
            - type: integer
            - type: 'null'
          description: 'An email grant: how many accounts its person will see'
          title: Accounts
        people:
          anyOf:
            - type: integer
            - type: 'null'
          description: 'A domain or Rule grant: how many people it matches today'
          title: People
        status:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            An email grant's person: 'external' (an external user), 'internal'
            (one of your people), 'not_external' (neither), or
            'no_person_record' (no person with that email yet, so they can't
            sign in)
          title: Status
      title: GrantReach
      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.