Request

Response

    POST

    modeldata/{modelID}/mutate

    Bulk update of properties for multiple elements and attributes at the same time (matching specified query). The scope of mutation is always one model.

    Resource Information

    Method and URI
    POST
    https://developer.api.autodesk.com/tandem/v1/modeldata/{modelID}/mutate
    Authentication Context
    user context optional
    Required OAuth Scopes
    data:write
    Data Format
    JSON

    Request

    Headers

    Authorization*
    string
    Must be Bearer <token>, where <token> is obtained via either a two-legged or three-legged OAuth flow.
    Region
    string
    Specifies the region where your request should be routed. Possible values: US, EMEA. For more details, see Regions.
    Content-Type*
    string
    Must be application/json
    * Required

    Request

    URI Parameters

    modelID
    string
    Model URN you want to update elements for

    Request

    Body Structure

    A mutation description

    Expand all
    correlationId
    string
    Optional correlation ID for the operation - useful for cases when a change spans across multiple mutation calls (e.g. multi-model operations).
    desc
    string
    Logical context the update was made in.
    keys
    array: string
    Keys, affected by the mutation.
    muts
    array: object
    Actual changes to be applied ([“operation type”, “family”, “attribute id”, “new value”]). Supported operations are “i” (upsert), “c” (upsert if different), “d” (delete - sets column value to nil), “a” (delete row - deletes entire row).
    column
    string
    family
    string
    op
    string
    value
    object

    Response

    HTTP Status Code Summary

    200
    OK
    OK
    400
    Bad Request
    The service was unable to process the request. The syntax of the request may be malformed or the request may be missing a required header. Do not resend the request without fixing the issue. The response body may indicate what is wrong with the request.
    403
    Forbidden
    The request was successfully validated but it did not have the required permissions.

    Response

    Body Structure (200)

    timestamp
    int
    timestamp of when exactly change was applied

    Example 1

    Update the property “Common | Name” to a new value on a single element (n:!n is well-known qualified property override for Name).

    curl -v 'https://developer.api.autodesk.com/api/v1/modeldata/urn:adsk.dtm:k5ZZZkIYQ9ixvxFDVBNoTg/mutate' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsIm....' \
      -H 'Content-Type: application/json' \
      -d '{
          "keys": [
              "AAAAAK4nDhMSMkSMk5Htf-PTpSoAA_lk"
          ],
          "muts": [
              [
                  "i",
                  "n",
                  "!n",
                  "RandomName_113"
              ]
          ],
          "desc": "Updated from Postman"
      }'
    
    Show More

    Response

    {
      "timestamp": 1697492814232
    }
    

    Example 2

    Update the same user-defined property on multiple elements. Number of muts must match number of keys.

    curl -v 'https://developer.api.autodesk.com/api/v1/modeldata/urn:adsk.dtm:k5ZZZkIYQ9ixvxFDVBNoTg/mutate' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsIm....' \
      -H 'Content-Type: application/json' \
      -d '{
            "keys": [
                "AAAAAATEUWm2ZEeev3txuY9_YQsAA_sz",
                "AAAAAK4nDhMSMkSMk5Htf-PTpSoAA_lk"
            ],
            "muts": [
                [
                    "i",
                    "z",
                    "zAc",
                    "New string value A"
                ],
                [
                    "i",
                    "z",
                    "zAc",
                    "New string value B"
                ]
            ],
            "desc": "Updated from Postman"
        }'
    
    Show More

    Response

    {
      "timestamp": 1697492814232
    }
    

    Example 3

    Update multiple properties, same element. Number of muts must match number of keys.

    curl -v 'https://developer.api.autodesk.com/api/v1/modeldata/urn:adsk.dtm:k5ZZZkIYQ9ixvxFDVBNoTg/mutate' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsIm....' \
      -H 'Content-Type: application/json' \
      -d '{
            "keys": [
                "AAAAAK4nDhMSMkSMk5Htf-PTpSoAA_lk",
                "AAAAAK4nDhMSMkSMk5Htf-PTpSoAA_lk"
            ],
            "muts": [
                [
                    "i",
                    "z",
                    "zAc",
                    "New string value A"
                ],
                [
                    "i",
                    "z",
                    "zQc",
                    9876.99
                ]
            ],
            "desc": "Updated from Postman"
        }'
    
    Show More

    Response

    {
      "timestamp": 1697492814232
    }
    

    Example 4

    Add a Classification (n:!v is well-known qualified property override for Classification).

    curl -v 'https://developer.api.autodesk.com/api/v1/modeldata/urn:adsk.dtm:k5ZZZkIYQ9ixvxFDVBNoTg/mutate' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsIm....' \
      -H 'Content-Type: application/json' \
      -d '{
            "keys": [
                "AAAAAKljBWwVbUezt0cIIJETKaAAA9pl"
            ],
            "muts": [
                [
                    "i",
                    "n",
                    "!v",
                    "03 00 00"
                ]
            ]
        }'
    
    Show More

    Response

    {
      "timestamp": 1697492814232
    }
    

    Example 5

    Delete a property from a given element.

    curl -v 'https://developer.api.autodesk.com/api/v1/modeldata/urn:adsk.dtm:k5ZZZkIYQ9ixvxFDVBNoTg/mutate' \
      -X 'POST' \
      -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsIm....' \
      -H 'Content-Type: application/json' \
      -d '{
            "keys": [
                "AAAAACSELi_hCUJBrw7O42GpkVgABEnp"
            ],
            "muts": [
                [
                    "d",
                    "z",
                    "zQc"
                ]
            ],
            "desc": "Updated from Postman"
        }'
    
    Show More

    Response

    {
      "timestamp": 1697492814232
    }