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

# Assign Role to Member

> Assigns a role to an existing team member. Use `GET /teams/roles` to retrieve available role IDs.

Assign a role to an existing team member. Use [`GET /teams/roles`](/api-reference/endpoint/teams/roles) to retrieve the list of available roles and their IDs.

## Example Request

```bash theme={null}
curl -X POST "https://api.rolla.xyz/api/v1/external/teams/members/a1b2c3d4-e5f6-7890-abcd-ef1234567890/role" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "role_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd"
  }'
```

## Example Response

```json theme={null}
{
  "status": 200,
  "success": true,
  "message": "Role assigned successfully",
  "data": {}
}
```

<Info>
  The `business_owner` role cannot be assigned via this endpoint. Fetch assignable roles from `GET /teams/roles` — the list excludes owner-level roles automatically.
</Info>

<Warning>
  The target user must already be an accepted member of your business. You cannot assign a role to a pending invite.
</Warning>


## OpenAPI

````yaml POST /teams/members/{userId}/role
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /teams/members/{userId}/role:
    post:
      summary: Assign Role to Member
      description: >-
        Assigns a role to an existing team member. Use `GET /teams/roles` to
        retrieve available role IDs.
      operationId: assignTeamMemberRole
      parameters:
        - name: userId
          in: path
          required: true
          description: User UUID of the team member
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignMemberRoleRequest'
      responses:
        '200':
          description: Role assigned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Role assigned successfully
        '400':
          description: Bad request - invalid role ID or user not a member of this business
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AssignMemberRoleRequest:
      type: object
      required:
        - role_id
      properties:
        role_id:
          type: string
          format: uuid
          description: >-
            UUID of the role to assign. Retrieve available roles from `GET
            /teams/roles`.
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````