---
title: "Add groups to a published path's visibility"
method: POST
path: "/v2/published-paths/{id}/relationships/group-visibility/"
tags: ["Published Paths"]
---

# Add groups to a published path's visibility

`POST /v2/published-paths/{id}/relationships/group-visibility/`

## Request

- Base URL: `https://api.skilljar.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.skilljar.com/v2/published-paths/{id}/relationships/group-visibility/`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/skilljar/apis/skilljar-api-v2/docs/v2/published-paths/:id/relationships/group-visibility/post.ts> (a function with typed inputs; its response is checked against the schema)

Add groups in bulk. Re-adding a member succeeds. A row that fails is reported per item (207).

**Required OAuth scope:** `paths:write`

## Path parameters

- `id` string, required

## Request body

- GroupVisibilityRequestEnvelope: Body of POST and DELETE on /v2/published-paths/{id}/relationships/group-visibility/.
  - `data` GroupIdentifier[], required
    - `id` string, required
    - `type` 'groups', required

## Response `200`

OK

- BatchResultEnvelopeGroupIdentifier
  - `data` union[], required: Per-item results in request order.
    - union
      - BatchSucceededItemGroupIdentifier
        - `status` 'succeeded'
        - `id` string, nullable: Resource ID of the created or updated resource.
        - `result` GroupIdentifier, required: Identifier of a group in a path's group visibility.
          - `id` string, required
          - `type` 'groups', required
      - BatchFailedItem: Wrapper for a failed item in a 207 batch response.
        - `status` 'failed'
        - `id` string, nullable: Echoed resource ID if the input identified a row.
        - `error` BatchItemError, required: Per-item error inside a 207 batch response. Aligned with JSON:API ``ErrorObject`` field naming (``code`` rather than ``reason``) so consumers can reuse error-handling logic across document-level errors (``ErrorObject`` in ``ErrorEnvelope``) and per-item errors (here). Differences from ``ErrorObject``: ``status``/``title`` are omitted because they're redundant for the 207-batch context (HTTP status is on the envelope, and the title is derivable from ``code``).
          - `code` 'duplicate_email' | 'duplicate_in_batch' | 'duplicate_name' | 'validation_error' | 'not_found' | 'internal_error' | 'not_in_domain' | 'already_enrolled' | 'already_published' | 'already_in_path', required: Machine-readable error code.
          - `source` object, nullable: Pointer to the offending input slot, e.g. {"pointer": "/data/0/attributes/email"}.
          - `detail` string, nullable: Human-readable explanation of the error.
  - `summary` BatchSummary, required: Aggregate counts for a 207 batch response. Invariant: ``succeeded + failed == total``. Enforced by ``@model_validator``.
    - `total` integer, required: Total number of items submitted.
    - `succeeded` integer, required: Number of items that succeeded.
    - `failed` integer, required: Number of items that failed.

## Other responses

- `207`: Multi-Status
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `406`: Not Acceptable: Accept rules out application/vnd.api+json.
- `413`: Payload Too Large: the request body exceeds the maximum allowed size.
- `415`: Unsupported Media Type: Content-Type must be application/json or application/vnd.api+json.
- `422`: Unprocessable Entity

## Changes

- **2026-10-21** `ef632566f7f1`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/skilljar/apis/skilljar-api-v2/changes/v2/published-paths/:id/relationships/group-visibility/post.md)

---

[API](https://skmtc.dev/skilljar/apis/skilljar-api-v2.md) - [All operations](https://skmtc.dev/skilljar/apis/skilljar-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/skilljar/apis/skilljar-api-v2/revisions/fbda30ce1742?raw)
