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

# Preview a Linear config

> A dry run: tries a draft config on recent issues and says which account each would go to, writing nothing. Needs integrations:write: the issues are Linear data. Calls Linear: a 409 when Linear is not connected, a 502 when Linear refuses or does not answer.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/linear/preview
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/integrations/linear/preview:
    post:
      tags:
        - integrations
      summary: Preview a Linear config
      description: >-
        A dry run: tries a draft config on recent issues and says which account
        each would go to, writing nothing. Needs integrations:write: the issues
        are Linear data. Calls Linear: a 409 when Linear is not connected, a 502
        when Linear refuses or does not answer.
      operationId: integrations_linear_preview
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                config:
                  $ref: '#/components/schemas/LinearTenantConfig'
                  description: >-
                    The draft config to try, in the shape of GET /config
                    (without `version`). Nothing is saved
                project_id:
                  anyOf:
                    - maxLength: 200
                      minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: Sample issues from this project only
                  title: Project Id
                sample_size:
                  default: 10
                  description: How many recent issues to try
                  maximum: 25
                  minimum: 1
                  title: Sample Size
                  type: integer
              required:
                - config
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinearPreview'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    LinearTenantConfig:
      description: >-
        Top-level tenant configuration for Linear.


        Stored in IntegrationConfiguration.configuration under
        integration_key="linear".

        The loader (config_loader.py) returns None on validation failure so the

        runtime can skip gracefully.
      properties:
        customer_resolution:
          description: >-
            Default resolver chain applied to issues without a matching
            project_rule. Empty means 'no default' — such issues resolve to no
            account and are skipped.
          items:
            $ref: '#/components/schemas/AccountResolverConfig'
          title: Customer Resolution
          type: array
        field_whitelist:
          $ref: '#/components/schemas/LinearFieldWhitelist'
          description: >-
            Default account/task field whitelist. LinearProjectRules may
            override via their own field_whitelist.
        project_ids:
          description: >-
            Linear project ids to sync. Drives the issue-fetch filter and the
            set of Statisfy projects/status-templates the bootstrap creates. May
            be empty (newly provisioned, nothing selected yet) — the runtime
            treats that as 'nothing to sync'.
          items:
            type: string
          title: Project Ids
          type: array
        project_rules:
          description: >-
            Per-project resolver/field/status overrides. The first active rule
            whose project_id matches is used.
          items:
            $ref: '#/components/schemas/LinearProjectRule'
          title: Project Rules
          type: array
        status_mappings:
          description: >-
            Optional per-(project, workflow-state) overrides of the default
            state.type → status group mapping.
          items:
            $ref: '#/components/schemas/LinearStatusMapping'
          title: Status Mappings
          type: array
      title: LinearTenantConfig
      type: object
    LinearPreview:
      properties:
        issues:
          items:
            $ref: '#/components/schemas/LinearPreviewIssue'
          title: Issues
          type: array
        match_rate:
          description: The share of the sample issues that matched an account, 0 to 1
          title: Match Rate
          type: number
        warnings:
          items:
            type: string
          title: Warnings
          type: array
      required:
        - issues
        - match_rate
        - warnings
      title: LinearPreview
      type: object
    AccountResolverConfig:
      description: >-
        How to map record rows to internal Statisfy account IDs.


        Used by warehouse integrations (postgres/redshift/bigquery/snowflake)
        and

        JIRA. The schema is integration-agnostic; resolver types are dispatched
        by

        the integration's hydrator.
      properties:
        abbreviations:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          default: null
          description: >-
            Map of summary prefix abbreviation to canonical customer name
            (abbreviation_map)
          title: Abbreviations
        column:
          description: Source column in record containing the identifier
          title: Column
          type: string
        custom_field_key:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Custom field key for custom_field/custom_field_bulk resolver types
          title: Custom Field Key
        cutoff:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          description: >-
            Fuzzy matching cutoff for account_name / parent_epic_summary /
            jira_field (name target) / payload_field (name target) resolvers
            (0.0-1.0). Default 0.5; tenants that need stricter matching (e.g.
            Eightfold's 0.9) set explicitly.
          title: Cutoff
        exclude_keywords:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            Parent-epic summaries equal (after strip) to any of these strings
            are skipped (parent_epic_summary). Exact-match semantics — list the
            full summary text, not a substring.
          title: Exclude Keywords
        field_to_parse:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Record key to parse for the abbreviation prefix (abbreviation_map;
            default 'summary')
          title: Field To Parse
        match_mode:
          anyOf:
            - enum:
                - exact
                - similar
              type: string
            - type: 'null'
          default: null
          description: >-
            How account_name and the name target of payload_field /
            rocketlane_field / jira_field / linear_field compare names. 'exact'
            matches the whole name, ignoring case. It compares the stored name
            as is, so a stored name with an edge space does not match. 'similar'
            or unset uses the fuzzy match with `cutoff`.
          title: Match Mode
        type:
          enum:
            - statisfy_account_id
            - crm_account_id
            - organization_id
            - email_domain
            - custom_field
            - custom_field_bulk
            - account_name
            - parent_epic_summary
            - abbreviation_map
            - jira_field
            - rocketlane_field
            - linear_field
            - payload_field
            - contact_email
          title: Type
          type: string
        value_transform:
          anyOf:
            - $ref: '#/components/schemas/ValueTransformConfig'
            - type: 'null'
          default: null
          description: >-
            Optional pre-lookup transforms on the extracted value. Honored by
            the jira_field resolver to express Milestone- and SproutsAI-style
            value shaping (prefix stripping, sentinel skipping, first-token
            extraction).
      required:
        - type
        - column
      title: AccountResolverConfig
      type: object
    LinearFieldWhitelist:
      description: >-
        Which Linear fields propagate to Statisfy account/task records.


        Each mapping points a Linear field at a pre-existing Statisfy custom
        field

        key (the wizard does not auto-provision fields — it maps onto fields the

        tenant already has). Mirrors jira.config_schema.FieldWhitelist but
        without

        the legacy `*_fields` name lists (Linear is config-only, no legacy
        tenants).
      properties:
        account_field_mappings:
          items:
            $ref: '#/components/schemas/LinearFieldMapping'
          title: Account Field Mappings
          type: array
        task_field_mappings:
          items:
            $ref: '#/components/schemas/LinearFieldMapping'
          title: Task Field Mappings
          type: array
      title: LinearFieldWhitelist
      type: object
    LinearProjectRule:
      description: |-
        Per-project handling rule for Linear issues.

        Project is the leaf scope — there is no further narrowing within it.
        Runtime picks the first active rule whose project_id matches (see
        LinearTenantConfig.select_rule_for_issue).
      properties:
        creates_task:
          default: true
          description: >-
            When False, matching issues do not create a Statisfy task; combined
            with account_field_mappings this projects account-level fields only.
          title: Creates Task
          type: boolean
        customer_resolution:
          description: >-
            Resolver chain tried in order; first non-None match wins. Equivalent
            to a CompositeResolver. Must contain at least one entry.
          items:
            $ref: '#/components/schemas/AccountResolverConfig'
          minItems: 1
          title: Customer Resolution
          type: array
        field_whitelist:
          anyOf:
            - $ref: '#/components/schemas/LinearFieldWhitelist'
            - type: 'null'
          default: null
          description: >-
            Optional account/task field whitelist for this rule; falls back to
            the tenant-level field_whitelist when unset.
        id:
          description: >-
            Stable client-side id used by the wizard UI as a React key.
            Auto-assigned at parse time for configs that don't carry one.
          title: Id
          type: string
        is_active:
          default: true
          description: When False, the rule is registered but not synced.
          title: Is Active
          type: boolean
        project_id:
          description: Linear project id this rule applies to.
          title: Project Id
          type: string
      required:
        - project_id
        - customer_resolution
      title: LinearProjectRule
      type: object
    LinearStatusMapping:
      description: >-
        Override the default group for one Linear workflow state.


        Scoped by Linear *project* (not team), matching this config's
        project-first

        shape — even though the underlying workflow state is owned by one of the

        project's member teams. Match by `workflow_state_id` (preferred) or

        `workflow_state_name`. When no mapping matches a state, the bootstrap

        derives the group from Linear's state.type.
      properties:
        project_id:
          description: Linear project id this override applies to.
          title: Project Id
          type: string
        status_group:
          enum:
            - NOT_STARTED
            - ACTIVE
            - DONE
            - ARCHIVED
          title: Status Group
          type: string
        workflow_state_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Linear workflow state id to match. Preferred over name.
          title: Workflow State Id
        workflow_state_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Linear workflow state name to match (used when id is absent).
          title: Workflow State Name
      required:
        - project_id
        - status_group
      title: LinearStatusMapping
      type: object
    LinearPreviewIssue:
      properties:
        fields_preview:
          additionalProperties:
            type: string
          description: A few of the issue's fields, by label
          title: Fields Preview
          type: object
        identifier:
          description: The issue key, such as ENG-123
          title: Identifier
          type: string
        issue_id:
          title: Issue Id
          type: string
        matched:
          title: Matched
          type: boolean
        resolved_account_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The account the issue would go to; null when none matched
          title: Resolved Account Id
        resolved_account_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolved Account Name
        resolved_via:
          anyOf:
            - type: string
            - type: 'null'
          description: The resolver that matched
          title: Resolved Via
        title:
          title: Title
          type: string
      required:
        - issue_id
        - identifier
        - title
        - fields_preview
        - resolved_account_id
        - resolved_account_name
        - resolved_via
        - matched
      title: LinearPreviewIssue
      type: object
    ValueTransformConfig:
      description: >-
        Pre-lookup transforms applied to a raw field value before resolver
        matching.


        Captures shapes the legacy per-tenant providers expressed in code: skip

        sentinel values (Milestone's "Milestone" literal), strip prefixes

        (Milestone's "CUST-" prefix), split on a separator and take the first

        token (SproutsAI's `summary.split("|")[0]`, Milestone's space- or

        underscore-split). All fields are optional and applied left-to-right in

        the order listed below. If any step yields an empty string the resolver

        treats the field as missing.


        Currently honored by `JiraFieldAccountResolver`. Future resolvers can
        opt

        in by reading `value_transform` and applying `apply_value_transform()`.
      properties:
        regex_extract:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Python regex pattern; if it matches, replace the value with the
            first capture group. Applied last so it can post-process the output
            of the other transforms.
          title: Regex Extract
        skip_if_contains:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: If the raw value contains this substring, return None / skip lookup.
          title: Skip If Contains
        skip_if_equals:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If the raw value equals this string (after strip), return None /
            skip lookup.
          title: Skip If Equals
        split_first_token:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Split the value on this separator and keep the first non-empty
            token. E.g. '|' for SproutsAI's 'Acme | INC-123' summary shape; ' '
            or '_' for Milestone.
          title: Split First Token
        strip_prefix:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: If the value starts with this prefix, remove it before lookup.
          title: Strip Prefix
      title: ValueTransformConfig
      type: object
    LinearFieldMapping:
      description: Pair a Linear issue field with the Statisfy custom field it writes to.
      properties:
        linear_field:
          description: >-
            Dotted path on the Linear issue node (e.g. 'project.name',
            'priorityLabel', 'labels', 'state.name').
          title: Linear Field
          type: string
        target_field_key:
          description: Statisfy custom field key the Linear value writes to.
          title: Target Field Key
          type: string
      required:
        - linear_field
        - target_field_key
      title: LinearFieldMapping
      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.