Netter groups API

The groups API from Netter — 4 operation(s) for groups.

OpenAPI Specification

netter-groups-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DMI Backend actions groups API
  version: 0.1.0
tags:
- name: groups
paths:
  /api/v1/groups:
    get:
      tags:
      - groups
      summary: List Groups
      description: List all groups for the company. Available to any company member.
      operationId: list_groups_api_v1_groups_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/GroupRead'
                type: array
                title: Response List Groups Api V1 Groups Get
    post:
      tags:
      - groups
      summary: Create Group
      description: Create a group. Requires company admin.
      operationId: create_group_api_v1_groups_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/groups/{group_id}:
    patch:
      tags:
      - groups
      summary: Update Group
      description: Update a group's name, description, or rule. Requires company admin.
      operationId: update_group_api_v1_groups__group_id__patch
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Group Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - groups
      summary: Delete Group
      description: Delete a group. Requires company admin.
      operationId: delete_group_api_v1_groups__group_id__delete
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Group Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/groups/{group_id}/members:
    get:
      tags:
      - groups
      summary: Get Group Members
      description: Get manual and effective members of a group. Requires company admin.
      operationId: get_group_members_api_v1_groups__group_id__members_get
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupMembersRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/groups/{group_id}/members/{user_id}:
    post:
      tags:
      - groups
      summary: Add Group Member
      description: Add a manual member to a group. Requires company admin.
      operationId: add_group_member_api_v1_groups__group_id__members__user_id__post
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Group Id
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: User Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - groups
      summary: Remove Group Member
      description: Remove a manual member from a group. Requires company admin.
      operationId: remove_group_member_api_v1_groups__group_id__members__user_id__delete
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Group Id
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: User Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    GroupMembersRead:
      properties:
        group_id:
          type: string
          format: uuid
          title: Group Id
        manual_member_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Manual Member Ids
        effective_member_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Effective Member Ids
      type: object
      required:
      - group_id
      - manual_member_ids
      - effective_member_ids
      title: GroupMembersRead
    GroupUpdate:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        rule:
          anyOf:
          - items:
              $ref: '#/components/schemas/GroupRuleCondition'
            type: array
          - type: 'null'
          title: Rule
        clear_rule:
          type: boolean
          title: Clear Rule
          default: false
      type: object
      title: GroupUpdate
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GroupRuleCondition:
      properties:
        attribute_key:
          type: string
          title: Attribute Key
        operator:
          type: string
          enum:
          - eq
          - in
          title: Operator
        values:
          items:
            type: string
          type: array
          title: Values
      type: object
      required:
      - attribute_key
      - operator
      - values
      title: GroupRuleCondition
    GroupRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        rule:
          anyOf:
          - items:
              $ref: '#/components/schemas/GroupRuleCondition'
            type: array
          - type: 'null'
          title: Rule
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - id
      - name
      - description
      - rule
      - created_at
      title: GroupRead
    GroupCreate:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
          default: ''
        rule:
          anyOf:
          - items:
              $ref: '#/components/schemas/GroupRuleCondition'
            type: array
          - type: 'null'
          title: Rule
      type: object
      required:
      - name
      title: GroupCreate