---
title: "Create Repository"
method: POST
path: "/v1/repositories"
tags: ["Repositories"]
---

# Create Repository

`POST /v1/repositories`

Creates a new repository on the account.

## Request body

- CreateRepositoryRequest
  - `name` string, required — Display name for the repository
  - `accessType` 'UNRESTRICTED' | 'RESTRICTED' — Determines repository visibility. UNRESTRICTED repositories are visible to all users on the account, RESTRICTED are visible to specific authorized groups and individuals.
  - `users` AddRepositoryUserRequest[], required — List of users to add to the repository. Must contain at least one owner.
    - `userId` integer, required — Unique identifier of the user to add or update
    - `role` 'REPOSITORY_OWNER' | 'REPOSITORY_MEMBER', required — Role of a user on a repository
  - `groups` integer[] — Optional. Group Ids of groups whose members should have access to this repository. Only applicable to RESTRICTED repositories.

## Response `201`

Created. Returns the newly created repository.

- RepositoryObject
  - `repositoryId` string — Unique identifier for a repository folder, prefixed with `repo_`
  - `name` string — Display name of the repository
  - `accessType` 'UNRESTRICTED' | 'RESTRICTED' — Determines repository visibility. UNRESTRICTED repositories are visible to all users on the account, RESTRICTED are visible to specific authorized groups and individuals.
  - `created` string, date-time — The date and time the repository was created

## Other responses

- `400` — Bad Request. Occurs when no owner is provided, members or groups are added to an UNRESTRICTED repository, or invalid user/group IDs.
- `403` — Forbidden. Occurs when the user does not have permission to create a repository.

---

[API](https://skmtc.net/lucid/apis/lucid-rest-api.md) · [All operations](https://skmtc.net/lucid/apis/lucid-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lucid/lucid-rest-api/versions/6a32cb9e1aa7/schema)
