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

# Create Ruleset



## OpenAPI

````yaml api-reference/openapi.json post /api/rulesets
openapi: 3.1.0
info:
  title: Enforster AI API
  description: Enforster AI API for code analysis and security scanning.
  version: 1.8.0
servers: []
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /api/rulesets:
    post:
      summary: Create Ruleset
      operationId: create_ruleset_api_rulesets_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RulesetCreateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RulesetResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    RulesetCreateRequest:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        rules_text:
          type: string
          title: Rules Text
        repo_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Repo Ids
      type: object
      required:
        - name
        - rules_text
      title: RulesetCreateRequest
    RulesetResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        rules_text:
          type: string
          title: Rules Text
        org_id:
          type: string
          title: Org Id
        repo_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Repo Ids
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
      type: object
      required:
        - id
        - name
        - description
        - rules_text
        - org_id
        - repo_ids
        - created_at
        - updated_at
        - created_by
      title: RulesetResponse
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Use an API key in the X-API-Key header.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Clerk JWT bearer token.

````