> ## Documentation Index
> Fetch the complete documentation index at: https://thehyperstack.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Credential Group

### Description

This endpoint allows you to create a new **credential group** in Hyperstack. A credential group acts as a template container that organizes credentials by program or course.

### Headers

<ParamField header="Authorization" type="string" required="true">
  Bearer YOUR\_API\_TOKEN — obtainable from **Hyperstack Dashboard → Settings → API Access**
</ParamField>

### Body Parameters

<ParamField body="title" type="string" required="true">
  Title of the credential group.
</ParamField>

<ParamField body="description" type="string" required="true">
  Description of the credential group.
</ParamField>

<ParamField body="certificate_template" type="string" required="conditional">
  The template key for the certificate. At least one of `certificate_template` or `badge_template` is required.
</ParamField>

<ParamField body="badge_template" type="string" required="conditional">
  The template key for the badge. At least one of `certificate_template` or `badge_template` is required.
</ParamField>

<ParamField body="url" type="string" required="false">
  External URL associated with the credential group.
</ParamField>

<ParamField body="tags" type="array[string]" required="false">
  Tags related to the credential group.
</ParamField>

<ParamField body="group_code" type="string" required="false">
  A human-readable code for the group (e.g. `CERT-2024`). Alphanumeric, hyphens, and spaces only. Auto-generated if not provided.
</ParamField>

<ParamField body="does_expire" type="boolean" required="false">
  Indicates whether credentials in this group expire. Defaults to `false`.
</ParamField>

<ParamField body="validity" type="number" required="conditional">
  Validity period (in years) if <code>does\_expire</code> is `true`.
</ParamField>

<ParamField body="blockchain" type="boolean" required="false">
  Enables decentralized blockchain anchoring for credentials. Defaults to `false`.
</ParamField>

### Success Response Fields

<ResponseField name="success" type="boolean">
  Indicates whether the group creation was successful. Always `true` for a 200 response.
</ResponseField>

<ResponseField name="group_key" type="string">
  The unique key (ID) assigned to the newly created credential group.
</ResponseField>

### Responses

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "group_key": "aBcDeFgHiJkL"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "success": false,
    "error": "Title and Description are required",
    "error_code": "missing_title_description"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Invalid token or organization not found"
  }
  ```
</ResponseExample>

```bash theme={null}
curl -X POST "https://api.thehyperstack.com/v1/groups/new" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Course Completion Certificate",
    "description": "Awarded upon successful completion of the course.",
    "certificate_template": "abcdefg",
    "badge_template": "xyz",
    "url": "https://acme.com/course",
    "tags": ["apple", "mango", "orange"],
    "group_code": "CERT-2024",
    "does_expire": true,
    "validity": 1,
    "blockchain": true
  }'
```
