> 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.

# Replace All Tags on a Schema

PUT https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources
Content-Type: application/json

Replaces all existing Tag Associations of a Schema with the Tag Associations you specify in the request body. Any Tags currently associated with the schema are disassociated from the schema.

**Important:**

1. Do not use this endpoint on schema that does not have Tag Associations.

2. Each time you submit a request to this endpoint, the backend reindexes the Tags. So, pack as many Tag Associations as you can into one request. As a result, the number of calls to this endpoint go down, which reduces the overhead on the backend.

You must have `write` access to a library to associate Tags with schema in that library. For more information see `Control Access </en/docs/schema/v3/developers_guide/basics/access/>`\_ under API Basics.

3. This is a batch API. Curret limit for this API is `10 resourceIds`.

4. Maximum 300 tags are allowed in a single `resourceId` and maximum 3 `tagCollections` can be accommodated in single `resourceId`, thus allowing total 3000 tags in single request with maximum `10 resourceIds`

Reference: https://autodesk.ferndocs.com/schema/schema-service/api-reference/tags-api/tag-associations/bulk-associate-tags

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `Region` (enum, optional, default: US) — The Autodesk Schema Registry currently supports in the US and EMEA regions. This header specifies where your data is stored. Possible Values: - ``US`` - (Default) All requests without a specified region header will be directed to the US region. - ``EMEA`` - Data center for the European Union, Middle East, and Africa. To access the EMEA region specifically, include the header "region: EMEA" in your API requests.
  - Allowed values: `US`, `EMEA`

### Body (application/json)

This endpoint expects an object.

- `resourceId` (string, required) — The ID of the schema you want to associate with Tags.
- `tags` (list of TagCollectionsResourcesPutRequestBodyContentApplicationJsonSchemaTagsItems, required) — An array containing information about the Tags to be associated with the schema. It also contains information about the Tag Collections that the Tags belong to.

## Response

### 207

Multiple operations have been attempted and a single response code is not able to convey the results of all operations. Check the response body for failures, if any. Every successful association contains a system-generated id attribute for the association that was created. Failed associations contain an ``errors`` object.

- `list of TagCollectionsResourcesPutResponsesContentApplicationJsonSchemaItems`

## Errors

### 400 Bad Request Error

The Autodesk Schema Registry was not able to decipher your request. Check the request body for malformed request syntax or invalid request message framing before you try again.

- `type` (string, optional) — UTF-8 encoded string
- `title` (string, optional) — UTF-8 encoded string
- `detail` (string, optional) — User-friendly error message.
- `errors` (list of ErrorDetail, optional) — This property will contains relevant error details.

### 401 Unauthorized Error

The request did not have a valid access token. Obtain a fresh access token and try again.

- `type` (string, optional) — UTF-8 encoded string
- `title` (string, optional) — UTF-8 encoded string
- `detail` (string, optional) — User-friendly error message.
- `errors` (list of ErrorDetail, optional) — This property will contains relevant error details.

### 403 Forbidden Error

You do not have permission to perform the operation specified by the request. Contact your LIBRARY_ADMIN and resolve any permission issues before trying this request again.

- `type` (string, optional) — UTF-8 encoded string
- `title` (string, optional) — UTF-8 encoded string
- `detail` (string, optional) — User-friendly error message.
- `errors` (list of ErrorDetail, optional) — This property will contains relevant error details.

### 404 Not Found Error

The requested resource was not found. Verify that the details of the resource you requested are correct before you try again.

- `type` (string, optional) — UTF-8 encoded string
- `title` (string, optional) — UTF-8 encoded string
- `detail` (string, optional) — User-friendly error message.
- `errors` (list of ErrorDetail, optional) — This property will contains relevant error details.

### 429 Too Many Requests Error

You have exceeded the Rate Limit for the requested resource. Check the ``retry-after`` response header and send the request again, after the specified time period has elapsed.

- `type` (string, optional) — UTF-8 encoded string
- `title` (string, optional) — UTF-8 encoded string
- `detail` (string, optional) — User-friendly error message.
- `errors` (list of ErrorDetail, optional) — This property will contains relevant error details.

## Types

### TagCollectionsResourcesPutRequestBodyContentApplicationJsonSchemaTagsItems

- `tagCollectionId` (string, required) — Tha Tag Collection that the Tags specified by the ``TagIds`` attribute belong to. The Tag Collections you specify must belong to: 1. The same namespace as the schema, or 2. The company that the schema belongs to.
- `scope` (string, required) — Scope is for filtering purpose. Currently, it should be 'groupName' or 'groupName.libraryName'.
- `tagIds` (list of TagCollectionsResourcesPutRequestBodyContentApplicationJsonSchemaTagsItemsTagIdsItems, optional) — An array of Tag IDs. Each of these Tags will be associated with the schema specified by the ``resourceId`` attribute.

### TagCollectionsResourcesPutResponsesContentApplicationJsonSchemaItems

- `createTime` (string, optional) — A TimeISO 8601 Timestamp in UTC Timezone indicating when the association was created.
- `createdBy` (string, optional) — If a three-legged access token was used to create the association, contains the Autodesk ID (Oxygen ID) of the person who associated the Tag to the schema. If a two-legged access token was used to create the category, contains the Client ID of the app that associated it.
- `errors` (list of ErrorDetail, optional) — An object containing the details of any errors that occured while creating the association.
- `lastModifiedBy` (string, optional) — If a three-legged access token was used to modify the association, contains the Autodesk ID (Oxygen ID) of the person who associated the Tag to the schema. If a two-legged access token was used to create the category, contains the Client ID of the app that associated it.
- `lastModifiedTime` (string, optional) — A TimeISO 8601 Timestamp in UTC Timezone indicating when the category was last modified.
- `resourceId` (string, optional) — he ID of the schema associated with Tags.
- `tags` (list of TagResourcecReplaceTagsItems, optional) — An array containing the Tags the schema is associated with.

### ErrorDetail

Error response model according to the APS standard

- `type` (string, optional) — Specifies the type of the error that occured.
- `title` (string, optional) — Contains a summary of the error.
- `detail` (string, optional) — Contains a detailed description of the error that occured, and sometimes, tips on how to fix the error.

### TagCollectionsResourcesPutRequestBodyContentApplicationJsonSchemaTagsItemsTagIdsItems

### TagResourcecReplaceTagsItems

- `scope` (string, required) — Scope is for filtering purpose. Currently, it should be 'groupName' or 'groupName.libraryName'.
- `tagCollectionId` (string, optional) — The Tag Collection the Tags belong to.
- `tagIds` (list of string, optional) — The IDs of the Tags associated with the schema.

## Examples

### Standard

**Request**

```json
{
  "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
  "tags": [
    {
      "tagCollectionId": "acme.civilengineering",
      "scope": "acme.civilengineering.structures"
    },
    {
      "tagCollectionId": "acme.materials",
      "scope": "acme.materials.library"
    }
  ]
}
```

**Response**

```json
[
  {
    "errors": [
      {
        "title": "Bad Request",
        "detail": "The tag id must not be empty.",
        "id": "2",
        "code": "400"
      }
    ]
  }
]
```

**SDK Code**

```python Standard
import requests

url = "https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources"

payload = {
    "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
    "tags": [
        {
            "tagCollectionId": "acme.civilengineering",
            "scope": "acme.civilengineering.structures"
        },
        {
            "tagCollectionId": "acme.materials",
            "scope": "acme.materials.library"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Standard
const url = 'https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"resourceId":"propertySets:acme.civilengineering:bridge-2.1.0","tags":[{"tagCollectionId":"acme.civilengineering","scope":"acme.civilengineering.structures"},{"tagCollectionId":"acme.materials","scope":"acme.materials.library"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Standard
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources"

	payload := strings.NewReader("{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Standard
require 'uri'
require 'net/http'

url = URI("https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Standard
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}")
  .asString();
```

```php Standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources', [
  'body' => '{
  "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
  "tags": [
    {
      "tagCollectionId": "acme.civilengineering",
      "scope": "acme.civilengineering.structures"
    },
    {
      "tagCollectionId": "acme.materials",
      "scope": "acme.materials.library"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Standard
using RestSharp;

var client = new RestClient("https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
  "tags": [
    [
      "tagCollectionId": "acme.civilengineering",
      "scope": "acme.civilengineering.structures"
    ],
    [
      "tagCollectionId": "acme.materials",
      "scope": "acme.materials.library"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Attach Invalid Tag To Resources (resulted in HTTP 400)

**Request**

```json
{
  "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
  "tags": [
    {
      "tagCollectionId": "acme.civilengineering",
      "scope": "acme.civilengineering.structures"
    },
    {
      "tagCollectionId": "acme.materials",
      "scope": "acme.materials.library"
    }
  ]
}
```

**Response**

```json
[
  {
    "errors": [
      {
        "title": "Bad Request",
        "detail": "The tag id must not be empty.",
        "id": "2",
        "code": "400"
      }
    ]
  }
]
```

**SDK Code**

```python Attach Invalid Tag To Resources (resulted in HTTP 400)
import requests

url = "https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources"

payload = {
    "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
    "tags": [
        {
            "tagCollectionId": "acme.civilengineering",
            "scope": "acme.civilengineering.structures"
        },
        {
            "tagCollectionId": "acme.materials",
            "scope": "acme.materials.library"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Attach Invalid Tag To Resources (resulted in HTTP 400)
const url = 'https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"resourceId":"propertySets:acme.civilengineering:bridge-2.1.0","tags":[{"tagCollectionId":"acme.civilengineering","scope":"acme.civilengineering.structures"},{"tagCollectionId":"acme.materials","scope":"acme.materials.library"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Attach Invalid Tag To Resources (resulted in HTTP 400)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources"

	payload := strings.NewReader("{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Attach Invalid Tag To Resources (resulted in HTTP 400)
require 'uri'
require 'net/http'

url = URI("https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Attach Invalid Tag To Resources (resulted in HTTP 400)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}")
  .asString();
```

```php Attach Invalid Tag To Resources (resulted in HTTP 400)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources', [
  'body' => '{
  "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
  "tags": [
    {
      "tagCollectionId": "acme.civilengineering",
      "scope": "acme.civilengineering.structures"
    },
    {
      "tagCollectionId": "acme.materials",
      "scope": "acme.materials.library"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Attach Invalid Tag To Resources (resulted in HTTP 400)
using RestSharp;

var client = new RestClient("https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"resourceId\": \"propertySets:acme.civilengineering:bridge-2.1.0\",\n  \"tags\": [\n    {\n      \"tagCollectionId\": \"acme.civilengineering\",\n      \"scope\": \"acme.civilengineering.structures\"\n    },\n    {\n      \"tagCollectionId\": \"acme.materials\",\n      \"scope\": \"acme.materials.library\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Attach Invalid Tag To Resources (resulted in HTTP 400)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "resourceId": "propertySets:acme.civilengineering:bridge-2.1.0",
  "tags": [
    [
      "tagCollectionId": "acme.civilengineering",
      "scope": "acme.civilengineering.structures"
    ],
    [
      "tagCollectionId": "acme.materials",
      "scope": "acme.materials.library"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://developer-dev.api.autodesk.com/schema/v2/tag-collections/resources")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```