> This page is for Schema Service, version v3 (latest) (default).
> For other versions, use one of these documentation indexes:
> - v3 (latest) (default): https://autodesk.ferndocs.com/schema/schema-service/v3/llms.txt
> - v2: https://autodesk.ferndocs.com/schema/schema-service/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://autodesk.ferndocs.com/schema/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://autodesk.ferndocs.com/schema/_mcp/server.

# Task 4 - Create and-fetch a Library

# Task 4 - Create a Library

A Library is a workspace under which you can create schemas. You can create multiple published or draft version schemas under the library and add the schema to the different library. You can create multiple libraries under a group.

## Expected task outcome

By the end of this task you will be able to:

* Create a new library.
* Fetch details of a library.

## Endpoints used in this task

You will use the following API endpoints in this task:

.. list-table::
:widths: 10, 50, 40
:header-rows: 1

* * Method
  * Endpoint
  * Operation
* * POST
  * /organizations/\{organizationId}/groups/\{groupId}/libraries
  * `Create a Library`\_
* * GET
  * /organizations/\{organizationId}/groups/\{groupId}/libraries/\{libraryId}
  * `Fetch a Library`\_

## Step 1 - Create a Library

In Postman, on the sidebar, Select **Task 4 > POST Create a Library** and click **Send**. The equivalent cURL request is as follows.

## Request

```ruby
 curl -X POST \
      'https://developer-stg.api.autodesk.com/schema/v3/organizations/<ORGANIZATION_ID>/groups/<GROUP_ID>/libraries' \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Bearer <YOUR_ACCERSS_TOKEN>' \
     -D '{
         "name": "<LIBRARY_ID>",
         "title": "<LIBRARY_TITLE>",
         "description": "<LIBRARY_DESCRIPTION",
         "userData": {}
         }
```

|

## Response

```json

{
 "name": "<LIBRARY_ID>",
 "title": "<LIBRARY_TITLE>",
 "description": "<LIBRARY_DESCRIPTION",
 "userData": {},
 "createdBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
 "createTime": "2022-08-10T05:48:05Z",
 "lastModifiedBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
 "lastModifiedTime": "2022-08-10T05:48:05Z"
}
```

## Step 2 - Fetch a Library

This topic explains how to fetch the details of a specific library and the permission you have been granted.

In postman, Select **Task 4 > GET Fetch Library** and click **Send**. The equivalent cURL request is as follows.

## Request

```ruby
 curl -X GET \
     'https://developer-stg.api.autodesk.com/schema/v3/organizations/<ORGANIZATION_ID>/groups/<GROUP_ID>/libraries/<LIBRARY_ID>' \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Bearer <YOUR_ACCERSS_TOKEN>' \
```

|

## Response

```json

 {
 "name": "<LIBRARY_ID>",
 "title": "<LIBRARY_TITLE>",
 "description": "<LIBRARY_DESCRIPTION",
 "userData": {},
 "permissions": [
     {
         "Id": "read",
         "Effect": "Allow",
         "Subjects": {
             "Service": [
                 "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
             ]
         },
         "Action": "read"
     },
     {
         "Id": "admin",
         "Effect": "Allow",
         "Subjects": {
             "Service": [
                 "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
             ]
         },
         "Action": "admin"
     },
     {
         "Id": "write",
         "Effect": "Allow",
         "Subjects": {
             "Service": [
                 "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
             ]
         },
         "Action": "write"
     },
     {
         "Id": "delete",
         "Effect": "Allow",
         "Subjects": {
             "Service": [
                 "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J"
             ]
         },
         "Action": "delete"
     }
 ],
 "createdBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
 "createTime": "2022-08-10T05:48:06Z",
 "lastModifiedBy": "AYK3q05maQE8bVpTG2sTnYwPj0Jn6f8J",
 "lastModifiedTime": "2022-08-10T05:48:06Z"
 }
```