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

# Get the field automation rules

> The workspace's rules that create a project from a template for every account in a segment and put it in an account lookup field: the field a portal shows an account's project (an onboarding plan, a success plan) from. One rule set for the workspace, not per portal. Needs settings access, as in the app.



## OpenAPI

````yaml /api/statisfy-api.openapi.json get /v1/portals/field-automation
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/field-automation:
    get:
      tags:
        - portals
      summary: Get the field automation rules
      description: >-
        The workspace's rules that create a project from a template for every
        account in a segment and put it in an account lookup field: the field a
        portal shows an account's project (an onboarding plan, a success plan)
        from. One rule set for the workspace, not per portal. Needs settings
        access, as in the app.
      operationId: portals_get_field_automation
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldAutomationRules'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    FieldAutomationRules:
      properties:
        rules:
          description: Every rule in the workspace
          items:
            $ref: '#/components/schemas/FieldAutomationRule'
          title: Rules
          type: array
      required:
        - rules
      title: FieldAutomationRules
      type: object
    FieldAutomationRule:
      properties:
        action:
          $ref: '#/components/schemas/FieldAutomationAction'
        flow_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'The rule''s id: send it back to keep the rule when saving'
          title: Flow Id
        segment:
          additionalProperties: true
          description: >-
            Which accounts: an ACCOUNT segment's conditions tree
            ({"and_conditions": [...]} or {"or_conditions": [...]} of {"field",
            "operation", "value", "entity": 4} filters). A filter "target field
            is empty" is always added, so an account gets one project
          title: Segment
          type: object
      required:
        - flow_id
        - segment
        - action
      title: FieldAutomationRule
      type: object
    FieldAutomationAction:
      properties:
        target_field_key:
          description: >-
            The account lookup field that gets the new project: the key of an
            account field of type lookup to projects (GET /v1/fields)
          title: Target Field Key
          type: string
        template_id:
          description: >-
            The project template to create the project from: an id from GET
            /v1/project_templates
          title: Template Id
          type: string
        trigger_existing:
          description: >-
            Also create the project for accounts that already match, not only
            new matches
          title: Trigger Existing
          type: boolean
        type:
          const: create_project
          description: 'What the rule does: create_project'
          title: Type
          type: string
      required:
        - type
        - template_id
        - target_field_key
        - trigger_existing
      title: FieldAutomationAction
      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.