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

# Get Form Membership Context

> Whether this form names a membership field, and whether a plan links to it.

Reachable by anyone who can send a form, not only by template editors: the send
dialog refuses the whole selection when this probe fails, so gating it on templates
alone would make every form unsendable for a role holding submissions-read on its
own — the permission the forms list itself accepts (``GET /forms/table``).

Answered here rather than in the console because the form lists it is offered from
carry no blocks (``FormTable``), so the client would have to fetch the whole
structure to tell — and re-deriving the token rule client-side has already drifted
from this one twice. A saved response is the third reason: its text lives in Settings
rather than in the form, so a client holding the whole structure still could not tell.

``has_linked_plan`` is a boolean because 0↔1 is the whole question: a form with
membership variables and no plan is authorable and saveable but not fillable. How
many plans use it past the first changes nothing — such a form is sent from the
patient's membership either way, and the plan comes from the enrolment rather than
from anything counted here. The memberships list filtered by ``form_id`` would report
that count, but it needs ``memberships:read`` and the editor is gated on forms
permission alone.



## OpenAPI

````yaml get /forms/{form_id}/membership-context
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /forms/{form_id}/membership-context:
    get:
      tags:
        - Forms
      summary: Get Form Membership Context
      description: >-
        Whether this form names a membership field, and whether a plan links to
        it.


        Reachable by anyone who can send a form, not only by template editors:
        the send

        dialog refuses the whole selection when this probe fails, so gating it
        on templates

        alone would make every form unsendable for a role holding
        submissions-read on its

        own — the permission the forms list itself accepts (``GET
        /forms/table``).


        Answered here rather than in the console because the form lists it is
        offered from

        carry no blocks (``FormTable``), so the client would have to fetch the
        whole

        structure to tell — and re-deriving the token rule client-side has
        already drifted

        from this one twice. A saved response is the third reason: its text
        lives in Settings

        rather than in the form, so a client holding the whole structure still
        could not tell.


        ``has_linked_plan`` is a boolean because 0↔1 is the whole question: a
        form with

        membership variables and no plan is authorable and saveable but not
        fillable. How

        many plans use it past the first changes nothing — such a form is sent
        from the

        patient's membership either way, and the plan comes from the enrolment
        rather than

        from anything counted here. The memberships list filtered by ``form_id``
        would report

        that count, but it needs ``memberships:read`` and the editor is gated on
        forms

        permission alone.
      operationId: get_form_membership_context_forms__form_id__membership_context_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: form_id
          in: path
          required: true
          schema:
            type: string
            title: Form Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormMembershipContext'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FormMembershipContext:
      properties:
        usesMembershipVariables:
          type: boolean
          title: Usesmembershipvariables
        hasLinkedPlan:
          type: boolean
          title: Haslinkedplan
      type: object
      required:
        - usesMembershipVariables
        - hasLinkedPlan
      title: FormMembershipContext
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````