# Users

## GET /users

> List users

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users":{"get":{"tags":["users"],"summary":"List users","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.UsersResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.UsersResponse":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/model.User"}}}},"model.User":{"type":"object","properties":{"apiVersion":{"type":"string"},"kind":{"allOf":[{"$ref":"#/components/schemas/model.Kind"}]},"metadata":{"$ref":"#/components/schemas/model.Metadata"},"spec":{"$ref":"#/components/schemas/model.UserSpec"},"status":{"$ref":"#/components/schemas/model.NoStatus"}}},"model.Kind":{"type":"string","enum":["Configuration","Agent","AgentType","AgentVersion","Source","Processor","Connector","Destination","Extension","SourceType","ProcessorType","ConnectorType","DestinationType","ExtensionType","RecommendationType","Unknown","Rollout","RolloutType","Organization","Account","Invitation","Login","User","AccountOrganizationBinding","UserOrganizationBinding","UserAccountBinding","AuditTrail","AvailableComponents","SecretsManagerType","SecretsManager","Recording","Credential","CredentialType","Fleet","Integration","IntegrationType","ConfigurationType","Notification","Recommendation","PublicProcessor","Blueprint","PrometheusRule","APIKey","ResourcePreset"]},"model.Metadata":{"type":"object","properties":{"additionalInfo":{"$ref":"#/components/schemas/model.AdditionalInfo"},"blueprintTags":{"description":"BlueprintTags holds categorized tags for blueprints (e.g., use-case, destination).\nUnlike Labels, this supports multiple values per category.","allOf":[{"$ref":"#/components/schemas/model.BlueprintTags"}]},"dateModified":{"type":"string"},"deprecated":{"description":"Deprecated indicates that this resource is deprecated and should not be used. Deprecated resources should contain\nadditional information about why the resource is deprecated and what should be used instead.\nNote: Ironically, the Deprecated field is itself deprecated. Use Stability instead.","type":"boolean"},"description":{"type":"string"},"displayName":{"type":"string"},"hash":{"description":"Hash is a hex formatted sha256 Hash of the json-encoded spec that is used to determine if the spec has changed.","type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"labels":{"$ref":"#/components/schemas/model.Labels"},"name":{"type":"string"},"resourceDocLink":{"type":"string"},"stability":{"description":"Stability is the stability of the resource, one of development, alpha, beta, stable, or\ndeprecated. This should be used instead of the Deprecated field.","allOf":[{"$ref":"#/components/schemas/model.Stability"}]},"version":{"description":"Version is a 1-based integer that is incremented each time the spec is changed.","type":"integer"},"warning":{"description":"Warning is an optional message that is displayed to the user when the resource is configured. Currently used for IntegrationTypes.","type":"string"}}},"model.AdditionalInfo":{"type":"object","properties":{"documentation":{"type":"array","items":{"$ref":"#/components/schemas/model.DocumentationLink"}},"message":{"type":"string"}}},"model.DocumentationLink":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}},"model.BlueprintTags":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"model.Labels":{"type":"object"},"model.Stability":{"type":"string","enum":["development","alpha","beta","stable","deprecated",""]},"model.UserSpec":{"type":"object","properties":{"activeAccount":{"type":"string"},"email":{"type":"string"},"nextLoginAccount":{"type":"string"},"requestedMFA":{"description":"RequestedMFA is true if the user has opted-in for multi-factor authentication. This is only supported when Auth0\nis configured as the authentication type.","type":"boolean"}}},"model.NoStatus":{"type":"object"},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## Add User to Current Project

> The /users route will add a new user to an existing project.\
> If the create flag is set, and the user doesn't already exist, it will create the user and\
> add a new login in addition to the the project binding.

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users":{"post":{"description":"The /users route will add a new user to an existing project.\nIf the create flag is set, and the user doesn't already exist, it will create the user and\nadd a new login in addition to the the project binding.","tags":["users"],"summary":"Add User to Current Project","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ApplyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"422":{"description":"Tried to update a non-existing user, use the create flag to create a new user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.AddUserPayload"}}},"description":"Add User Payload"}}}},"components":{"schemas":{"model.ApplyResponse":{"type":"object","properties":{"updates":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceStatus"}}}},"model.ResourceStatus":{"type":"object","properties":{"before":{"description":"Before is the resource before the update, currently only used for audit events and omitted from API responses"},"reason":{"description":"Reason will be set if status is invalid or error","type":"string"},"resource":{"description":"Resource is the resource that was updated"},"status":{"description":"Status is the status of the resource after the update","allOf":[{"$ref":"#/components/schemas/model.UpdateStatus"}]}}},"model.UpdateStatus":{"type":"string","enum":["unchanged","configured","created","deleted","not-found","invalid","error","in-use","forbidden","deprecated"]},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.AddUserPayload":{"description":"Body of the request to add a user to an account","type":"object","properties":{"create":{"description":"Create should be true if the user should be created if they do not exist","type":"boolean"},"email":{"description":"Email address of the user to add","type":"string"},"name":{"description":"Name of the user to add","type":"string"}}}}}}
```

## GET /users/{id}

> Get user by id

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users/{id}":{"get":{"tags":["users"],"summary":"Get user by id","parameters":[{"schema":{"type":"string"},"description":"the id of the user","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.UserResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.UserResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/model.User"}}},"model.User":{"type":"object","properties":{"apiVersion":{"type":"string"},"kind":{"allOf":[{"$ref":"#/components/schemas/model.Kind"}]},"metadata":{"$ref":"#/components/schemas/model.Metadata"},"spec":{"$ref":"#/components/schemas/model.UserSpec"},"status":{"$ref":"#/components/schemas/model.NoStatus"}}},"model.Kind":{"type":"string","enum":["Configuration","Agent","AgentType","AgentVersion","Source","Processor","Connector","Destination","Extension","SourceType","ProcessorType","ConnectorType","DestinationType","ExtensionType","RecommendationType","Unknown","Rollout","RolloutType","Organization","Account","Invitation","Login","User","AccountOrganizationBinding","UserOrganizationBinding","UserAccountBinding","AuditTrail","AvailableComponents","SecretsManagerType","SecretsManager","Recording","Credential","CredentialType","Fleet","Integration","IntegrationType","ConfigurationType","Notification","Recommendation","PublicProcessor","Blueprint","PrometheusRule","APIKey","ResourcePreset"]},"model.Metadata":{"type":"object","properties":{"additionalInfo":{"$ref":"#/components/schemas/model.AdditionalInfo"},"blueprintTags":{"description":"BlueprintTags holds categorized tags for blueprints (e.g., use-case, destination).\nUnlike Labels, this supports multiple values per category.","allOf":[{"$ref":"#/components/schemas/model.BlueprintTags"}]},"dateModified":{"type":"string"},"deprecated":{"description":"Deprecated indicates that this resource is deprecated and should not be used. Deprecated resources should contain\nadditional information about why the resource is deprecated and what should be used instead.\nNote: Ironically, the Deprecated field is itself deprecated. Use Stability instead.","type":"boolean"},"description":{"type":"string"},"displayName":{"type":"string"},"hash":{"description":"Hash is a hex formatted sha256 Hash of the json-encoded spec that is used to determine if the spec has changed.","type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"labels":{"$ref":"#/components/schemas/model.Labels"},"name":{"type":"string"},"resourceDocLink":{"type":"string"},"stability":{"description":"Stability is the stability of the resource, one of development, alpha, beta, stable, or\ndeprecated. This should be used instead of the Deprecated field.","allOf":[{"$ref":"#/components/schemas/model.Stability"}]},"version":{"description":"Version is a 1-based integer that is incremented each time the spec is changed.","type":"integer"},"warning":{"description":"Warning is an optional message that is displayed to the user when the resource is configured. Currently used for IntegrationTypes.","type":"string"}}},"model.AdditionalInfo":{"type":"object","properties":{"documentation":{"type":"array","items":{"$ref":"#/components/schemas/model.DocumentationLink"}},"message":{"type":"string"}}},"model.DocumentationLink":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}},"model.BlueprintTags":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"model.Labels":{"type":"object"},"model.Stability":{"type":"string","enum":["development","alpha","beta","stable","deprecated",""]},"model.UserSpec":{"type":"object","properties":{"activeAccount":{"type":"string"},"email":{"type":"string"},"nextLoginAccount":{"type":"string"},"requestedMFA":{"description":"RequestedMFA is true if the user has opted-in for multi-factor authentication. This is only supported when Auth0\nis configured as the authentication type.","type":"boolean"}}},"model.NoStatus":{"type":"object"},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## DELETE /users/{id}

> Remove User from Current Project

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users/{id}":{"delete":{"tags":["users"],"summary":"Remove User from Current Project","parameters":[{"schema":{"type":"string"},"description":"the id of the user to remove from the current project","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Successful removal, no content"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## POST /users/{id}/demote-org-admin

> Demote a user from organization admin

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users/{id}/demote-org-admin":{"post":{"tags":["users"],"summary":"Demote a user from organization admin","parameters":[{"schema":{"type":"string"},"description":"the id of the user","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## Set a user's project role

> Sets the role of a user within the current project

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users/{id}/project-role":{"put":{"description":"Sets the role of a user within the current project","tags":["users"],"summary":"Set a user's project role","parameters":[{"schema":{"type":"string"},"description":"the id of the user","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ApplyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.SetProjectRolePayload"}}},"description":"Set Project Role Payload","required":true}}}},"components":{"schemas":{"model.ApplyResponse":{"type":"object","properties":{"updates":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceStatus"}}}},"model.ResourceStatus":{"type":"object","properties":{"before":{"description":"Before is the resource before the update, currently only used for audit events and omitted from API responses"},"reason":{"description":"Reason will be set if status is invalid or error","type":"string"},"resource":{"description":"Resource is the resource that was updated"},"status":{"description":"Status is the status of the resource after the update","allOf":[{"$ref":"#/components/schemas/model.UpdateStatus"}]}}},"model.UpdateStatus":{"type":"string","enum":["unchanged","configured","created","deleted","not-found","invalid","error","in-use","forbidden","deprecated"]},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.SetProjectRolePayload":{"description":"Body of the request to set a user's project role","type":"object","properties":{"role":{"description":"Role is the new project role for the user (admin, user, or viewer)","allOf":[{"$ref":"#/components/schemas/auth.Role"}]}}},"auth.Role":{"type":"string","enum":["admin","user","viewer","agent",""]}}}}
```

## POST /users/{id}/promote-org-admin

> Promote a user to organization admin

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users/{id}/promote-org-admin":{"post":{"tags":["users"],"summary":"Promote a user to organization admin","parameters":[{"schema":{"type":"string"},"description":"the id of the user","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## Remove a user from the current organization

> Removes the user from all organization projects and deletes the organization binding

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/users/{id}/remove-from-org":{"post":{"description":"Removes the user from all organization projects and deletes the organization binding","tags":["users"],"summary":"Remove a user from the current organization","parameters":[{"schema":{"type":"string"},"description":"the id of the user","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```


---

# 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://docs.bindplane.com/cli-and-api/api/users.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.
