---
title: "Share a project with a group"
method: POST
path: "/api/v4/projects/{id}/share"
tags: ["projects"]
---

# Share a project with a group

`POST /api/v4/projects/{id}/share`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/share`
- Auth: none declared

Shares a specified project with a group.

## Path parameters

- `id` string, required

## Request body

- PostApiV4ProjectsIdShare: Share a project with a group
  - `group_id` integer, required: The ID of a group
  - `group_access` 10 | 15 | 20 | 25 | 30 | 40 | 50, required: The group access level
  - `expires_at` string, date: Share expiration date
  - `member_role_id` integer: The ID of the Member Role to be assigned to the group

## Response `201`

Share a project with a group

- APIEntitiesProjectGroupLink: API_Entities_ProjectGroupLink model
  - `id` integer, required
  - `project_id` integer, required
  - `group_id` integer, required
  - `group_access` integer, required
  - `expires_at` string, date, required
  - `member_role_id` integer

## Other responses

- `400`: Bad request
- `403`: Unauthenticated
- `404`: Not found

---

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