--- id: create-a-group title: "Create a Group" description: "Creates a Group" sidebar_label: "Create a Group" hide_title: true hide_table_of_contents: true api: {"description":"Creates a Group","tags":["Groups"],"security":[{"BearerAuth":[]},{"TokenAuth":[]}],"requestBody":{"description":"New Group request","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"peers":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"200":{"description":"A Group Object","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group Name identifier","type":"string"},"peers_count":{"description":"Count of peers associated to the group","type":"integer"}},"required":["id","name","peers_count"],"title":"GroupMinimum"},{"type":"object","properties":{"peers":{"description":"List of peers object","type":"array","items":{"type":"object","properties":{"id":{"description":"Peer ID","type":"string"},"name":{"description":"Peer's hostname","type":"string"}},"required":["id","name"],"title":"PeerMinimum"}}},"required":["peers"]}],"title":"Group"}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"post","path":"/api/groups","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"}},"jsonRequestBodyExample":{"name":"string","peers":["string"]},"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":"Create a Group","description":{"content":"Creates a Group","type":"text/plain"},"url":{"path":["api","groups"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}},"auth":{"type":"bearer","bearer":[{"type":"any","value":"","key":"token"}]}}} sidebar_class_name: "post 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"; ## Create a Group Creates a Group
Request Body
New Group request
A Group Object
Schema
    peers object[] required
    List of peers object
  • Array [
  • ]
Bad Request
Requires authentication
Forbidden
Internal Server Error