GET/api/users

List all Users

Returns a list of all users

Query Parameters

  • Name
    service_user
    Type
    boolean
    Required
    optional
    Enum
    Description

    Filters users and returns either regular users or service users

Request

GET
/api/users
curl -X GET https://api.netbird.io/api/users \
-H 'Accept: application/json' \
-H 'Authorization: Token <TOKEN>' 

Response

[
  {
    "id": "google-oauth2|277474792786460067937",
    "email": "demo@netbird.io",
    "name": "Tom Schulz",
    "role": "admin",
    "status": "active",
    "last_login": "2023-05-05T09:00:35.477782Z",
    "auto_groups": [
      "ch8i4ug6lnn4g9hqv7m0"
    ],
    "is_current": true,
    "is_service_user": false,
    "is_blocked": false,
    "issued": "api",
    "permissions": {
      "dashboard_view": "limited"
    }
  }
]

POST/api/users

Create a User

Creates a new service user or sends an invite to a regular user

Request-Body Parameters

  • Name
    email
    Type
    string
    Required
    optional
    Enum
    Description

    User's Email to send invite to

  • Name
    name
    Type
    string
    Required
    optional
    Enum
    Description

    User's full name

  • Name
    role
    Type
    string
    Required
    required
    Enum
    Description

    User's NetBird account role

  • Name
    auto_groups
    Type
    string[]
    Required
    required
    Enum
    Description

    Group IDs to auto-assign to peers registered by this user

  • Name
    is_service_user
    Type
    boolean
    Required
    required
    Enum
    Description

    Is true if this user is a service user

Request

POST
/api/users
curl -X POST https://api.netbird.io/api/users \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
  "email": "demo@netbird.io",
  "name": "Tom Schulz",
  "role": "admin",
  "auto_groups": [
    "ch8i4ug6lnn4g9hqv7m0"
  ],
  "is_service_user": false
}'

Response

{
  "id": "google-oauth2|277474792786460067937",
  "email": "demo@netbird.io",
  "name": "Tom Schulz",
  "role": "admin",
  "status": "active",
  "last_login": "2023-05-05T09:00:35.477782Z",
  "auto_groups": [
    "ch8i4ug6lnn4g9hqv7m0"
  ],
  "is_current": true,
  "is_service_user": false,
  "is_blocked": false,
  "issued": "api",
  "permissions": {
    "dashboard_view": "limited"
  }
}

PUT/api/users/{userId}

Update a User

Update information about a User

Path Parameters

  • Name
    userId
    Type
    string
    Required
    required
    Enum
    Description

    The unique identifier of a user

Request-Body Parameters

  • Name
    role
    Type
    string
    Required
    required
    Enum
    Description

    User's NetBird account role

  • Name
    auto_groups
    Type
    string[]
    Required
    required
    Enum
    Description

    Group IDs to auto-assign to peers registered by this user

  • Name
    is_blocked
    Type
    boolean
    Required
    required
    Enum
    Description

    If set to true then user is blocked and can't use the system

Request

PUT
/api/users/{userId}
curl -X PUT https://api.netbird.io/api/users/{userId} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
  "role": "admin",
  "auto_groups": [
    "ch8i4ug6lnn4g9hqv7m0"
  ],
  "is_blocked": false
}'

Response

{
  "id": "google-oauth2|277474792786460067937",
  "email": "demo@netbird.io",
  "name": "Tom Schulz",
  "role": "admin",
  "status": "active",
  "last_login": "2023-05-05T09:00:35.477782Z",
  "auto_groups": [
    "ch8i4ug6lnn4g9hqv7m0"
  ],
  "is_current": true,
  "is_service_user": false,
  "is_blocked": false,
  "issued": "api",
  "permissions": {
    "dashboard_view": "limited"
  }
}

DELETE/api/users/{userId}

Delete a User

This method removes a user from accessing the system. For this leaves the IDP user intact unless the --user-delete-from-idp is passed to management startup.

Path Parameters

  • Name
    userId
    Type
    string
    Required
    required
    Enum
    Description

    The unique identifier of a user

Request

DELETE
/api/users/{userId}
curl -X DELETE https://api.netbird.io/api/users/{userId} \
-H 'Authorization: Token <TOKEN>' 

POST/api/users/{userId}/invite

Resend user invitation

Resend user invitation

Path Parameters

  • Name
    userId
    Type
    string
    Required
    required
    Enum
    Description

    The unique identifier of a user

Request

POST
/api/users/{userId}/invite
curl -X POST https://api.netbird.io/api/users/{userId}/invite \
-H 'Authorization: Token <TOKEN>'