---
title: "Grants a user account access to a Library"
method: POST
path: "/api/Library/grant-access"
tags: ["Library"]
---

# Grants a user account access to a Library

`POST /api/Library/grant-access`

## Request body

- UpdateLibraryForUserDto
  - `username` string, nullable, required
  - `selectedLibraries` LibraryDto[], nullable, required
    - `id` integer
    - `name` string, nullable
    - `type` 0 | 1 | 2 | 3 | 4 | 5 — Members: - `0` — Manga - `1` — Comic (Flexible) (Comic) - `2` — Book - `3` — Image - `4` — Light Novel (LightNovel) - `5` — Comic (ComicVine)
    - `lastScanned` string, date-time
    - `coverImage` string, nullable
    - `folderWatching` boolean
    - `includeInDashboard` boolean
    - `includeInRecommended` boolean
    - `manageCollections` boolean
    - `manageReadingLists` boolean
    - `includeInSearch` boolean
    - `allowScrobbling` boolean
    - `folders` string[], nullable
    - `collapseSeriesRelationships` boolean
    - `libraryFileTypes` FileTypeGroup[], nullable
    - `excludePatterns` string[], nullable
    - `allowMetadataMatching` boolean
    - `enableMetadata` boolean
    - `removePrefixForSortName` boolean
    - `inheritWebLinksFromFirstChapter` boolean
    - `defaultLanguage` string, nullable

## Response `200`

OK

- MemberDto
  - `id` integer
  - `username` string, nullable
  - `email` string, nullable
  - `isPending` boolean
  - `ageRestriction` AgeRestrictionDto
    - `ageRating` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -1, required — Members: - `0` — Unknown - `1` — Rating Pending (RatingPending) - `2` — Early Childhood (EarlyChildhood) - `3` — Everyone - `4` — G - `5` — Everyone 10+ (Everyone10Plus) - `6` — PG - `7` — Kids to Adults (KidsToAdults) - `8` — Teen - `9` — MA15+ (Mature15Plus) - `10` — Mature 17+ (Mature17Plus) - `11` — M (Mature) - `12` — R18+ (R18Plus) - `13` — Adults Only 18+ (AdultsOnly) - `14` — X18+ (X18Plus) - `-1` — Not Applicable (NotApplicable)
    - `includeUnknowns` boolean, required
  - `created` string, date-time
  - `createdUtc` string, date-time
  - `lastActive` string, date-time
  - `lastActiveUtc` string, date-time
  - `libraries` LibraryDto[], nullable
    - `id` integer
    - `name` string, nullable
    - `type` 0 | 1 | 2 | 3 | 4 | 5 — Members: - `0` — Manga - `1` — Comic (Flexible) (Comic) - `2` — Book - `3` — Image - `4` — Light Novel (LightNovel) - `5` — Comic (ComicVine)
    - `lastScanned` string, date-time
    - `coverImage` string, nullable
    - `folderWatching` boolean
    - `includeInDashboard` boolean
    - `includeInRecommended` boolean
    - `manageCollections` boolean
    - `manageReadingLists` boolean
    - `includeInSearch` boolean
    - `allowScrobbling` boolean
    - `folders` string[], nullable
    - `collapseSeriesRelationships` boolean
    - `libraryFileTypes` FileTypeGroup[], nullable
    - `excludePatterns` string[], nullable
    - `allowMetadataMatching` boolean
    - `enableMetadata` boolean
    - `removePrefixForSortName` boolean
    - `inheritWebLinksFromFirstChapter` boolean
    - `defaultLanguage` string, nullable
  - `roles` string[], nullable
  - `identityProvider` 0 | 1 — Members: - `0` — Kavita - `1` — OpenID Connect (OpenIdConnect)

---

[API](https://skmtc.net/kareadita/apis/kavita.md) · [All operations](https://skmtc.net/kareadita/apis/kavita/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kareadita/kavita/versions/a092f0284f3e/schema)
