---
title: "Create Group"
full: true
_openapi:
  method: POST
  toc: []
  structuredData:
    headings: []
    contents:
      - content: "Creates a new group for the organization"
_apiData:
  document: "https://reloop.sh/api/contacts/openapi/json"
  operationData: [{"path":"/api/contacts/v1/groups/create","method":"post"}]
  parameterList: [{"name":"name","type":"string","required":true,"description":"Group name","location":"body","minLength":1,"maxLength":50}]
  responseMap: {"201":{"description":"Response for status 201","schema":{"object":"contact_group","id":"con_123456789","name":"Newsletter","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z","event":"evt_123456789"}},"403":{"description":"Response for status 403","schema":{"message":"Unauthorized access","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead."}},"409":{"description":"Response for status 409","schema":{"message":"Group already exists","why":"A contact with this email already exists in your organization.","fix":"Use a different email address or update the existing contact instead."}}}
  codeSamples:
    - id: node
      lang: javascript
      label: Node.js
      source: |-
        import { Reloop } from "reloop-email";
        
        const reloop = new Reloop({ apiKey: "rl_123456789" });
        
        const { group, groupError } = await reloop.contacts.groups.create({
          name: "Beta Testers",
        });
        
        if (groupError) throw groupError;
        
        console.log(group.id, group.name);
    - id: curl
      lang: bash
      label: cURL
      source: |-
        curl -X POST https://reloop.sh/api/contacts/v1/groups/create \
          -H "x-api-key: rl_123456789" \
          -H "Content-Type: application/json" \
          -d '{"name": "Beta Testers"}'
    - id: python
      lang: python
      label: Python
      source: |-
        from reloop_email import Reloop
        
        reloop = Reloop(api_key="rl_123456789")
        
        result = reloop.contacts.groups.create({
          "name": "Beta Testers",
        })
        
        if result.group_error:
            raise result.group_error
        
        print(result.group["id"], result.group["name"])
    - id: php
      lang: php
      label: PHP
      source: |-
        <?php
        
        require 'vendor/autoload.php';
        
        use Reloop\Reloop;
        
        $reloop = Reloop::client('rl_123456789');
        
        $group = $reloop->contacts->groups->create([
            'name' => 'Beta Testers',
        ]);
        echo $group['id'] . ' ' . $group['name'] . PHP_EOL;
    - id: java
      lang: java
      label: Java
      source: |-
        import sh.reloop.ReloopClient;
        ReloopClient reloop = new ReloopClient("rl_123456789");
        
        CreateGroupParams params = new CreateGroupParams();
        params.name = "Beta Testers";
        var group = reloop.contacts.groups.create(params);
        System.out.println(group.id + " " + group.name);
    - id: dotnet
      lang: csharp
      label: .NET
      source: |-
        using Reloop;
        using Reloop.Models;
        
        var reloop = new ReloopClient("rl_123456789");
        
        await reloop.Contacts.CreateGroupAsync(new Dictionary<string, object?> { ["name"] = "Beta Testers" });
    - id: go
      lang: go
      label: Go
      source: |-
        import reloop "github.com/reloop-labs/reloop-go"
        
        client, _ := reloop.NewClient(reloop.ClientOptions{
            APIKey: "rl_123456789",
        })
        
        group, _ := client.Contacts.CreateGroup(map[string]interface{}{"name": "Beta Testers"})
    - id: rust
      lang: rust
      label: Rust
      source: |-
        use reloop::ReloopClient;
        #[tokio::main]
        async fn main() -> Result<(), Box<dyn std::error::Error>> {
            let reloop = ReloopClient::new("rl_123456789".to_string(), None);
        
            reloop.contacts().create_group(CreateGroupParams { name: "Beta Testers".to_string() }).await?;
        
            Ok(())
        }
    - id: ruby
      lang: ruby
      label: Ruby
      source: |-
        require "reloop"
        
        reloop = Reloop::Client.new(api_key: "rl_123456789")
        
        group = reloop.contacts.create_group(name: "Beta Testers")
    - id: elixir
      lang: elixir
      label: Elixir
      source: |-
        client = Reloop.client("rl_123456789")
        
        {:ok, group} = Reloop.Services.Contacts.create_group(client, %{name: "Beta Testers"})
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


{/* This file was generated by the OpenAPI doc generator. Do not edit this file directly. Run `bun run generate:api-docs` to regenerate. */}

<APIPage />
