# External User Info Endpoint

Immuta can consume user attributes from an external HTTP endpoint. This feature allows you to retrieve users' groups and authorizations from an additional resource alongside the user attributes retrieved in the authentication flow. Such an external endpoint can be configured for any of the identity management protocols that Immuta supports.

## Authentication

The service can authenticate requests with both of these methods:

* Basic username and password `Authorization` header
* SSL cert validation

*Note: Immuta will expect non 200 error codes when the user info cannot be retrieved.*

## GET /user-info

The user info endpoint is called each time Immuta needs to synchronize with a remote IAM on user groups and attributes. Immuta will query the endpoint with the user ID specified in the request's query.

*Note: The endpoint's path does not have to be* `/user-info`*.*

**Query parameter**

| Name                | Description                                     | Required |
| ------------------- | ----------------------------------------------- | -------- |
| **userid** `string` | The unique user identifier (username in Immuta) | Yes      |

**Response**

| Code    | Description                                             |
| ------- | ------------------------------------------------------- |
| **200** | successful operation - user info retrieved successfully |

**Response schema**

| Attribute          | Example                                 |
| ------------------ | --------------------------------------- |
| **groups**         | `[{"name": "<group_name>"}]`            |
| **authorizations** | `{"<authorization_name>": ["<value>"]}` |

Below is a sample response that could be returned by the endpoint.

```json
{
  "groups": [{
    "name":  "Accountants",
  }, {
    "name":  "Controllers",
  }],
  "authorizations": {
    "EMEA": ["Sales", "Expenses"],
    "APAC": ["Sales"]
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.immuta.com/saas/configuration/people/section-contents/reference-guides/custom-external.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
