# Find organizations from IdP groups

```
POST 
/organizations/lookup-by-idp-groups
```

Returns the organizations linked to your Nabla Connect instance whose users are identified by at least one of the given identity provider (IdP) groups, as configured for SAML SSO (SAML or SCIM groups). Use it to find the organization to provision a user in from the groups your IdP reports for them, before you have any organization to authenticate as: this endpoint takes an [instance access token](/connect/reference/oauth-generate-instance-access-token.md). Organizations restricting access to none of these groups are not returned, so an empty list means no linked organization matches. Several organizations are returned when the groups match more than one.

## Request[​](#request "Direct link to request")

## Responses[​](#responses "Direct link to Responses")

* 200

The matching organizations.

## Operation spec

```json
{
  "method": "post",
  "path": "/organizations/lookup-by-idp-groups",
  "operationId": "lookup-organizations-by-idp-groups",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "description": "The IdP groups to find organizations for.",
          "properties": {
            "idp_group_ids": {
              "type": "array",
              "description": "The identifiers of the user's groups, as your IdP sends them in the SAML assertion's groups attribute (for example group names for Okta, or group object IDs for Microsoft Entra ID). They are compared exactly (case and whitespace included) with the groups configured for the organizations, as the SAML sign-in compares them. Duplicates are ignored.",
              "minItems": 1,
              "maxItems": 1000,
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "idp_group_ids"
          ],
          "title": "lookup_organizations_by_idp_groups_request"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The matching organizations.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "organizations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "An organization matched by IdP groups.",
                  "properties": {
                    "organization_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "A unique identifier.",
                      "example": "98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6",
                      "title": "uuid"
                    },
                    "matched_idp_group_ids": {
                      "type": "array",
                      "description": "The requested IdP group IDs that identify the organization's users.",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "organization_id",
                    "matched_idp_group_ids"
                  ],
                  "title": "idp_groups_organization"
                }
              }
            },
            "required": [
              "organizations"
            ],
            "title": "lookup_organizations_by_idp_groups_response"
          }
        }
      }
    }
  }
}
```
