Table of Contents

Work with groups

Products: FastReport Cloud, FastReport Corporate Server, FastReport Publisher

This article covers the process of creating a new group, adding a user to the group, and retrieving the list of users in it.

Getting started

You will need the following tools and facilities:

  1. Know how to use API key in Service solutions.

    This article will skip over additional information on authentication and authorization.

  2. Curl tool.

    Any other REST client will work, but the examples will be built for curl.

  3. Active subscription to one of the following products: FastReport Cloud, FastReport Corporate Server, or FastReport Publisher. The subscription must have at least two user slots.

  4. Internet access.

Annotation

Important! You can add a user to a group only if the user exists in the workspace.

Important! It is possible to add a user to a group only by their user ID.

Instruction

  1. To create a new group, you need a workspace ID and the name of the new group.

    Retrieve the workspace ID by executing GET request to {host_name}/api/manage/v1/Subscriptions?skip=0&take=10.

    Example request:

    curl -X GET "{host_name}/api/manage/v1/Subscriptions?skip=0&take=10" -H "accept: text/plain"
    

    Example answer:

    {
      "subscriptions": [
        {
          "id": "5fa919fa292a8300019349bc",
          "name": "Awesome Corp",
          "current": {
            "startTime": "2020-11-17T10:22:58.584Z",
            "endTime": "2025-11-17T10:22:58.584Z",
            "plan": {
              "id": "5f43924b0231500001225686",
              "isActive": false,
              "displayName": "The greatest power",
              "timePeriodType": "Year",
              "timePeriod": 5,
              "readonlyTimeLimitType": "Second",
              "readonlyTimeLimit": 0,
              "templatesSpaceLimit": 1048576000,
              "reportsSpaceLimit": 1048576000,
              "exportsSpaceLimit": 1048576000,
              "fileUploadSizeLimit": 1048576000000,
              "dataSourceLimit": 10,
              "maxUsersCount": 10,
              "groupLimit": 5,
              "onlineDesigner": true,
              "isDemo": false,
              "urlToBuy": "https://www.fast-report.com/",
              "unlimitedPage": true,
              "pageLimit": 15
            }
          },
          "old": [],
          "templatesFolder": {
            "folderId": "5fa919f9292a8300019349b9",
            "bytesUsed": 1668491
          },
          "reportsFolder": {
            "folderId": "5fa919f9292a8300019349ba",
            "bytesUsed": 6085990
          },
          "exportsFolder": {
            "folderId": "5fa919fa292a8300019349bb",
            "bytesUsed": 8336710
          }
        }
      ],
      "count": 1,
      "skip": 0,
      "take": 10
    }
    

    Workspace (subscription) ID from the example above: 5fa919fa292a8300019349bc.

  2. To create a new group, execute the POST request to {host_name}/api/manage/v1/Groups, pass JSON into the request body according to the scheme below.

    {
      "name": "string",
      "subscriptionId": "string id"
    }
    

    Example request:

    curl -X POST "{host_name}/api/manage/v1/Groups" -H "accept: text/plain" -H "Content-Type: application/json-patch+json" -d "{ \"name\": \"My first group\", \"subscriptionId\": \"5fa919fa292a8300019349bc\"}"
    

    Example answer:

    {
      "id": "5fe5d7866882ca0001760fcb",
      "name": "My first group",
      "subscriptionId": "5fa919fa292a8300019349bc"
    }
    

    Group ID from the example above: 5fe5d7866882ca0001760fcb.

  3. To add a new user to the group, execute PUT request to {host_name}/api/manage/v1/Groups/{groupId}/Users/{userId}, where the group ID should be specified instead of {groupId}, and user ID - instead of {userId}.

    Example request:

    curl -X PUT "{host_name}/api/manage/v1/Groups/5fe5d7866882ca0001760fcb/Users/5af5a8dc-8cb0-40f9-ac99-ca2533fa4492" -H "accept: text/plain"
    

    In response you will receive an empty message with the OK 200 code.

  4. To retrieve a list of users in the group, execute GET request to {host_name}/api/manage/v1/Groups/{id}/Users?skip=0&take=10, where group ID should be specified instead of {id}.

    Example request:

    curl -X GET "{host_name}/api/manage/v1/Groups/5fe5d7866882ca0001760fcb/Users?skip=0&take=10" -H "accept: text/plain"
    

    Example answer:

    {
      "users": [
        {
          "userId": "5af5a8dc-8cb0-40f9-ac99-ca2533fa4491",
          "userId": "5af5a8dc-8cb0-40f9-ac99-ca2533fa4492"
        }
      ],
      "count": 2,
      "take": 10,
      "skip": 0
    }
    

What next?

Note! In the examples there may be no Authorization header because a cookie-based authentication model is used. For more information about authorization, read the Authentication and authorization section.