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

# Create or update a role binding

> Create or update a role binding from a validated manifest. Matching is by name.



## OpenAPI

````yaml /openapi.json put /api/svc/v1/role-bindings
openapi: 3.1.0
info:
  title: TrueFoundry API
  description: API for TrueFoundry
  version: 0.1.0
  contact: {}
servers:
  - url: https://{controlPlaneURL}
    variables:
      controlPlaneURL:
        default: app.truefoundry.com
        description: Control Plane URL
security: []
tags:
  - name: Agent
  - name: Agent Skills
  - name: Applications
  - name: Metrics
  - name: Apply
  - name: Artifacts
  - name: Audit Logs
  - name: Clusters
  - name: Jobs
  - name: LLM Gateway Budgets
  - name: Logs
  - name: MCP Registry
  - name: MCP Servers V2
  - name: MLRepos
  - name: Model Deployments
  - name: Models
  - name: Personal Access Tokens
  - name: Prompts
  - name: Provider Integrations
  - name: SCIM v2
  - name: Secret Groups
  - name: Secrets
  - name: Teams
  - name: Traces
  - name: Users
  - name: Virtual Accounts
  - name: Role Bindings
  - name: Workspaces
  - name: Provider Accounts
paths:
  /api/svc/v1/role-bindings:
    put:
      tags:
        - Role Bindings
        - public
      summary: Create or update a role binding
      description: >-
        Create or update a role binding from a validated manifest. Matching is
        by name.
      operationId: RoleBinding.createOrUpdate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrUpdateRoleBindingRequestDto'
      responses:
        '200':
          description: The created or updated role binding.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRoleBindingResponse'
        '422':
          description: Unprocessable Entity — manifest validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
      security:
        - jwt: []
components:
  schemas:
    CreateOrUpdateRoleBindingRequestDto:
      type: object
      properties:
        manifest:
          oneOf:
            - $ref: '#/components/schemas/RoleBindingManifest'
          description: Role binding manifest
        dryRun:
          type: boolean
          default: false
          description: >-
            Whether to validate the manifest and return a preview without
            persisting.
          nullable: true
      required:
        - manifest
      title: CreateOrUpdateRoleBindingRequestDto
      x-fern-type-name: CreateOrUpdateRoleBindingRequestDto
    GetRoleBindingResponse:
      type: object
      properties:
        data:
          description: The role binding object.
          allOf:
            - $ref: '#/components/schemas/RoleBinding'
      required:
        - data
      title: GetRoleBindingResponse
      x-fern-type-name: GetRoleBindingResponse
    HttpError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP Status Code
        message:
          type: string
          description: Error Message
        code:
          oneOf:
            - type: integer
            - type: string
          description: Error code
          nullable: true
        details:
          type: array
          description: Error details
          items:
            type: object
          nullable: true
      required:
        - statusCode
        - message
      title: HttpError
      x-fern-type-name: HttpError
    RoleBindingManifest:
      type: object
      required:
        - type
        - name
        - subjects
        - permissions
      properties:
        type:
          description: +value=role-binding
          type: string
          enum:
            - role-binding
          default: role-binding
        name:
          description: Unique name for this role binding.
          type: string
          pattern: ^[a-z][a-z0-9-]{1,64}[a-z0-9]$
        subjects:
          description: >-
            One row per principal; set type and name (email, team name, virtual
            account name, agent name, or external identity name).
          type: array
          items:
            $ref: '#/components/schemas/RoleBindingSubject'
        permissions:
          description: Resource-scoped role grants (resource type, FQN, and role name).
          type: array
          items:
            $ref: '#/components/schemas/RoleBindingPermission'
      title: RoleBindingManifest
      x-fern-type-name: RoleBindingManifest
    RoleBinding:
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
        accountId:
          type: string
        manifest:
          oneOf:
            - $ref: '#/components/schemas/RoleBindingManifest'
          description: Stored role binding manifest
        metadata:
          type: object
          additionalProperties: true
          nullable: true
        createdBySubject:
          $ref: '#/components/schemas/Subject'
        createdAt:
          format: date-time
          type: string
          nullable: true
        updatedAt:
          format: date-time
          type: string
          nullable: true
      required:
        - name
        - accountId
        - manifest
        - createdBySubject
      title: RoleBinding
      x-fern-type-name: RoleBinding
    RoleBindingSubject:
      description: >-
        Single row per principal: type selects how to interpret name (email vs
        names).

        Field names mirror the manifest root (type + name) for consistency in
        the UI and YAML.
      type: object
      required:
        - type
        - name
      properties:
        type:
          description: >-
            Whether this row identifies a user (email), a team (name), a virtual
            account (name), or an agent (name).
          type: string
          enum:
            - user
            - team
            - virtualaccount
            - agent
        name:
          description: >-
            User email when type is user; team, virtual account, or agent name
            otherwise.
          type: string
          minLength: 1
          maxLength: 1024
      title: RoleBindingSubject
      x-fern-type-name: RoleBindingSubject
    RoleBindingPermission:
      description: Grants a named account role on a specific resource identified by FQN.
      type: object
      required:
        - resourceType
        - resourceFqn
        - role
      properties:
        resourceType:
          description: Target resource kind (e.g. workspace, cluster, ml-repo).
          type: string
          minLength: 1
          maxLength: 128
        resourceFqn:
          description: Fully qualified name of the resource.
          type: string
          minLength: 1
          maxLength: 1024
        role:
          description: Name of the role to bind (e.g. workspace-editor, model-user).
          type: string
          minLength: 1
          maxLength: 255
      title: RoleBindingPermission
      x-fern-type-name: RoleBindingPermission
    Subject:
      type: object
      properties:
        subjectId:
          type: string
          description: Subject ID
        subjectType:
          type: string
          description: Subject type
          enum:
            - user
            - team
            - serviceaccount
            - virtualaccount
            - agent-identity
            - agent
            - agent-channel-identity
            - role
        subjectSlug:
          type: string
          description: Subject slug
          nullable: true
        subjectDisplayName:
          type: string
          description: Subject display name
          nullable: true
        subjectPatName:
          type: string
          description: Subject PAT name
          nullable: true
        subjectControllerName:
          type: string
          nullable: true
        subjectExternalIdentitySlug:
          type: string
          description: External identity slug (external_identity_id:sub:email)
          nullable: true
      required:
        - subjectId
        - subjectType
      title: Subject
      x-fern-type-name: Subject
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.