Get users suggestions by Organization UUID

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: Ensure your token has permissions to invite users.
  3. Organization UUID: Organization unique identifier.

Step 1. Find the Organization UUID

Find the organization UUID.

You can retrieve it using this query:

{
  organization(id: "<ORGANIZATION_ID>") {
    uuid
  }
}

The organization ID can be found on the home page url: https://app.pipefy.com/organizations/<ORGANIZATION_ID>

Step 2: Query User Suggestions

Use the userSuggestions query to retrieve a list of potential guests to invite to the given organization, based on your interactions. Below is an example:

query userSuggestions($orgUuid: ID!) {
  usersSuggestions(orgUuid: "abfe85ae-6a5d-49ab-b063-b74e4d0b4206") {
    edges {
      node {
        organization {
          id
          name
          uuid
        }
        repo {
          id
          color
          icon
          name
          startFormFields {
            id
            uuid
            settings
            type
          }
          startFormTitle
        }
        user {
          id
          name
          email
          avatarUrl
          canBeRemoved
          roleName
          uuid
        }
      }
    }
  }
}

Key Fields Explained:

  • organization:
    • id: Unique identifier.
    • name: Organization name.
    • uuid: Unique identifier.
  • repo: Information from repo (pipe or database).
    • id: Unique identifier.
    • color: Repo color.
    • icon: Repo icon
    • name: Repo name.
    • startFormFields: Fields that belongs to a start form.
      • id: Unique identifier
      • uuid: Unique identifier
      • type: Inform what is field type (short text, long text, numeric...).
  • user:
    • id: Unique identifier
    • name: User name
    • email: User email
    • avatarUrl: User avatar
    • canBeRemoved: Permission that shows if user can be removed
    • uuid: Unique identifier

Step 3: Execute and Interpret the Response

After running the query, you'll receive a structured JSON response. Here’s an example:

{
  "data": {
    "usersSuggestions": {
      "edges": [
        {
          "node": {
            "organization": {
              "id": "123456",
              "name": "Example Org",
              "uuid": "abfe85ae-6a5d-49ab-b063-b74e4d0b4206"
            },
            "repo": {
              "id": "12345678",
              "color": "cyan",
              "icon": "pipefy",
              "name": "Example repo",
              "startFormFields": [
                {
                  "id": "warning",
                  "uuid": "1fe55851-80b5-4629-8d2f-861dc21b8cc9",
                  "type": "statement"
                },
                {
                  "id": "customer_name",
                  "uuid": "0c956451-a5ae-4b86-bc25-d427b43621a1",
                  "type": "short_text"
                },
                {
                  "id": "customer_email",
                  "uuid": "ffb5a623-7ca3-452b-95a1-608a843e4ad8",
                  "type": "email"
                },
                {
                  "id": "customer_address",
                  "uuid": "937f6429-c9dd-4cb3-b9aa-2bea417babe7",
                  "type": "long_text"
                },
                {
                  "id": "customer_birthdate",
                  "uuid": "a05c6382-1520-40fa-914a-1308e5dd55dd",
                  "type": "date"
                },
                {
                  "id": "customer_birthtime",
                  "uuid": "496164e5-404b-4824-8e25-6ce38905135d",
                  "type": "time"
                },
                {
                  "id": "total_value",
                  "uuid": "f75e9d7b-2e09-4826-99c5-903fa5aafd59",
                  "type": "number"
                },
                {
                  "id": "due",
                  "uuid": "f5d0a8ca-0fb1-4f7e-baee-6f1189459575",
                  "type": "due_date"
                },
                {
                  "id": "id",
                  "uuid": "29d4417d-88e9-4124-b604-7471f7e5250b",
                  "type": "id"
                }
              ]
            },
            "user": {
              "id": "91234",
              "name": "Example",
              "email": "[email protected]",
              "avatarUrl": "https://gravatar.com/avatar/97c712aa60976209ae6d1c741b1338d3.png?s=144&d=https://pipestyle.staticpipefy.com/v2-temp/illustrations/avatar.png",
              "canBeRemoved": true,
              "uuid": "45093a33-cfb3-4d49-9c7f-17b623a577c3"
            }
          }
        }
      ]
    }
  }
}

This query provides a quick and effective way to retrieve information about a users suggestions.