Skip to main content

Overview

Create a new monitor group to organize and manage your monitoring checks. Groups can be nested to create hierarchical structures. When creating a child group, specify the parent_group_id to establish the relationship.

Authentication

Requires API Key authentication via the X-API-Key header.
X-API-Key: YOUR_API_KEY

Request

The parent_group_id is optional. If not provided, the group will be created at the root level.
curl -X POST https://api.uptimeio.com/api/groups \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "name": "Production Services",
    "description": "Critical production monitoring group"
  }'

Request Body

FieldTypeRequiredDescription
namestringYesGroup name (1-100 characters)
descriptionstringNoGroup description (max 500 characters)
parent_group_idUUIDNoID of parent group for nested hierarchy

Response

Returns the created group object with a 201 status code.
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "organization_id": "org-uuid-here",
    "project_id": "project-uuid-here",
    "name": "Production Services",
    "description": "Critical production monitoring group",
    "parent_group_id": null,
    "check_count": 0,
    "created_at": "2024-12-26T10:30:00Z",
    "created_by": "user-uuid-here"
  }
}

Response Fields

FieldTypeDescription
idUUIDUnique identifier for the group
organization_idUUIDOrganization this group belongs to
project_idUUIDProject this group belongs to
namestringGroup name
descriptionstringGroup description
parent_group_idUUID | nullParent group ID if nested
check_countnumberNumber of monitors in this group
created_attimestampCreation timestamp
created_byUUID | nullUser who created the group

Status Codes

StatusDescription
201Group created successfully
400Validation error (missing required fields, invalid format)
401Unauthorized (missing or invalid token)
403Forbidden (no permission to create groups)

Examples

Create Root Level Group

curl -X POST https://api.uptimeio.com/api/groups \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Services",
    "description": "REST API and GraphQL endpoints"
  }'

Create Child Group

curl -X POST https://api.uptimeio.com/api/groups \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Web Services",
    "description": "Frontend and web services",
    "parent_group_id": "550e8400-e29b-41d4-a716-446655440000"
  }'

Error Codes

Validation Error

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request data",
    "details": [
      {
        "code": "too_small",
        "message": "String must contain at least 1 character(s)",
        "path": ["name"]
      }
    ]
  }
}

Unauthorized Error

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}

Circular Reference Error

Returned when the specified parent_group_id would create a circular hierarchy (e.g., setting a group’s parent to one of its descendants).
{
  "success": false,
  "error": {
    "code": "CIRCULAR_REFERENCE",
    "message": "Cannot create circular group reference"
  }
}

Duplicate Name Error

Returned when a group with the same name already exists in the organization.
{
  "success": false,
  "error": {
    "code": "DUPLICATE_NAME",
    "message": "Group name already exists in this organization"
  }
}

Maximum Depth Exceeded Error

Returned when creating a nested group would exceed the maximum nesting depth.
{
  "success": false,
  "error": {
    "code": "MAX_DEPTH_EXCEEDED",
    "message": "Maximum nesting depth exceeded"
  }
}

Rate Limiting

API requests are subject to rate limiting. Check the response headers for rate limit information:
  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Unix timestamp when limit resets