# Distribution group and Permission group API

## Create a new Distribution group

<mark style="color:green;">`POST`</mark> `https://app.getupdraft.com/api/group-testers/`

&#x20;This endpoint allows you create new Distribution group.

#### Body data/JSON

| Name  | Type   | Description                 |
| ----- | ------ | --------------------------- |
| app   | int    | ID of App project           |
| title | string | Name for distribution group |

#### Headers

| Name          | Type   | Description                                                                 |
| ------------- | ------ | --------------------------------------------------------------------------- |
| Authorization | String | Authentication token, note: might require adding "Token" to the value field |

#### Responce

```json
{
    "id": group_id,
    "testers_count": 0,
    "testers": [],
    "title": "group_name",
    "app": project_id
}
```

## Add testers to a Distribution group

<mark style="color:green;">`POST`</mark> `https://app.getupdraft.com/api/testers/`&#x20;

This endpoint allows you add new testers to a Distribution group.

#### Body data/JSON

| Name   | Type        | Description           |
| ------ | ----------- | --------------------- |
| email  | string      | Email of tester       |
| app    | null        | Should be set as null |
| groups | list of int | List of group IDs     |

#### Headers

| Name          | Type   | Description                                                                 |
| ------------- | ------ | --------------------------------------------------------------------------- |
| Authorization | string | Authentication token, note: might require adding "Token" to the value field |

#### Responce

```json
{
    "id": tester_id,
    "email": "tester email",
    "app": null,
    "groups": [
        group_id
    ]
}
```

## Create a new Permission group

<mark style="color:green;">`POST`</mark> `https://app.getupdraft.com/api/groupsinorgs/`&#x20;

&#x20;This endpoint allows you create new Permission group.

#### Body data/JSON

| Name         | Type   | Description                   |
| ------------ | ------ | ----------------------------- |
| title        | string | Title of new Permission group |
| organization | int    | ID of organisation            |

#### Headers

| Name          | Type   | Description                                                                 |
| ------------- | ------ | --------------------------------------------------------------------------- |
| Authorization | string | Authentication token, note: might require adding "Token" to the value field |

#### Responce

```json
{
    "id": group_id,
    "title": "group_title",
    "organization": organisation_id,
    "members": 0,
    "projects": []
}
```

## Add user to a Permission group

<mark style="color:green;">`POST`</mark> `https://app.getupdraft.com/api/useringrouporg/`&#x20;

This endpoint allows you add new users to a Permission group.

#### Body data/JSON

| Name   | Type        | Description       |
| ------ | ----------- | ----------------- |
| user   | int         | User ID           |
| groups | list of int | List of group IDs |

#### Headers

|               |        |                                                                             |
| ------------- | ------ | --------------------------------------------------------------------------- |
| Authorization | string | Authentication token, note: might require adding "Token" to the value field |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getupdraft.com/api/rest-api/distribution-group-and-permission-group-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
