---
title: "Create or Update Repository"
method: PUT
path: "/accounts/{{account_id}}/repos/{repo_name}"
tags: ["Repositories"]
---

# Create or Update Repository

`PUT /accounts/{{account_id}}/repos/{repo_name}`

## Request

- Base URL: `https://repos.api.brightcove.com/v1`
- URL: `https://repos.api.brightcove.com/v1/accounts/{{account_id}}/repos/{repo_name}`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://oauth.brightcove.com/v4/access_token` scopes: `video-cloud/player/all`

This will create a Repository, if it does not exist. A response of 200 means the repository already existed. A response of 201 means repository was successfully created.

## Path parameters

- `account_id` string, required
- `repo_name` string, required

## Headers

- `Content-Type` string, required
- `Authorization` string, required

## Response `200`

200 - (repo already exists)

- CreateRepositoryResponse
  - `name` string: repo name
  - `public_url` string: URL for the public player
  - `repo_url` string: URL for the repository

## Other responses

- `201`: 201 (repo created)
- `401`: UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token
- `404`: RESOURCE_NOT_FOUND: The api couldn&#39;t find the resource you requested

## Changes

- **2023-03-26** `fd3476e5507a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/brightcovelearning/apis/delivery-system-api-reference/changes/accounts/:{account_id}/repos/:repo_name/put.md)

---

[API](https://skmtc.dev/brightcovelearning/apis/delivery-system-api-reference.md) - [All operations](https://skmtc.dev/brightcovelearning/apis/delivery-system-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/brightcovelearning/apis/delivery-system-api-reference/revisions/fd3476e5507a?raw)
