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

# Share a portal

> Lets external people in: by email, by domain (not a public provider such as gmail.com), or by a Rule on people's fields. A person needs a person record with that email to sign in; they see the accounts it is linked to. No email is sent: they sign in at the portal's address with a one-time code. An email or domain already granted comes back as it is. A portal has one Rule: a segment grant replaces its filter (at most one per call). A bad email, domain or Rule is a 422 and nothing is added. 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 post /v1/portals/{portal_id}/grants
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:
    post:
      tags:
        - portals
      summary: Share a portal
      description: >-
        Lets external people in: by email, by domain (not a public provider such
        as gmail.com), or by a Rule on people's fields. A person needs a person
        record with that email to sign in; they see the accounts it is linked
        to. No email is sent: they sign in at the portal's address with a
        one-time code. An email or domain already granted comes back as it is. A
        portal has one Rule: a segment grant replaces its filter (at most one
        per call). A bad email, domain or Rule is a 422 and nothing is added. A
        staff grant (a Statisfy person in your workspace) can't call this: it
        speaks for your workspace.
      operationId: portals_add_grants
      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
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                grants:
                  description: The grants to add
                  items:
                    $ref: '#/components/schemas/GrantInput'
                  maxItems: 100
                  minItems: 1
                  title: Grants
                  type: array
              required:
                - grants
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalGrants'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    GrantInput:
      properties:
        grantee_type:
          description: >-
            email: one person. domain: everyone whose email is at it (not a
            public provider such as gmail.com). segment: a Rule, everyone whose
            person record matches `segment`
          enum:
            - email
            - domain
            - segment
          title: Grantee Type
          type: string
        grantee_value:
          default: ''
          description: The email or the domain. Leave it out for a Rule
          maxLength: 320
          title: Grantee Value
          type: string
        segment:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: >-
            A Rule's filter: a CONTACT segment on people's fields. Only for
            segment
          title: Segment
      required:
        - grantee_type
      title: GrantInput
      type: object
    PortalGrants:
      properties:
        grants:
          items:
            $ref: '#/components/schemas/PortalGrant'
          title: Grants
          type: array
      required:
        - grants
      title: PortalGrants
      type: object
    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.