---
title: "Get User Groups"
method: GET
path: "/datacatalog/api/auth/user-groups"
tags: ["Auth"]
---

# Get User Groups

`GET /datacatalog/api/auth/user-groups`

## Request

- Base URL: `https://data.usgs.gov` (the document declares no server; this is the origin it was published from)
- URL: `https://data.usgs.gov/datacatalog/api/auth/user-groups`
- Auth: OAuth 2
  - Authorization code: `https://auth.globus.org/v2/oauth2/authorize?scope=openid`
  - Token URL: `https://data.usgs.gov/datacatalog/api/auth/login`

An example route that makes use of dependent tokens.

Note that the Globus SDK is not an async library. That means that I/O
happens in the thread that calls SDK methods. As far as the author of this
comment understands about such cases, routes should not be async. Doing so
would block the asyncio event loop when calling SDK methods, preventing
other async tasks from executing concurrently. If a route makes both Globus
SDK calls as well as calls to I/O heavy async function/methods, an
alternative is to have an async route and use
``starlette.concurrency.run_in_threadpool()`` to call Globus SDK methods.
Alternatively, it may be reasonable to provide async wrappers of
Horizon/Globus functions/methods that automatically do this.

:param token: The bearer token supplied to the API.
:return: A list of the groups that the user represented by the token belongs
    to.

## Response `200`

Successful Response

- unknown

## Other responses

- `404`: Not found

---

[API](https://skmtc.dev/usgs/apis/usgs-science-data-catalog-api-documentation.md) - [All operations](https://skmtc.dev/usgs/apis/usgs-science-data-catalog-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/usgs/apis/usgs-science-data-catalog-api-documentation/revisions/f5f6a07ba13f?raw)
