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

# Enroll or unenroll the caller in a feature flag

> > ⚠️ This endpoint is in [public preview](/preview/roadmap).

Set the caller's enrollment state for a self-enrollable feature flag.



## OpenAPI

````yaml /preview/openapi.json post /preview/v2/feature_flags/{feature_flag}
openapi: 3.1.0
info:
  title: sfc-api
  description: >-
    Public preview API - subject to change. See
    https://docs.sfcompute.com/preview/roadmap for details.
  version: 0.1.0
servers:
  - url: https://api.sfcompute.com
security:
  - bearer_auth: []
tags:
  - name: Account
    description: The authenticated account and logged-in user.
  - name: Pools
    description: A bucket of owned compute balance over time.
  - name: Orders
    description: >-
      Place orders targeting a capacity to increase your reserved compute
      balance during some time period.
  - name: Instance Templates
    description: Reusable instance configuration.
  - name: Images
    description: Custom machine images for instances.
  - name: Roles
    description: TOML-based permission role definitions.
  - name: Grants
    description: Bind principals (users or tokens) to roles on a workspace.
  - name: Tokens
    description: Workspace-scoped API tokens.
  - name: Instances
    description: Spin up instances in a capacity to use your available compute.
  - name: Instance SKU Catalog
    description: Browse available instance SKU property definitions.
  - name: Procurements
    description: Market automations that maintain capacity by placing buy/sell orders.
  - name: Deployments
    description: >-
      Deployment automations that maintain a fleet of instances, including spot
      deployments that buy capacity up to a maximum price.
  - name: Users
    description: Read-only access to users within the caller's organization.
  - name: Workspaces
    description: Resource containers scoped to an account.
  - name: Permissions
    description: Inspect what the caller is allowed to do.
  - name: Billing
    description: Billing profile, contacts, and auto top-up settings.
  - name: Orderbook
    description: >-
      Read-only orderbook visibility: bid/ask spread, depth of book, and
      historical fills, keyed on hardware requirements + delivery window.
  - name: Orders
    description: >-
      Estimate an order before placing it: filled price, fee, and operational
      notices.
paths:
  /preview/v2/feature_flags/{feature_flag}:
    post:
      tags:
        - Feature Flags
      summary: Enroll or unenroll the caller in a feature flag
      description: |-
        > ⚠️ This endpoint is in [public preview](/preview/roadmap).

        Set the caller's enrollment state for a self-enrollable feature flag.
      operationId: setFeatureFlagEnrollment
      parameters:
        - name: feature_flag
          in: path
          description: Feature flag name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetEnrollmentRequest'
        required: true
      responses:
        '200':
          description: Enrollment updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetEnrollmentResponse'
        '401':
          description: Unauthorized
        '403':
          description: Feature flag is not self-enrollable
        '404':
          description: Feature flag doesn't exist or is unavailable
        '500':
          description: Internal server error
      security:
        - bearer_auth: []
components:
  schemas:
    SetEnrollmentRequest:
      type: object
      required:
        - enrolled
      properties:
        enrolled:
          type: boolean
    SetEnrollmentResponse:
      type: object
      required:
        - object
        - feature_flag
        - enrolled
      properties:
        object:
          type: string
          const: feature_flag
          default: feature_flag
          readOnly: true
        feature_flag:
          type: string
        enrolled:
          type: boolean
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Create an API token using `sf tokens create` or at
        https://sfcompute.com/account/api-keys.

````