---
title: "Assign a role to a System Account (Internal)"
url: "https://nov18-dev.movespot.fyi/apis/konnect-identity-management-internal-2/versions/770972f0-aec8-404b-85ec-1d58e7079be2/operations/create-system-accounts-assigned-roles-internal"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-identity-management-internal-2/versions/770972f0-aec8-404b-85ec-1d58e7079be2.md

# Assign a role to a System Account (Internal)

`POST` `/internal/system-accounts/{accountId}/assigned-roles`

Operation ID: `create-system-accounts-assigned-roles-internal`

Assigns a role to a managed system account. Returns 409 if role is already assigned.

## Path parameters

- `accountId` (string, required) - ID of the system account.

## Request body

Content types: `application/json`

## Responses

- `201` - A get response of a single parameterized assigned role.
- `401` - Unauthenticated
- `403` - Unauthorized
- `404` - Not Found
- `409` - Conflict

## OpenAPI definition

```yaml
openapi: 3.0.2
info:
  title: Konnect Identity Management
  version: 2.0.0
servers:
  - url: https://global.api.konghq.com/v2
    description: Global Base URL
paths:
  /internal/system-accounts/{accountId}/assigned-roles:
    parameters:
      - name: accountId
        in: path
        description: ID of the system account.
        required: true
        schema:
          type: string
    post:
      operationId: create-system-accounts-assigned-roles-internal
      summary: Assign a role to a System Account (Internal)
      description: Assigns a role to a managed system account. Returns 409 if role is
        already assigned.
      requestBody:
        $ref: "#/components/requestBodies/AssignParameterizedRole"
      responses:
        "201":
          $ref: "#/components/responses/ParameterizedAssignedRoleSingle"
        "401":
          $ref: "#/components/responses/IdentityUnauthenticated"
        "403":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/IdentityNotFound"
        "409":
          $ref: "#/components/responses/IdentityConflict"
      security:
        - clientToken: []
      tags:
        - Managed System Accounts - Roles
security:
  - clientToken: []
components:
  requestBodies:
    AssignParameterizedRole:
      content:
        application/json:
          schema:
            description: A parameterized assigned role is a role that has been assigned to a
              managed system account.
            type: object
            properties:
              role_name:
                description: The desired role.
                type: string
                example: Connector
              entity_id:
                description: The ID of the entity.
                type: string
                format: uuid
                example: e67490ce-44dc-4cbd-b65e-b52c746fc26a
              entity_type_name:
                description: The type of entity.
                type: string
                example: Mesh Control Planes
              entity_region:
                description: The region to scope the role assignment to.
                type: string
                example: eu
                enum:
                  - us
                  - eu
                  - au
                  - me
                  - in
                  - sg
                  - "*"
              parameters:
                example:
                  zoneName: zone3
                type: object
          examples:
            Parameterized-Assigned-Role:
              $ref: "#/components/examples/Parameterized-Assigned-Role-Example"
      description: The request schema for assigning a role.
  responses:
    ParameterizedAssignedRoleSingle:
      description: A get response of a single parameterized assigned role.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ParameterizedAssignedRole"
          examples:
            Assigned Role Example:
              $ref: "#/components/examples/Parameterized-Assigned-Role-Example"
    IdentityUnauthenticated:
      description: Unauthenticated
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
          examples:
            Unauthorized:
              $ref: "#/components/examples/401-unauthenticated"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            description: The error response object.
            type: object
            properties:
              status:
                description: The HTTP status code.
                type: integer
                example: 403
              title:
                description: The Error Response.
                type: string
                example: Unauthorized
              instance:
                description: The Konnect traceback code.
                type: string
                example: konnect:trace:952172606039454040
              detail:
                description: Details about the error response.
                type: string
                example: You do not have permission to perform this action
          examples:
            Unauthorized:
              $ref: "#/components/examples/403-permission-denied"
    IdentityNotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
          examples:
            Not Found:
              $ref: "#/components/examples/404-not-found"
    IdentityConflict:
      description: Conflict
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ConflictError"
          examples:
            User is Already Active:
              $ref: "#/components/examples/409-user-is-already-active"
  examples:
    Parameterized-Assigned-Role-Example:
      value:
        id: eaf7adf1-32c8-4bbf-b960-d1f8456afe67
        role_name: Connector
        entity_id: 18ee2573-dec0-4b83-be99-fa7700bcdc61
        entity_type_name: Mesh Control Planes
        entity_region: eu
        parameters:
          zoneName: zone4
    401-unauthenticated:
      value:
        status: 401
        title: Unauthenticated
        instance: konnect:trace:952172606039454040
        detail: A valid token is required
    403-permission-denied:
      value:
        status: 403
        title: Permission denied
        instance: konnect:trace:2822394689570210664
        detail: Only enterprise organizations can create teams
    404-not-found:
      value:
        status: 404
        title: Not Found
        instance: konnect:trace:2287285207635123011
        detail: The requested team was not found
    409-user-is-already-active:
      value:
        status: 409
        title: Resource Conflict
        instance: konnect:trace:6644808935508571943
        detail: User is already active
  schemas:
    ParameterizedAssignedRole:
      description: A parameterized assigned role is a role that has been assigned to a
        managed system account with additional parameters.
      type: object
      properties:
        id:
          description: The ID of the role assignment.
          type: string
          format: uuid
          example: eaf7adf1-32c8-4bbf-b960-d1f8456afe67
        role_name:
          description: Name of the role being assigned.
          type: string
          example: Viewer
        entity_id:
          description: A RBAC entity ID.
          type: string
          format: uuid
          example: 817d0422-45c9-4d88-8d64-45aef05c1ae7
        entity_type_name:
          description: Name of the entity type the role is being assigned to.
          type: string
          example: Runtime Groups
        entity_region:
          description: Region of the entity.
          type: string
          example: eu
          enum:
            - us
            - eu
            - au
            - me
            - in
            - sg
            - "*"
        parameters:
          description: Additional parameters for the role assignment.
          additionalProperties: true
          type: object
      example:
        id: 54cc6168-ebb1-4300-8168-d62a0dd08fc8
        role_name: Connector
        entity_id: 18ee2573-dec0-4b83-be99-fa7700bcdc61
        entity_type_name: Mesh Control Planes
        entity_region: us
        parameters:
          zoneName: zone3
      title: ParameterizedAssignedRole
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 401
            title:
              example: Unauthorized
            type:
              example: https://httpstatuses.com/401
            instance:
              example: kong:trace:1234567890
            detail:
              example: Invalid credentials
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 404
            title:
              example: Not Found
            type:
              example: https://httpstatuses.com/404
            instance:
              example: kong:trace:1234567890
            detail:
              example: Not found
    ConflictError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 409
            title:
              example: Conflict
            type:
              example: https://httpstatuses.com/409
            instance:
              example: kong:trace:1234567890
            detail:
              example: Conflict
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
  securitySchemes:
    clientToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        The Client token is meant to be used by internal service clients for the
        MinK integration.
```
