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

# Add User Groups

Use this API to add organization user groups to a specific organization.

# Endpoint

`POST https://api.velt.dev/v2/organizations/usergroups/add`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID

**createOrganization** `boolean`

If set to true, a new organization will be created (if it doesn't exist) before the group(s) are created.

**organizationUserGroups** `OrganizationUserGroup[]` *required*

Array of Organization User Group objects

## **Example Request**

#### Add organization user group in a specific organization

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "organizationUserGroups": [
      {
        "groupId": "engineering",
        "groupName": "Engineering"
      }
    ]
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Organization User Groups added successfully.",
    "data": {
      "yourGroupId": {
        "success": true,
        "id": "77ab6767b022ad0323ba39c24f12cc95",
        "message": "Organization user group added."
      }
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Organization User Groups added successfully.",
    "data": {
      "yourGroupId": {
        "success": true,
        "id": "77ab6767b022ad0323ba39c24f12cc95",
        "message": "Organization user group added."
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.