Ir para o conteúdo
NimbusNexus

Grupos de usuários

Um grupo de usuários é uma coleção nomeada de usuários que podem receber funções juntos. Em vez de conceder a função reader em um projeto a quinze engenheiros, um por um, você a concede ao grupo backend-team e adiciona os novos engenheiros ao grupo. Conceda a função com POST /api/v1/roles/grant, indicando o group e o project, e adicione membros com POST /api/v1/groups/grant.

Os grupos têm escopo de workspace. Um usuário pode pertencer a vários grupos; um grupo pode ter funções em vários projetos dentro do seu workspace. As atribuições de função são aditivas — um usuário recebe a união de todas as funções concedidas diretamente a ele mais todas as funções concedidas a um grupo do qual faz parte.

Para times pequenos (menos de ~10 pessoas), concessões por usuário geralmente bastam. Os grupos passam a ser a resposta certa em algum ponto entre 10 e 50 usuários, quando "auditar quem tem acesso ao projeto X" precisa ser respondido em segundos, e não conferindo 30 entradas de IAM à mão.

Próximos passos

Reference

GET/api/v1/groups/

List Groups

List groups in the caller's workspace, optionally filtered by user membership and search term.

Parameters

NameInTypeDescription
userquerystring | null—
searchquerystring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/groups/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/groups/

Create Group

Create a new group in the caller's workspace.

Request body

FieldTypeDescription
name*string—
descriptionstring | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/groups/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example"
  }'
POST/api/v1/groups/grant

Grant Group

Add users to groups in a single batched call. Every group and user must be in the caller's workspace.

Request body

JSON body required.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/groups/grant" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "user_id": "<user_id>",
      "group_id": "<group_id>"
    }
  ]'
POST/api/v1/groups/revoke

Revoke Group

Remove users from groups in a single batched call. Every group and user must be in the caller's workspace.

Request body

JSON body required.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/groups/revoke" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "user_id": "<user_id>",
      "group_id": "<group_id>"
    }
  ]'
GET/api/v1/groups/{group_id}

Get Group

Retrieve a single group by ID, scoped to the caller's workspace.

Parameters

NameInTypeDescription
group_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/groups/<group_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PATCH/api/v1/groups/{group_id}

Update Group

Update the name or description of an existing group within the caller's workspace.

Parameters

NameInTypeDescription
group_id*pathstring—

Request body

FieldTypeDescription
namestring | null—
descriptionstring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PATCH "https://api.nimbusnexus.net/api/v1/groups/<group_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/api/v1/groups/{group_id}

Delete Group

Delete a group from the caller's workspace.

Parameters

NameInTypeDescription
group_id*pathstring—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/groups/<group_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"

Need to make a real call? Try these endpoints in the live Swagger UI →