---
agentTools:
  projectIndex: https://nudgesecurity.readme.io/llms.txt
---

# Search groups

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "Group": {
        "properties": {
          "counters": {
            "readOnly": true
          },
          "creation_date": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "deleted_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "primary_email": {},
          "risk_level": {
            "nullable": true,
            "type": "string"
          },
          "risk_level_value": {
            "readOnly": true,
            "type": "integer"
          },
          "user_group_metadata": {
            "$ref": "#/components/schemas/GroupMetadata"
          }
        },
        "required": [
          "external_id"
        ],
        "type": "object"
      },
      "GroupMetadata": {
        "properties": {
          "admin_created": {
            "nullable": true,
            "type": "boolean"
          },
          "group_type": {
            "nullable": true,
            "type": "string"
          },
          "visibility": {
            "nullable": true,
            "type": "string"
          },
          "who_can_join": {
            "nullable": true,
            "type": "string"
          },
          "who_can_manage_members": {
            "nullable": true,
            "type": "string"
          },
          "who_can_view_messages": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "GroupsFilterRequest": {
        "properties": {
          "op": {
            "description": "Operation to apply over the field",
            "enum": [
              "=",
              "!=",
              "<",
              "<=",
              ">",
              ">=",
              "like",
              "ilike",
              "not_like",
              "not_ilike",
              "in",
              "notin",
              "notnull",
              "isnull"
            ],
            "type": "string"
          },
          "property": {
            "description": "Property to use in the condition",
            "enum": [
              "id",
              "risk_level_value",
              "creation_date",
              "external_id",
              "counters.total_members",
              "counters.total_saas_accounts",
              "counters.total_apps_introduced",
              "user_group_metadata.visibility",
              "user_group_metadata.group_type",
              "user_group_metadata.who_can_manage_members",
              "user_group_metadata.who_can_join",
              "user_group_metadata.who_can_view_messages",
              "user_group_metadata.admin_created"
            ],
            "type": "string"
          },
          "value": {
            "default": null,
            "description": "Depending on the operation and the field, the value can be a string, an integer, a boolean, or a list of strings or integers",
            "nullable": true
          }
        },
        "required": [
          "op",
          "property"
        ],
        "type": "object"
      },
      "GroupsPage": {
        "properties": {
          "next_page": {
            "default": null,
            "nullable": true,
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "prev_page": {
            "default": null,
            "nullable": true,
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          },
          "total_values": {
            "type": "integer"
          },
          "values": {
            "items": {
              "$ref": "#/components/schemas/Group"
            },
            "type": "array"
          }
        },
        "required": [
          "page",
          "per_page",
          "total_pages",
          "total_values"
        ],
        "type": "object"
      },
      "GroupsPageRequest": {
        "properties": {
          "filters": {
            "description": "List conditions to filter on",
            "items": {
              "$ref": "#/components/schemas/GroupsFilterRequest"
            },
            "maxItems": 10,
            "type": "array"
          },
          "page": {
            "default": 1,
            "description": "Page number to retrieve",
            "minimum": 1,
            "type": "integer"
          },
          "per_page": {
            "default": 10,
            "description": "Number of items per page to retrieve. Defaults to a maximum of 100; some organizations may be allowed a higher limit up to 2500",
            "maximum": 2500,
            "minimum": 0,
            "type": "integer"
          },
          "search": {
            "description": "List of conditions to search for. Multiple conditions are combined with an OR",
            "items": {
              "$ref": "#/components/schemas/GroupsFilterRequest"
            },
            "maxItems": 10,
            "type": "array"
          },
          "sorting": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GroupsSortRequest"
              }
            ],
            "default": null,
            "description": "Sorting to apply on the results",
            "nullable": true
          }
        },
        "type": "object"
      },
      "GroupsSortRequest": {
        "properties": {
          "direction": {
            "default": "asc",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          },
          "property": {
            "description": "Property to use in the sort condition",
            "enum": [
              "id",
              "risk_level_value",
              "creation_date"
            ],
            "type": "string"
          }
        },
        "required": [
          "property"
        ],
        "type": "object"
      },
      "HTTPError": {
        "properties": {
          "detail": {
            "type": "object"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "detail": {
            "properties": {
              "<location>": {
                "properties": {
                  "<field_name>": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "description": "Authorization header containing the Nudge API Token",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "Nudge API",
    "version": "1.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/1.0/groups/search": {
      "post": {
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupsPageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupsPage"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            },
            "description": "Validation error"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPError"
                }
              }
            },
            "description": "Authentication error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Search groups",
        "tags": [
          "User Groups"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.nudgesecurity.io"
    }
  ],
  "tags": [
    {
      "name": "User Groups"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 130,
      "2": 205,
      "3": 225,
      "4": 131,
      "5": 178,
      "6": 81,
      "7": 0,
      "8": 15,
      "9": 104,
      "10": 80,
      "11": 14
    }
  }
}
```