---
title: "Refresh a library"
method: POST
path: "/v2/teamspaces/{teamspaceId}/libraries/{owner}/{repo}/refresh"
tags: ["Teamspace Libraries"]
---

# Refresh a library

`POST /v2/teamspaces/{teamspaceId}/libraries/{owner}/{repo}/refresh`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v2/teamspaces/{teamspaceId}/libraries/{owner}/{repo}/refresh`
- Auth: HTTP bearer

Parse the library (or one branch) again from its source. Works for the teamspace's private and claimed libraries, and for any public library. Owners can refresh a limited number of times per period. Uploaded files cannot be refreshed.

## Request body

- object
  - `branch` string: A branch version to refresh in place of the default branch.
  - `gitToken` string: Token for a private repository. Default: the account connected in the dashboard.
  - `pageIds` string[]: Confluence and Notion: the pages to index.

## Response `200`

The refresh started

- object
  - `message` string, required

## Other responses

- `400`: The library cannot be refreshed (uploaded files)
- `401`: Unauthorized - Invalid or missing API key
- `403`: The caller cannot access this teamspace, the API key belongs to another teamspace, or the caller's role is too low
- `404`: The teamspace has no library with this id (neither claimed nor one of its private sources)
- `409`: No token for the private repository, or the Confluence or Notion account is not connected in the dashboard
- `429`: Too Many Requests - Rate limit exceeded
- `500`: Internal Server Error

## Changes

- **2026-10-22** `e17589fd8767`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v2/teamspaces/:teamspaceId/libraries/:owner/:repo/refresh/post.md)

---

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