Users created in suspended status via /rest/api/2/user using asApp() method in Forge app

XMLWordPrintable

    • Minor

      Issue Summary

      When using the /rest/api/2/user endpoint in the Forge app to create users, the users are being created in a suspended status. This happens using both asApp() method or appUserToken.

      Steps to Reproduce

      • Create a Forge app
      • Use the below-mentioned sample code in the resolver :
        import Resolver from '@forge/resolver';
        import api, {route} from "@forge/api";const resolver = new Resolver();resolver.define('getText', async(req) => {
          console.log(req);
          var bodyData = `{
          "emailAddress": "mia@atlassian.com",
          "products": [
            "jira-software"
          ]}`;
          const response = await api.asApp().requestJira(route`/rest/api/2/user`, {
            method: 'POST',
            headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json'
            },
            body: bodyData
          });
          const data = await response.json();
          console.log(JSON.stringify(data));  
        });export const handler = resolver.getDefinitions(); 
      • Run the app, and it creates a user with suspended.

      Expected Results

      • The request should return a 403 Forbidden error.
      • The documentation needs to be corrected, as only site/org administrators can create users, and currently, there is no way to make an app user a site/org administrator.
      • It should be clearly stated that the API is not designed to be used with Forge and Connect apps.

      Actual Results

      • The user is created but in a deactivated status, as shown below

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

        1. image-2025-12-19-11-52-42-275.png
          173 kB
          Chandra Shekhar Pandey
        2. Screenshot 2025-11-26 at 4.54.02 PM.png
          173 kB
          Chandra Shekhar Pandey

            Assignee:
            Nick Theng
            Reporter:
            Chandra Shekhar Pandey
            Votes:
            8 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: