--- id: get-accounts title: "List all Accounts" description: "Returns a list of accounts of a user. Always returns a list of one account." sidebar_label: "List all Accounts" hide_title: true hide_table_of_contents: true api: {"description":"Returns a list of accounts of a user. Always returns a list of one account.","tags":["Accounts"],"operationId":"getAccounts","security":[{"BearerAuth":[]},{"TokenAuth":[]}],"responses":{"200":{"description":"A JSON array of accounts","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"id":{"description":"Account ID","type":"string"},"settings":{"properties":{"peer_login_expiration_enabled":{"description":"Enables or disables peer login expiration globally. After peer's login has expired the user has to log in (authenticate). Applies only to peers that were added by a user (interactive SSO login).","type":"boolean"},"peer_login_expiration":{"description":"Period of time after which peer login expires (seconds).","type":"integer"}},"required":["peer_login_expiration_enabled","peer_login_expiration"],"title":"AccountSettings"}},"required":["id","settings"],"title":"Account"}}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"get","path":"/api/accounts","servers":[{"url":"https://netbird.io","description":"Default server"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"TokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Prefix the value with \\\"Token\\\" to indicate the custom authorization type"}},"info":{"title":"NetBird REST API","description":"API to manipulate groups, rules, policies and retrieve information about peers and users","version":"0.0.1"},"postman":{"name":"List all Accounts","description":{"content":"Returns a list of accounts of a user. Always returns a list of one account.","type":"text/plain"},"url":{"path":["api","accounts"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"bearer","bearer":[{"type":"any","value":"","key":"token"}]}}} sidebar_class_name: "get api-method" info_path: api/netbird-rest-api custom_edit_url: null --- import ApiTabs from "@theme/ApiTabs"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; import ResponseSamples from "@theme/ResponseSamples"; import SchemaItem from "@theme/SchemaItem"; import SchemaTabs from "@theme/SchemaTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import TabItem from "@theme/TabItem"; ## List all Accounts Returns a list of accounts of a user. Always returns a list of one account.
A JSON array of accounts
Schema
  • Array [
  • settings AccountSettings required
  • ]
Bad Request
Requires authentication
Forbidden
Internal Server Error