Skip to content

#38044 API design: Create API-only users that only have access to Customer-defined Fleet API endpoints - #42352

Merged
rachaelshaw merged 9 commits into
docs-v4.85.0from
38044-api-design
Apr 23, 2026
Merged

#38044 API design: Create API-only users that only have access to Customer-defined Fleet API endpoints#42352
rachaelshaw merged 9 commits into
docs-v4.85.0from
38044-api-design

Conversation

@rachaelshaw

Copy link
Copy Markdown
Member

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

Comment thread docs/REST API/rest-api.md
Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md Outdated
Co-authored-by: Rachael Shaw <r@rachael.wtf>
Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md
Comment thread docs/REST API/rest-api.md
Comment thread docs/REST API/rest-api.md
| password | string | body | The user's password (required for non-SSO users).
| global_role | string | body | The role assigned to the user. If `global_role` is specified, `fleets` cannot be specified. For more information, see [manage access](https://fleetdm.com/docs/using-fleet/manage-access). |
| fleets | array | body | _Available in Fleet Premium_. The fleets and respective roles assigned to the user. Should contain an array of objects in which each object includes the fleet's `id` and the user's `role` on each fleet. If `fleets` is specified, `global_role` cannot be specified. For more information, see [manage access](https://fleetdm.com/docs/using-fleet/manage-access). |
| api_endpoints | array | body | _Available in Fleet Premium_. A list of `id`s of API endpoints this user will have access to. For available endpoints, see [List API endpoints for API-only user permissions](#list-api-endpoints-for-api-only-user-permissions). |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rachaelshaw
When omitted or empty it means access to ALL, right?

And on the UI we probably want to disable the Save button if the user selected Specific API endpoints but didn't choose any.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cood catch 👍 We should make the user select at least one endpoint or "All" before saving
Would it match existing patterns to have this be null if not setting specific endpoints?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md

### Create API-only user

Creates an API-only user that does not have access to the UI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth documenting that this is a global/team admin only endpoint.

Comment thread docs/REST API/rest-api.md
Comment thread docs/REST API/rest-api.md
"role": "maintainer"
}
],
"api_endpoints": [1,5,7,32]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rachaelshaw
I put as a goal on the implementation to make these ids "stable".
Meaning that for all users/customers the ids map to the same endpoints (to ease troubleshooting and reproducing issues).

Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md Outdated
Comment thread docs/REST API/rest-api.md
Comment thread docs/REST API/rest-api.md
"updated_at": "0001-01-01T00:00:00Z",
"id": 5,
"name": "Jane Doe",
"email": "janedoe+randomlygeneratedstring@example.com",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checking, janedoe is the name of the admin that's creating the API user? Or is the whole email randomly generated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's the admin's email

Comment thread docs/REST API/rest-api.md Outdated
@rachaelshaw
rachaelshaw merged commit 5140267 into docs-v4.85.0 Apr 23, 2026
6 checks passed
@rachaelshaw
rachaelshaw deleted the 38044-api-design branch April 23, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants