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

# Assign a role



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml post /rbac/bindings
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:
  /rbac/bindings:
    post:
      tags:
        - rbac
      summary: Assign a role
      requestBody:
        description: Binding
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/api.RoleBindingInput'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/api.RoleBindingResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api.RoleBindingInput:
      type: object
      properties:
        role_id:
          type: integer
        scope_id:
          type: string
        scope_type:
          type: string
          description: >-
            ScopeType is empty for a global binding (every Workspace) or

            "workspace"; ScopeID is then the Workspace id in canonical decimal

            form ("7"). Managing scoped bindings needs roles:write globally
            (D10).
        subject_id:
          type: integer
        subject_type:
          type: string
      description: Role binding input model
    api.RoleBindingResponse:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/api.RoleBindingAttributes'
        id:
          type: string
        type:
          type: string
      description: Role binding response model
    api.RoleBindingAttributes:
      type: object
      properties:
        created_at:
          type: string
        role:
          $ref: '#/components/schemas/rbac.RoleSummary'
        role_id:
          type: integer
        scope_id:
          type: string
        scope_type:
          type: string
        source:
          type: string
          description: |-
            Source is "host" for a binding the host application manages
            (read-only here), empty otherwise.
        subject_id:
          type: integer
        subject_type:
          type: string
      description: Role binding attributes
    rbac.RoleSummary:
      type: object
      properties:
        group_id:
          type: integer
          description: when Via == "group"
        group_name:
          type: string
          description: when Via == "group"
        id:
          type: integer
        is_system:
          type: boolean
        name:
          type: string
        slug:
          type: string
        via:
          type: string
          description: >-
            "direct" | "group" | "host" (direct, assigned by the host
            application)| "group"
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````