> This page is for Schema Service, version v2.
> 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 2 - Create a Company

A company typically represents a real-world company. It is a container of all the namespaces and schemas of that company. So, in this step you create company to hold all the schemas you will create for this tutorial.

You do not need any special privileges to create a company. Every company you create is private by default. You will have admin privileges to the company and all namespaces and schemas within that company.

## Expected task outcome

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

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

## Endpoints used in this task

You will use the following API endpoints in this task:

| Method | Endpoint                | Operation        |
| ------ | ----------------------- | ---------------- |
| POST   | /companies              | Create a Company |
| GET    | /companies/\{companyId} | Fetch a Company  |

## Step 1 - Create a Company

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

### Request

```bash
 curl -X POST \
     'https://developer-stg.api.autodesk.com/schema/v2/companies' \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Bearer <YOUR_ACCERSS_TOKEN>' \
     -d '{
           "attributes": {,
           "name": "<COMPANY_NAME>",
           "title": "<COMPANY_TITLE>",
           "description": "<COMPANY_DESCRIPTION>"
           }
         }'
```

|

A script in the **Tests** tab saves the ID of the company to a variable named `COMPANY_ID`, so that it can be used in subsequent API calls.

### Response

```json

{
 "data": {
     "type": "companies",
     "id": "<COMPANY_ID>",
     "attributes": {
         "name": "<COMPANY_NAME>",
         "title": "<COMPANY_TITLE>",
         "description": "<COMPANY_DESCRIPTION>",
         "createdBy": "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25",
         "createTime": "2022-06-20T02:49:58Z",
         "lastModifiedBy": "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25",
         "lastModifiedTime": "2022-06-20T02:49:58Z"
     }
 }
 }
```

## Step 2 - Fetch Company

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

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

### Request

```ruby
 curl -X GET \
     'https://developer-stg.api.autodesk.com/schema/v2/companies/<COMPANY_ID>' \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Bearer <YOUR_ACCERSS_TOKEN>'
```

|

### Response

```json

{
 "data": {
     "type": "companies",
     "id": "<COMPANY_ID>",
     "attributes": {
         "name": "<COMPANY_NAME>",
         "title": "<COMPANY_TITLE>",
         "description": "<COMPANY_DESCRIPTION>",
         "permissions": [
             {
                 "Id": "read",
                 "Effect": "Allow",
                 "Subjects": {
                     "Service": [
                         "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25"
                     ]
                 },
                 "Action": "read"
             },
             {
                 "Id": "admin",
                 "Effect": "Allow",
                 "Subjects": {
                     "Service": [
                         "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25"
                     ]
                 },
                 "Action": "admin"
             },
             {
                 "Id": "delete",
                 "Effect": "Allow",
                 "Subjects": {
                     "Service": [
                         "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25"
                     ]
                 },
                 "Action": "delete"
             },
             {
                 "Id": "write",
                 "Effect": "Allow",
                 "Subjects": {
                     "Service": [
                         "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25"
                     ]
                 },
                 "Action": "write"
             }
         ],
         "createdBy": "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25",
         "createTime": "2022-06-20T02:49:59Z",
         "lastModifiedBy": "vRx4GPkPtgn6UwldLHddl1XoPxPNgm25",
         "lastModifiedTime": "2022-06-20T02:49:59Z"
     }
 }
}
```