---
title: Create a new host group
slug: api/create-a-new-host-group
docTags: 
createdAt: 2026-03-01T03:12:36.506Z
---

{
  "id": "kjWfyhPraIJOzim9f0TKC",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://openapi.sine.co/v1/api/hosts/groups",
    "servers": [
      {
        "url": "https://openapi.sine.co/v1/api/hosts/groups",
        "description": "Sine Public API"
      }
    ],
    "name": "Create a new host group",
    "description": "<p>Create a new host group.</p>\n<p>This method is used to create both team-scoped and site-scoped host groups.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "x-sine-team-id",
          "type": "string<uuid>",
          "description": "The UUID of the Team",
          "format": "uuid"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Initial data for the created host group",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "<p>The display name of the host group. It must be unique for each site and for team-scoped host groups on the same team.</p>",
              "example": "Host Group Name"
            },
            {
              "name": "siteId",
              "kind": "optional",
              "type": "string<uuid>",
              "description": "<p>The ID of the site for which this host group should be created. If unspecified this method will create a team-scoped host group.</p>",
              "example": "019fe2b4-f2ee-4a19-873d-ddb4f014dfce",
              "format": "uuid"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>To obtain a token, call <code>POST /oauth2/token</code> with your <code>client_id</code> and <code>client_secret</code>. The returned <code>access_token</code> is then used as a Bearer token for all subsequent requests.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "<p>OK - Host group has been created successfully</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string<uuid>",
                "description": "",
                "example": "ecbc5ca7-d6e1-4133-90a0-e7070d993f18",
                "format": "uuid"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The display name of the host group. It must be unique for each site and for team-scoped host groups on the same team.</p>",
                "example": "Host Group Name"
              },
              {
                "name": "private",
                "kind": "optional",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "site",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Site Name"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid request",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Invalid request\n{\n  \"code\": \"\",\n  \"message\": \"\"\n}"
          },
          {
            "label": "BadRequest",
            "code": "{\n  \"id\": \"BAD_REQUEST\",\n  \"message\": \"The request is invalid\"\n}"
          },
          {
            "label": "HostGroupNameTaken",
            "code": "{\n  \"id\": \"HOST_GROUP_NAME_TAKEN\",\n  \"message\": \"A host group with this name already exists for this site or team\"\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"UNAUTHORIZED\",\"message\":\"Invalid authentication credentials\"}",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": "HTTP status code",
                "example": "UNAUTHORIZED"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Custom error message",
                "example": "Invalid authentication credentials"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"FORBIDDEN\",\"message\":\"You are not allowed to access this information\"}",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": "HTTP status code",
                "example": "FORBIDDEN"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Custom error message",
                "example": "You are not allowed to access this information"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Resource not found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"SITE_NOT_FOUND\",\"message\":\"SiteNotFoundError\"}",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": "HTTP status code",
                "example": "SITE_NOT_FOUND"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Custom error message",
                "example": "SiteNotFoundError"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "424",
        "description": "Service dependency failed",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"CONSUMER_ERROR\",\"message\":\"Unexpected error while communicating with downstream service, please try again\"}",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": "HTTP status code",
                "example": "CONSUMER_ERROR"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Custom error message",
                "example": "Unexpected error while communicating with downstream service, please try again"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "429",
        "description": "Too many requests",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"RATE_LIMITED\",\"message\":\"API rate limit exceeded\"}",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": "HTTP status code",
                "example": "RATE_LIMITED"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Custom error message",
                "example": "API rate limit exceeded"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Internal server error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"INTERNAL_SERVER_ERROR\",\"message\":\"Something went wrong, please try again later\"}",
            "description": "",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": "HTTP status code",
                "example": "INTERNAL_SERVER_ERROR"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Custom error message",
                "example": "Something went wrong, please try again later"
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "nrDXzHIr6xQx5DUXEhlH4",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://openapi.sine.co/v1/api/hosts/groups \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-sine-team-id: string<uuid>' \\\n     --data '{\n     \"name\": \"Host Group Name\"\n     }'"
        },
        {
          "id": "R5kh4k9makfOeKg5WNT4g",
          "language": "javascript",
          "label": "JavaScript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-sine-team-id\", \"string<uuid>\");\n\nvar raw = JSON.stringify({\n   \"name\": \"Host Group Name\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://openapi.sine.co/v1/api/hosts/groups\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qnkGMbOluKtgy_l13TFJT",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://openapi.sine.co/v1/api/hosts/groups\"\n\npayload = json.dumps({\n   \"name\": \"Host Group Name\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-sine-team-id': 'string<uuid>'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "nrDXzHIr6xQx5DUXEhlH4"
    },
    "results": {
      "languages": [
        {
          "id": "_EGtkuq7Xv9msrP-8GI3C",
          "language": "201",
          "code": "// OK - Host group has been created successfully\n{\n  \"id\": \"ecbc5ca7-d6e1-4133-90a0-e7070d993f18\",\n  \"name\": \"Host Group Name\",\n  \"private\": false,\n  \"site\": {\n    \"id\": \"\",\n    \"name\": \"Site Name\"\n  }\n}"
        },
        {
          "id": "_EF_vKVme3HLXT_pGFdb1",
          "language": "400",
          "code": "// Invalid request\n{\n  \"code\": \"\",\n  \"message\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Invalid request\n{\n  \"code\": \"\",\n  \"message\": \"\"\n}"
            },
            {
              "label": "BadRequest",
              "code": "{\n  \"id\": \"BAD_REQUEST\",\n  \"message\": \"The request is invalid\"\n}"
            },
            {
              "label": "HostGroupNameTaken",
              "code": "{\n  \"id\": \"HOST_GROUP_NAME_TAKEN\",\n  \"message\": \"A host group with this name already exists for this site or team\"\n}"
            }
          ]
        },
        {
          "id": "leotCxjdBxgs46DKyKhEN",
          "language": "401",
          "code": "// Unauthorized\n{\n  \"code\": \"UNAUTHORIZED\",\n  \"message\": \"Invalid authentication credentials\"\n}"
        },
        {
          "id": "hCsaXfoaiR2z5aDG0ryCd",
          "language": "403",
          "code": "// Forbidden\n{\n  \"code\": \"FORBIDDEN\",\n  \"message\": \"You are not allowed to access this information\"\n}"
        },
        {
          "id": "7VNM2m0iJiWJVwdhW4kTs",
          "language": "404",
          "code": "// Resource not found\n{\n  \"code\": \"SITE_NOT_FOUND\",\n  \"message\": \"SiteNotFoundError\"\n}"
        },
        {
          "id": "6_VGLtzmabpU8tc_gzT_i",
          "language": "424",
          "code": "// Service dependency failed\n{\n  \"code\": \"CONSUMER_ERROR\",\n  \"message\": \"Unexpected error while communicating with downstream service, please try again\"\n}"
        },
        {
          "id": "gouTeG5nyTbyK7g32p5BL",
          "language": "429",
          "code": "// Too many requests\n{\n  \"code\": \"RATE_LIMITED\",\n  \"message\": \"API rate limit exceeded\"\n}"
        },
        {
          "id": "yP1b96-JDDHR1rfmUyUuA",
          "language": "500",
          "code": "// Internal server error\n{\n  \"code\": \"INTERNAL_SERVER_ERROR\",\n  \"message\": \"Something went wrong, please try again later\"\n}"
        }
      ],
      "selectedLanguageId": "_EGtkuq7Xv9msrP-8GI3C"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}