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

# Create a Studio-managed Tyk policy (minimal creator)



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml post /tyk-connections/{id}/policies
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /tyk-connections/{id}/policies:
    post:
      tags:
        - TykMCP
      summary: Create a Studio-managed Tyk policy (minimal creator)
      parameters:
        - name: id
          in: path
          description: Connection ID
          required: true
          schema:
            type: integer
      requestBody:
        description: Policy
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tykmcp.PolicyInput'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.TykPolicyResponse'
components:
  schemas:
    tykmcp.PolicyInput:
      type: object
      properties:
        key_expires_in:
          type: integer
        kind:
          type: string
          description: access | consumption
        name:
          type: string
        per:
          type: integer
        pin:
          type: boolean
          description: Pin adds the new policy to ServerID's bundle straight away.
        quota_max:
          type: integer
        quota_renewal_rate:
          type: integer
        rate:
          type: integer
        server_id:
          type: integer
    models.TykPolicyResponse:
      type: object
      properties:
        active:
          type: boolean
        api_ids:
          type: array
          items:
            type: string
        connection_id:
          type: integer
        dashboard_state:
          type: string
        id:
          type: integer
        is_inactive:
          type: boolean
        is_partitioned:
          type: boolean
        key_expires_in:
          type: integer
        last_seen_at:
          type: string
        mcp_api_ids:
          type: array
          items:
            type: string
        name:
          type: string
        partitions:
          $ref: '#/components/schemas/models.TykPolicyPartitions'
        raw:
          type: object
          properties: {}
        studio_managed:
          type: boolean
        tags:
          type: array
          items:
            type: string
        tyk_policy_id:
          type: string
    models.TykPolicyPartitions:
      type: object
      properties:
        acl:
          type: boolean
        complexity:
          type: boolean
        per_api:
          type: boolean
        quota:
          type: boolean
        rate_limit:
          type: boolean

````