Table of Contents

Add new users to the workspace

Products: FastReport Cloud, FastReport Corporate Server, FastReport Publisher

This article covers the process of adding a new user to a workspace, retrieving the list of users in the workspace, and removing a user from it.

Each workspace always has a subscription associated with it. They have a common ID.

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.

Instruction

There are two ways to add a user to a workspace:

  • Directly by specifying the user ID.
  • Using the invitation system.

Add a user via invitation

  1. To create an invitation, you need a workspace ID.

    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": "604f52e1261a3c19104c0e25",
          "name": "iwantpizza",
          "locale": null,
          "current": {
            "startTime": "2021-03-15T12:28:17.773Z",
            "endTime": "2121-03-15T12:28:17.773Z",
            "plan": {
              "id": "5f89b4d722d2d823440b6d10",
              "isActive": false,
              "displayName": "unlimited",
              "timePeriodType": "Year",
              "timePeriod": 100,
              "readonlyTimeLimitType": "Second",
              "readonlyTimeLimit": 0,
              "templatesSpaceLimit": 1048576000,
              "reportsSpaceLimit": 1048576000,
              "exportsSpaceLimit": 1048576000,
              "fileUploadSizeLimit": 1073741824,
              "dataSourceLimit": 10,
              "maxUsersCount": 10,
              "groupLimit": 5,
              "onlineDesigner": true,
              "isDemo": false,
              "urlToBuy": "https://www.fast-report.com/",
              "unlimitedPage": true,
              "pageLimit": 0
            }
          },
          "old": null,
          "invites": null,
          "templatesFolder": {
            "folderId": "604f52e1261a3c19104c0e22",
            "bytesUsed": 241247
          },
          "reportsFolder": {
            "folderId": "604f52e1261a3c19104c0e23",
            "bytesUsed": 16384
          },
          "exportsFolder": {
            "folderId": "604f52e1261a3c19104c0e24",
            "bytesUsed": 8059419
          }
        }
      ],
      "count": 1,
      "skip": 0,
      "take": 10
    }
    

    Workspace (subscription) ID from the example above: 604f52e1261a3c19104c0e25.

  2. To create an invitation, execute the POST request to {host_name}/api/manage/v1/Subscriptions/{subscriptionId}/invite, where the workspace ID will be specified instead of {subscriptionId}.

    By specifying the invitation properties in the request body.

    Example body:

    {
      "usages": 1,
      "durable": true,
      "expiredDate": "2021-03-25T11:53:29.351Z"
    }
    
    • usages - possible number of uses;

    • durable - if it is set to true, it indicates that the number of uses is not limited;

    • expiredDate - it indicates the expiration date of the invitation (the invitation without this field is valid forever);

      If you leave the body empty, it will create a one-time invitation valid until the next day.

    Example request:

    curl -X POST "{host_name}/api/manage/v1/Subscriptions/604f52e1261a3c19104c0e25/invite" -H "accept: text/plain" -H "Content-Type: application/json-patch+json" -d "{ \"usages\": 1, \"durable\": true, \"expiredDate\": \"2021-03-25T11:53:29.351Z\"}"
    

    Example answer:

    {
      "id": "604f52e1261a3c19104c0e25",
      "name": "iwantpizza",
      "locale": null,
      "current": {
        "startTime": "2021-03-15T12:28:17.773Z",
        "endTime": "2121-03-15T12:28:17.773Z",
        "plan": {
          "id": "5f89b4d722d2d823440b6d10",
          "isActive": false,
          "displayName": "unlimited",
          "timePeriodType": "Year",
          "timePeriod": 100,
          "readonlyTimeLimitType": "Second",
          "readonlyTimeLimit": 0,
          "templatesSpaceLimit": 1048576000,
          "reportsSpaceLimit": 1048576000,
          "exportsSpaceLimit": 1048576000,
          "fileUploadSizeLimit": 1073741824,
          "dataSourceLimit": 10,
          "maxUsersCount": 10,
          "groupLimit": 5,
          "onlineDesigner": true,
          "isDemo": false,
          "urlToBuy": "https://www.fast-report.com",
          "unlimitedPage": true,
          "pageLimit": 0
        }
      },
      "old": null,
      "invites": [
        {
          "usages": 1,
          "durable": true,
          "accessToken": "fj3534g341ir7dyytfiaap9z1r",
          "expiredDate": "2021-03-25T11:53:29.351Z",
          "addedUsers": [],
          "creatorUserId": "2df79f83-07f1-41ba-96b5-7757bbf377df"
        }
      ],
      "templatesFolder": {
        "folderId": "604f52e1261a3c19104c0e22",
        "bytesUsed": 241247
      },
      "reportsFolder": {
        "folderId": "604f52e1261a3c19104c0e23",
        "bytesUsed": 16384
      },
      "exportsFolder": {
        "folderId": "604f52e1261a3c19104c0e24",
        "bytesUsed": 8059419
      }
    }
    

    The invitation with access token appeared in the subscription: fj3534g341ir7dyytfiaap9z1r.

  3. You need to pass the link to accept the invitation (or the access token itself) to the user you want to invite (in any way you like). The final link will look like this: {host_name}/api/manage/v1/Subscriptions/{subscriptionId}/invite/{accessToken}/accept, where the workspace ID should be specified instead of {subscriptionId}, and the access token should be specified instead of {accessToken}.

  4. Now the invited user can click on this link directly in the browser or the execute GET request to {host_name}/api/manage/v1/Subscriptions/{subscriptionId}/invite/{accessToken}/accept, where instead of {subscriptionId} the workspace ID should be specified, and the access token should be specified instead of {accessToken}.

    Example request:

    curl -X GET "https://xn--80ab2acne.xn--e1aflibyb2b0b.xn--p1ai/api/manage/v1/Subscriptions/6051f2a06c07a10001737394/invite/to9kxrxdz4iwbfyz3pq4fktdcr/accept" -H "accept: text/plain"
    

Delete the invitation

  • When an invitation runs out of uses or expires, it is not automatically deleted. You will need to do this manually by sending DELETE request to {host_name}/api/manage/v1/Subscriptions/{subscriptionId}/invite/{accessToken}.

    Example request:

    curl -X DELETE "https://xn--80ab2acne.xn--e1aflibyb2b0b.xn--p1ai/api/manage/v1/Subscriptions/6051f2a06c07a10001737394/invite/to9kxrxdz4iwbfyz3pq4fktdcr" -H "accept: text/plain"
    

    An empty message with the code NO CONTENT 204 will be received in response.

Add a user directly

  1. To add a new user to a workspace, a workspace ID is required.

    Retrieve the subscription 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 add a new user, execute PUT request to {host_name}/api/manage/v1/Subscriptions/{subscriptionId}/users/{userId}, where the workspace ID should be passed instead of {subscriptionId}, and the user ID should be passed instead of {userId}.

    Example request:

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

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

  3. To retrieve the list of users, execute GET request to {host_name}/api/manage/v1/Subscriptions/{id}/users?skip=0&take=10, where the workspace ID should be used instead of {id}.

    Example request:

    curl -X GET "{host_name}/api/manage/v1/Subscriptions/5fa919fa292a8300019349bc/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
    }
    
  4. To remove a user from the workspace, execute DELETE request to {host_name}/api/manage/v1/Subscriptions/{subscriptionId}/users/{userId}, where instead of {subscriptionId} the workspace ID should be used, and instead of {userId} - user ID.

    Example request:

    curl -X DELETE "{host_name}/api/manage/v1/Subscriptions/5fa919fa292a8300019349bc/users/5af5a8dc-8cb0-40f9-ac99-ca2533fa4492" -H "accept: text/plain"
    

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

What next?