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

# Edit Organization user

> Create Organization's user.

The authenticated user can edit the user in the organization if is part of the organization and has Owner priviledges.



## OpenAPI

````yaml put /api/v1/organizations/{organizationid}/users/{userid}
openapi: 3.1.0
info:
  title: Aegister API
  version: 1.0.3
servers: []
security: []
paths:
  /api/v1/organizations/{organizationid}/users/{userid}:
    put:
      tags:
        - organizations
      description: >-
        Create Organization's user.


        The authenticated user can edit the user in the organization if is part
        of the organization and has Owner priviledges.
      operationId: organizations_users_update
      parameters:
        - in: path
          name: organizationid
          schema:
            type: integer
          required: true
        - in: path
          name: userid
          schema:
            type: string
          description: |-
            If the user is not already registered, this parameter can be `0`.  
            In case is `0`, the email field is required in the request body.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                role:
                  type: string
                  description: >-
                    Define user role inside the organization.  

                    Assignable roles are:  

                    * `owner`: can manage all aspect of the organization  

                    * `security_officer`: can edit basic informations of the
                    organization  

                    * `viewer`: can only view informations of the organization  
                  enum:
                    - viewer
                    - security_officer
                    - owner
                email:
                  type: string
                  format: email
                  description: This is required if `userid` path parameter is `0`.
          multipart/form-data:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    role:
                      type: string
                      description: >-
                        Define user role inside the organization.  

                        Assignable roles are:  

                        * `owner`: can manage all aspect of the organization  

                        * `security_officer`: can edit basic informations of the
                        organization  

                        * `viewer`: can only view informations of the
                        organization  
                      enum:
                        - viewer
                        - security_officer
                        - owner
                    email:
                      type: string
                      format: email
                      description: This is required if `userid` path parameter is `0`.
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 0
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - []
                  data:
                    type: object
                    properties:
                      organization:
                        type: number
                        description: Organization unique identifier.
                      user:
                        type: string
                        format: uuid
                        description: |-
                          User unique identifier.  
                          This can be `0` if the user is not registered.
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 1
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - - Invalid data provided
          description: ''
        '401':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 1
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - - 9153
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 1
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - []
          description: ''
      security:
        - ApiKeyAuth: []
        - ApiKeyQueryParam: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Aegister-Token
    ApiKeyQueryParam:
      type: apiKey
      in: query
      name: X-Aegister-Token

````