Skip to main content
POST
/
3d
/
models
/
{modelId}
/
revisions
/
{revisionId}
/
mappings
JavaScript SDK
const assetMappingsToCreate = [
 {
   nodeId: 8252999965991682,
   assetId: 4354399876978078
 },
 {
   nodeId: 9034285498543958,
   assetId: 1042345809544395
 }
];
const mappings3D = await client.assetMappings3D.create(
 25432542356436,
 33485743958747,
 assetMappingsToCreate
);
from cognite.client.data_classes import ThreeDAssetMappingWrite
my_mapping = ThreeDAssetMappingWrite(node_id=1, asset_id=1)
res = client.three_d.asset_mappings.create(model_id=1, revision_id=1, asset_mapping=my_mapping)
List<ThreeDAssetMapping> items = List.of(ThreeDAssetMapping.newBuilder() 
.setAssetId(1L)
.setNodeId(1L)
.build());

List<ThreeDAssetMapping> listCreated = client.threeD()
.models()
.revisions()
.assetMappings()
.create(model.getId(), revision.getId(), items);
curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/3d/models/{modelId}/revisions/{revisionId}/mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"nodeId": 1003,
"assetId": 3001
}
]
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{cluster}.cognitedata.com/api/v1/projects/{project}/3d/models/{modelId}/revisions/{revisionId}/mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'nodeId' => 1003,
'assetId' => 3001
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://{cluster}.cognitedata.com/api/v1/projects/{project}/3d/models/{modelId}/revisions/{revisionId}/mappings"

payload := strings.NewReader("{\n \"items\": [\n {\n \"nodeId\": 1003,\n \"assetId\": 3001\n }\n ]\n}")

req, _ := http.NewRequest("POST", 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(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://{cluster}.cognitedata.com/api/v1/projects/{project}/3d/models/{modelId}/revisions/{revisionId}/mappings")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"nodeId\": 1003,\n \"assetId\": 3001\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "nodeId": 1003,
      "assetId": 3001,
      "assetInstanceId": {
        "space": "<string>",
        "externalId": "<string>"
      },
      "treeIndex": 3,
      "subtreeSize": 4
    }
  ]
}
{
"error": {
"code": 401,
"message": "Could not authenticate.",
"missing": [
{}
],
"duplicated": [
{}
]
}
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Path Parameters

modelId
integer<int64>
required

Model ID.

revisionId
integer<int64>
required

Revision ID.

Body

application/json

The asset mappings to create.

items
object[]
required
Required array length: 1 - 1000 elements

Response

A list of created asset mappings.

items
object[]
required
Last modified on July 10, 2026