> For the complete documentation index, see [llms.txt](https://docs.firefly.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.firefly.ai/general-information/api/iam.md).

# Identity & Access Management

The Identity & Access Management API provides comprehensive role-based access control functionality for managing users, teams, roles, and API keys in Firefly.

## Users

### List Users

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/users" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Create User

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/users" method="post" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Get User

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/users/{userId}" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Update User

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/users/{userId}" method="patch" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Delete User

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/users/{userId}" method="delete" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

## Teams

### Get Current User's Team

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/team" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### List Teams

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Create Team

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams" method="post" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Get Team

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams/{teamId}" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Update Team

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams/{teamId}" method="patch" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Delete Team

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams/{teamId}" method="delete" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### List Team Members

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams/{teamId}/members" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Update Team Members

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams/{teamId}/members" method="put" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Bulk Update Team Members

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/teams/{teamId}/members/bulk" method="post" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

## API Keys

### List API Keys

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/api-keys" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Create API Key

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/api-keys" method="post" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Get API Key

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/api-keys/{keyId}" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Update API Key

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/api-keys/{keyId}" method="patch" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Delete API Key

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/api-keys/{keyId}" method="delete" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Rotate API Key

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/api-keys/{keyId}/rotate" method="post" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Get API Key by Key Value

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/api-keys/by-key/{key}" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

## Roles

### List Roles

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/roles" method="get" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Create Role

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/roles" method="post" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Update Role

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/roles/{roleId}" method="patch" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}

### Delete Role

{% openapi src="/files/bFTHmq4fW0cXZdXLE7Gh" path="/user-service/roles/{roleId}" method="delete" %}
[user-service.yaml](https://292727710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkD89Ravlokn4JL0Be27O%2Fuploads%2Fgit-blob-dfd6b3299ffd3474cd06cb51609c3ba147f9f6b4%2Fuser-service.yaml?alt=media)
{% endopenapi %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.firefly.ai/general-information/api/iam.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
