MENU navbar-image
API V2

Introduction

Welcome to our API v2 documentation!

This documentation describes the usage of the Rapidcompact API endpoints which enable the upload of base assets, the optimization of a base asset and the download of the optimized rapid model.

Coming from v1? Here is our migration guide from v1 to v2.

You can still find API v1 here.

Terminology:

Cloud UI REST API
Source Model Base Asset, RawModel
Optimized Model RapidModel

Base URL

https://api.rapidcompact.com

Authenticating requests

This API is authenticated by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can create your API token here.
Our REST API, excluding upload related endpoints, is subject to rate limits (2000 requests per minute per User or IP)

API Tokens

Get Tokens

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/user/tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/tokens'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


[
	{
		"id": 222,
		"name": "name of api token",
		"last_used_at": "2021-09-01T11:21:22.000000Z",
		"created_at": "2021-09-01T10:26:57.000000Z",
		"optimization_count": 42,
	}
]
 

Request      

GET api/v2/user/tokens

Create Token

requires authentication

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/user/tokens/create" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"name of new api token\"
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/tokens/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "name of new api token"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/tokens/create'
payload = {
    "name": "name of new api token"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


234|y5NGBTJk5OX5Zva5RfxTz0GkXEL9axN79vTfsJOH
 

Request      

POST api/v2/user/tokens/create

Body Parameters

name  string  

The name of the API token

Delete Token

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/user/tokens/42" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/tokens/42"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/tokens/42'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Request      

DELETE api/v2/user/tokens/{id}

URL Parameters

id  integer  

The id of the API token

Get Token

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/user/tokens/42" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/tokens/42"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/tokens/42'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "id": 1,
    "tokenable_type": "App\\Models\\User",
    "tokenable_id": 45,
    "name": "name of api token",
    "abilities": [
        "*"
    ],
    "last_used_at": null,
    "created_at": "2021-10-26T10:38:07.000000Z",
    "updated_at": "2021-10-26T10:38:07.000000Z",
    "plain_text": ""
}
 

Request      

GET api/v2/user/tokens/{id}

URL Parameters

id  integer  

The id of the API token

Base Asset

Optimize

requires authentication

There are two ways to optimize a base asset:

In the first way send a config as a json object that complies with the API Optimize Schema, or send the id of one of your presets or of a factoryPreset

You can use our "optimization_finished" webhook to get notified when your model has been optimized. It also includes downloadlinks to your optimized model

The "Try it out" feature for this endpoint only works with the preset_id parameter. It doesn't work with the config parameter, because the config gets sent as a string, but it needs to be a json object. Please checkout the example on the right on how to set the config parameter

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/rawmodel/optimize/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"config\": {
        \"schema\": \"2.5\",
        \"limits\": {
            \"faces\": {
                \"count\": 30000
            },
            \"textures\": {
                \"baseColor\": 2048,
                \"emissive\": 2048,
                \"normal\": 2048,
                \"orm\": 2048
            }
        },
        \"assetSimplification\": {
            \"meshDecimation\": {
                \"method\": \"rebake\"
            },
            \"topologySettings\": {
                \"vertexMergingDistance\": 0.005,
                \"meshDensityEqualization\": 0,
                \"boundaryPreservationFactor\": 0.5
            },
            \"uvAndAtlasSettings\": {
                \"uvStretchTolerance\": 0
            },
            \"materialAndTextureBaking\": {
                \"bakingQuality\": \"medium\",
                \"bakeNormalMap\": true,
                \"bakeAOMap\": false
            }
        },
        \"compressionAndExport\": {
            \"fileExports\": [
                {
                    \"fileType\": \"glb\",
                    \"meshCompressionMethod\": \"none\",
                    \"customScaling\": 1,
                    \"textureFormat\": {
                        \"baseColor\": \"auto\",
                        \"emissive\": \"auto\",
                        \"normal\": \"png\",
                        \"orm\": \"auto\"
                    }
                }
            ]
        }
    },
    \"tags\": [
        \"Low-Poly\",
        \"MyTag\"
    ]
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/optimize/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    },
    "tags": [
        "Low-Poly",
        "MyTag"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/optimize/281'
payload = {
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    },
    "tags": [
        "Low-Poly",
        "MyTag"
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


{
    "id": 281,
    "name": "teapot.obj",
    "optimization_status": "sent_to_queue",
    "job_status": {
        "id": 518,
        "job_id": null,
        "type": "App\\Jobs\\ProcessRawModel",
        "queue": null,
        "attempts": 0,
        "progress_now": 0,
        "progress_max": 0,
        "status": "queued",
        "input": null,
        "output": null,
        "created_at": "2021-02-15T13:34:52.000000Z",
        "updated_at": "2021-02-15T13:34:52.000000Z",
        "started_at": null,
        "finished_at": null,
        "key": "rapid_model:624"
    },
    "progress": 0,
    "processing_step": "Scheduled for processing",
    "external": null,
    "rawmodel": {
        "id": 282,
        "name": "teapot.obj",
        "processing": true
    }
}
 

Request      

POST api/v2/rawmodel/optimize/{id}

URL Parameters

id  integer  

The id of the base asset

Body Parameters

config  object optional  

The config of the optimizer as a json object complying with the API Optimize Schema. Do not use config in combination with preset_id. They are mutually exclusive

preset_id  integer optional  

The id one of your presets or of a factoryPreset. Do not use preset_id in combination with config. They are mutually exclusive

tags  string[] optional  

A list of tags that will be added to the rapid model

Multi Optimize

requires authentication

Optimizes multiple models with one request

Use the same format as in the optimization endpoint but pass it in an array which contains the request as config (preset_id or config as json object) and the model_id of the base assets you want to process

Look at the example request for the data structure

You can use our "optimization_finished" webhook to get notified when your model has been optimized. It also includes download links to your optimized model

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/rawmodel/optimize" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"optimizations\": [
        {
            \"model_id\": 89,
            \"config\": {
                \"preset_id\": 2004,
                \"tags\": [
                    \"Lens Studio 3D\",
                    \"Medium Resolution\",
                    \"Low-Poly\"
                ],
                \"exportName\": \"calibrationTarget.glb\"
            }
        },
        {
            \"model_id\": 77,
            \"config\": {
                \"preset_id\": 2004,
                \"tags\": [
                    \"Lens Studio 3D\",
                    \"Medium Resolution\",
                    \"Mid-Poly\"
                ],
                \"exportName\": \"DamagedHelmet.glb\"
            }
        }
    ]
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/optimize"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "optimizations": [
        {
            "model_id": 89,
            "config": {
                "preset_id": 2004,
                "tags": [
                    "Lens Studio 3D",
                    "Medium Resolution",
                    "Low-Poly"
                ],
                "exportName": "calibrationTarget.glb"
            }
        },
        {
            "model_id": 77,
            "config": {
                "preset_id": 2004,
                "tags": [
                    "Lens Studio 3D",
                    "Medium Resolution",
                    "Mid-Poly"
                ],
                "exportName": "DamagedHelmet.glb"
            }
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/optimize'
payload = {
    "optimizations": [
        {
            "model_id": 89,
            "config": {
                "preset_id": 2004,
                "tags": [
                    "Lens Studio 3D",
                    "Medium Resolution",
                    "Low-Poly"
                ],
                "exportName": "calibrationTarget.glb"
            }
        },
        {
            "model_id": 77,
            "config": {
                "preset_id": 2004,
                "tags": [
                    "Lens Studio 3D",
                    "Medium Resolution",
                    "Mid-Poly"
                ],
                "exportName": "DamagedHelmet.glb"
            }
        }
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (204, success):

[Empty response]
 

Example response (400, error):


Could not process request: Missing required parameter
 

Example response (500, error):


An error occurred while processing your request: ...
 

Request      

POST api/v2/rawmodel/optimize

Body Parameters

optimizations  string[]  

The array containing the models and configurations you want to process

Get Running Jobs

requires authentication

Returns rapidmodels (until 1 week) that are still being processed or were not successfully optimized

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/jobs" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/jobs"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/jobs'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "data": [
        {
            "id": 5812,
            "name": "TVBench",
            "optimization_status": "failed",
            "job_status": {
                "id": 3601,
                "job_id": "edab51b2-1c47-4a0f-b807-58e913dbabc9",
                "type": "App\\Jobs\\ProcessRawModel",
                "queue": "default",
                "attempts": 1,
                "progress_now": 100,
                "progress_max": 100,
                "status": "finished",
                "input": null,
                "output": "{\"exit_code\":1}",
                "created_at": "2021-10-11 20:08:52",
                "updated_at": "2021-10-11 20:08:53",
                "started_at": "2021-10-11 20:08:52",
                "finished_at": "2021-10-11 20:08:53",
                "key": "rapid_model:5812"
            },
            "progress": 100,
            "processing_step": "Done",
            "external": false,
            "rawmodel": {
                "id": 2257,
                "name": "TVBench"
            }
        }
    ]
}
 

Request      

GET api/v2/rawmodel/jobs

Get Base Asset

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 281,
        "name": "teapot",
        "processing": false,
        "external": false,
        "upload_status": "complete",
        "size": 438680,
        "created_at": "2021-02-08T16:59:52+01:00",
        "rapid_models": [
            635,
            617
        ],
        "scale_factor": "10",
        "tags": [],
        "downloads": {
            "error.log": "signed url for the error.log",
            "info.log": "signed url for info.log",
            "metrics.json": "signed url for the metrics.json",
            "rpd_info.json": "signed url for the rpd_info.json",
            "teapot.obj": "signed url for the teapot.obj",
            "thumb.jpg": "signed url for the thumb.jpg"
        }
    }
}
 

Request      

GET api/v2/rawmodel/{id}

URL Parameters

id  integer  

The id of the base asset

Delete Base Asset

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/rawmodel/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200, success):



 

Request      

DELETE api/v2/rawmodel/{id}

URL Parameters

id  integer  

The id of the base asset

Get Download URLs

requires authentication

Returns a list of urls to download the individual base asset files

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/281/downloads" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281/downloads"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281/downloads'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "RezColorChecker.mtl": "https://s3.eu-central-1.amazonaws.com/rapidcompact-models-...",
    "RezColorChecker.obj": "https://s3.eu-central-1.amazonaws.com/rapidcompact-models-...",
    "RezColorChecker.png": "https://s3.eu-central-1.amazonaws.com/rapidcompact-models-..."
}
 

Request      

GET api/v2/rawmodel/{id}/downloads

URL Parameters

id  integer  

The id of the base asset

Get converted RapidPBR Files

requires authentication

Returns a list of urls to download the individual RapidPBR material and quality control files

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/281/downloads/pbr" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281/downloads/pbr"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281/downloads/pbr'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
 "materials" : {
    "ao.png":"https:\/\/s3.eu-central-1.amazonaws.com\/rapidcompact-models-...",
    "diffuse.png":"https:\/\/s3.eu-central-1.amazonaws.com\/rapidcompact-models-...",
  },
  "qc": {
    "render_0.png":"https:\/\/s3.eu-central-1.amazonaws.com\/rapidcompact-models-...",
    "render_1.png":"https:\/\/s3.eu-central-1.amazonaws.com\/rapidcompact-models-...",
    "diff_0.png":"https:\/\/s3.eu-central-1.amazonaws.com\/rapidcompact-models-...",
    "diff_1.png":"https:\/\/s3.eu-central-1.amazonaws.com\/rapidcompact-models-...",
  }
}
 

Request      

GET api/v2/rawmodel/{id}/downloads/pbr

URL Parameters

id  integer  

The id of the base asset

Download zip

requires authentication

Downloads all model files as zip.

A stream is returned which contains the model data.

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/281/downloads/zip" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281/downloads/zip"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281/downloads/zip'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


Streamed response
 

Request      

GET api/v2/rawmodel/{id}/downloads/zip

URL Parameters

id  integer  

The id of the base asset

Delete Tag of a Base Asset

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/rawmodel/281/tags/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281/tags/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281/tags/2'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Request      

DELETE api/v2/rawmodel/{id}/tags/{tagId}

URL Parameters

id  integer  

The id of the base asset

tagId  integer  

The id of the tag that will be deleted

Get Base Assets

requires authentication

Paginated response of your base assets. Search for base assets by name or tag

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel?q=yourSearchString" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel"
);

const params = {
    "q": "yourSearchString",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel'
params = {
  'q': 'yourSearchString',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, success):


{
    "data": [
        {
            "id": 1,
            "name": "teapot",
            "external": false,
            "upload_status": "complete",
            "size": 315088,
            "created_at": "2022-05-24T15:05:47+02:00",
            "scale_factor": "1",
            "has_errors": true,
            "format": "fbx",
            "tags": [
                {
                    "id": 1,
                    "name": "Low-Poly",
                    "created_at": "2022-05-24 15:06:03",
                    "updated_at": "2022-05-24 15:06:03",
                    "raw_id": 1
                }
            ],
            "downloads": {
                "error.log": "signed url for the error.log",
                "info.log": "signed url for info.log",
                "metrics.json": "signed url for the metrics.json",
                "rpd_info.json": "signed url for the rpd_info.json",
                "teapot.fbx": "signed url for the teapot.obj",
                "thumb.jpg": "signed url for the thumb.jpg",
                "warning.log": "signed url for the warning.log"
            }
        }
    ],
    "links": {
        "first": "https://url/api/v2/rawmodel?page=1",
        "last": "https://url/api/v2/rawmodel?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://url/api/v2/rawmodel?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://url/api/v2/rawmodel",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Request      

GET api/v2/rawmodel

Query Parameters

q  string optional  

Optional parameter to search for base assets by name or tag

Update Base Asset - Add Tags, Set scale factor

requires authentication

A tag can have 255 utf-8 characters including whitespaces

Example request:
curl --request PUT \
    "https://api.rapidcompact.com/api/v2/rawmodel/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"low poly\",
        \"mb target\"
    ],
    \"scale_factor\": 0.5
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "low poly",
        "mb target"
    ],
    "scale_factor": 0.5
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281'
payload = {
    "tags": [
        "low poly",
        "mb target"
    ],
    "scale_factor": 0.5
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Request      

PUT api/v2/rawmodel/{id}

URL Parameters

id  integer  

The id of the base asset

Body Parameters

tags  string[] optional  

A list of tags that will be added to the base asset

scale_factor  number optional  

The new scale factor that will be applied to the base asset

Delete Multiple Base Assets

requires authentication

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/rawmodel/delete" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ids\": [
        726,
        324
    ]
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ids": [
        726,
        324
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/delete'
payload = {
    "ids": [
        726,
        324
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v2/rawmodel/delete

Body Parameters

ids  integer[]  

An array of base asset ids that should be deleted

Create Base Asset - Get Upload Link

requires authentication

Calling this endpoint will return an id for the new base asset and presigned URLs which need to be used to upload the files directly to our storage. The URLs are unique for every file. The "complete_upload" field will contain a link to the "Create Base Asset - Complete Upload" endpoint that needs to be called when the upload is done

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/rawmodel/api-upload/start" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"model_name\": \"teapot\",
    \"filenames\": [
        \"mymodel.glb\",
        \"material.mat\"
    ]
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/api-upload/start"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "model_name": "teapot",
    "filenames": [
        "mymodel.glb",
        "material.mat"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/api-upload/start'
payload = {
    "model_name": "teapot",
    "filenames": [
        "mymodel.glb",
        "material.mat"
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


{
    "id": 1,
    "links": {
        "s3_upload_urls": {
            "mymodel.glb": "signed url for mymodel.glb",
            "material.mat": "signed url for material.mat"
        },
        "complete_upload": "https://api.rapidcompact.com/api/rawmodels/1/api-upload/complete"
    }
}
 

Request      

POST api/v2/rawmodel/api-upload/start

Body Parameters

model_name  string  

The name of the base asset

filenames  string[]  

The names of the files to be uploaded

is_zip  boolean optional  

Indicate if the file is a zip

Create Base Asset - Complete Upload

requires authentication

Call this endpoint with the received base asset id from the "Create Base Asset - Get Upload Link" endpoint after uploading the base asset files

You can use our "analysis_finished" webhook to get notified when your model is ready to be optimized

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/281/api-upload/complete" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281/api-upload/complete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281/api-upload/complete'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 281,
        "name": "teapot",
        "processing": false,
        "upload_status": "complete",
        "size": 438680,
        "created_at": "2021-02-08T16:59:52+01:00",
        "rapid_models": [
            635,
            617
        ],
        "scale_factor": "10",
        "downloads": {
            "error.log": "signed url for the error.log",
            "info.log": "signed url for the info.log",
            "metrics.json": "signed url for the metrics.json",
            "rpd_info.json": "signed url for the rpd_info.json",
            "teapot.obj": "signed url for the uploaded file",
            "thumb.jpg": "signed url for the thumb.jpg"
        }
    }
}
 

Request      

GET api/v2/rawmodel/{id}/api-upload/complete

URL Parameters

id  integer  

The id of base asset

Retries a failed import.

requires authentication

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/rawmodel/281/api-upload/retry" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/281/api-upload/retry"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/281/api-upload/retry'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request      

POST api/v2/rawmodel/{id}/api-upload/retry

URL Parameters

id  integer  

The id of the base asset

Get Rapid Models

requires authentication

Get all rapid models which were optimized from this base asset

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/1/rapidmodels" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/1/rapidmodels"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/1/rapidmodels'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
   "data": [
       {
           "id": 1,
           "name": "teapot",
           "optimization_status": "done",
           "rawmodel": {...},
           "job_status": {...},
           "created_at": "2021-02-16T16:50:41+01:00",
           "updated_at": "2021-02-16T16:50:53+01:00",
           "progress": 100,
           "processing_step": "Done",
           "external": false,
           "rapid_compact_core_version": "6.1.1",
           "tags": [],
           "export_name": "export name",
           "uuid": "d8316d1f-3c7d-4777-b72e-c760064f9d08",
           "accepted": false,
           "meta": {
               "size": 573420,
               "exportSize": 1029548
           },
           "thumbnail": {},
           "rpd_info": "signed url for the rpd_info.json",
           "rpd_warnings": "signed url for the warning.log",
           "rpd_error": "signed url for the error.log",
           "downloads": {
               "glb": "signed url for the .glb"
           }
       }
   ]
}
 

Request      

GET api/v2/rawmodel/{id}/rapidmodels

URL Parameters

id  integer  

The id of the base asset

Embeds

Get Embeds

requires authentication

Returns the embeds of the user

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/embeds?page=10&q=pariatur&rapidId=6" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/embeds"
);

const params = {
    "page": "10",
    "q": "pariatur",
    "rapidId": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/embeds'
params = {
  'page': '10',
  'q': 'pariatur',
  'rapidId': '6',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
  data: [
    {
      "id":53,
      "identifier":"fRoL5P9iyb",
      "name":"RezColorChecker Embed",
      "user_id":45,
      "model_id":70,
      "view_count":13,
      "created_at":"2022-05-04T12:10:52.000000Z",
      "updated_at":"2022-06-14T13:13:00.000000Z",
      "rapidModelId": 73,
      "rapidModelName":"RezColorChecker",
      "thumbnail":"https://2vv7ezymi86va.cloudfront.net/rapid/ba12f8a6-....",
      "url":"https://api.rapidcompact.com/viewer?id=123456"
    },
    ...
  ],
  links: {
    first: "http://...",
    last: "http://...",
    prev: null,
    next: "http://..."
  },
  meta: {
    "current_page":1,
    "from":1,
    "last_page":2,
    "per_page":10,
    "to":10,
    "total":15,
    links: [
      {
        "url":null,
        "label":"Previous",
        "active":false
      },
      ...
    ]
  }
}
 

Request      

GET api/v2/embeds

Query Parameters

page  integer optional  

Page number to fetch

q  string optional  

Search string to filter embeds by name

rapidId  integer optional  

Filter embeds by rapidmodel id

Get Embed

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/embeds/42" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/embeds/42"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/embeds/42'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "data": {
        "id": 42,
        "identifier": "ZmR8oTVEiR",
        "name": "teapot Embed",
        "user_id": 1,
        "model_id": 1,
        "view_count": 100,
        "created_at": "2022-06-27T13:30:30.000000Z",
        "updated_at": "2022-06-27T14:20:17.000000Z"
    }
}
 

Request      

GET api/v2/embeds/{id}

URL Parameters

id  integer  

The id of the embed

Create Embed

requires authentication

Create an embed from a rapid model. The webhooks will be called with the 'embed_creation' event to notify the user as soon as the embed is created.

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/embeds/create" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"model_id\": 281,
    \"name\": \"\\\"my embeds name\\\"\",
    \"save_user_theme\": false,
    \"config\": \"{\\n     \\\"renderCanvasCSS\\\" : \\\"background:;\\\",\\n     \\\"environmentURL\\\" : \\\"images\\/environment.dds\\\",\\n     \\\"companyLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\\\",\\n     \\\"companyLogoToggle\\\" : \\\"true\\\",\\n     \\\"companyLink\\\" : \\\"https:\\/\\/dgg3d.com\\\",\\n     \\\"companyLogoCSS\\\" : \\\"width:120px;height:71.3004px;background:;\\\",\\n     \\\"productLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\\\",\\n     \\\"productLogoToggle\\\" : \\\"true\\\",\\n     \\\"productLink\\\" : \\\"https:\\/\\/rapidcompact.com\\\",\\n     \\\"productLogoCSS\\\" : \\\"width:120px;height:21.4819px;background:;\\\",\\n     \\\"threeDLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\\\",\\n     \\\"threeDLogoToggle\\\" : \\\"true\\\",\\n     \\\"threeDLogoCSS\\\" : \\\"width:24px;height:24px;background:;\\\",\\n     \\\"interactiveToolsCSS\\\" : \\\"background:;\\\",\\n     \\\"skyBoxEnabled\\\" : \\\"false\\\",\\n     \\\"skyBoxBlur\\\" : \\\"0\\\",\\n     \\\"shadowToggle\\\" : \\\"false\\\",\\n     \\\"shadowOpacity\\\" : \\\"0.5\\\",\\n     \\\"shadowBlur\\\" : \\\"0\\\",\\n     \\\"shadowLightIntensity\\\" : \\\"0.3\\\",\\n     \\\"cameraMinVerticalAngle\\\" : \\\"-90\\\",\\n     \\\"cameraMaxVerticalAngle\\\" : \\\"90\\\",\\n     \\\"cameraMinZoom\\\" : \\\"1\\\",\\n     \\\"cameraMaxZoom\\\" : \\\"6\\\",\\n     \\\"cameraPanning\\\" : \\\"0.5\\\",\\n     \\\"cameraBloom\\\" : \\\"0\\\",\\n     \\\"cameraContrast\\\" : \\\"1\\\",\\n     \\\"cameraExposure\\\" : \\\"1\\\",\\n     \\\"fxaaOn\\\" : \\\"true\\\",\\n     \\\"enableSimpleMeasurement\\\" : \\\"false\\\",\\n     \\\"enableCoordinateDisplay\\\" : \\\"false\\\",\\n     \\\"baseUnit\\\" : \\\"m\\\",\\n     \\\"displayUnit\\\" : \\\"m\\\",\\n     \\\"enableARBtn\\\" : \\\"false\\\",\\n     \\\"enableAnimationControl\\\" : \\\"false\\\",\\n     \\\"animationSpeed\\\" : \\\"1\\\",\\n     \\\"animationIdleTime\\\" : \\\"5\\\",\\n     \\\"backgroundIsGradient\\\" : \\\"false\\\",\\n     \\\"backgroundIsColor\\\" : \\\"false\\\",\\n     \\\"gradientBackgroundColor1\\\" : \\\"#ffffff\\\",\\n     \\\"gradientBackgroundColor2\\\" : \\\"#aaaaaa\\\",\\n     \\\"plainBackgroundColor\\\" : \\\"#ffffff\\\",\\n     \\\"environmentName\\\" : \\\"studio_small\\\",\\n     \\\"baseUnits\\\" : \\\"m,cm,mm,yd,ft,in\\\",\\n     \\\"displayUnits\\\" : \\\"m,cm,mm,yd,ft,in\\\"\\n}\"
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/embeds/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "model_id": 281,
    "name": "\"my embeds name\"",
    "save_user_theme": false,
    "config": "{\n     \"renderCanvasCSS\" : \"background:;\",\n     \"environmentURL\" : \"images\/environment.dds\",\n     \"companyLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\",\n     \"companyLogoToggle\" : \"true\",\n     \"companyLink\" : \"https:\/\/dgg3d.com\",\n     \"companyLogoCSS\" : \"width:120px;height:71.3004px;background:;\",\n     \"productLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\",\n     \"productLogoToggle\" : \"true\",\n     \"productLink\" : \"https:\/\/rapidcompact.com\",\n     \"productLogoCSS\" : \"width:120px;height:21.4819px;background:;\",\n     \"threeDLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\",\n     \"threeDLogoToggle\" : \"true\",\n     \"threeDLogoCSS\" : \"width:24px;height:24px;background:;\",\n     \"interactiveToolsCSS\" : \"background:;\",\n     \"skyBoxEnabled\" : \"false\",\n     \"skyBoxBlur\" : \"0\",\n     \"shadowToggle\" : \"false\",\n     \"shadowOpacity\" : \"0.5\",\n     \"shadowBlur\" : \"0\",\n     \"shadowLightIntensity\" : \"0.3\",\n     \"cameraMinVerticalAngle\" : \"-90\",\n     \"cameraMaxVerticalAngle\" : \"90\",\n     \"cameraMinZoom\" : \"1\",\n     \"cameraMaxZoom\" : \"6\",\n     \"cameraPanning\" : \"0.5\",\n     \"cameraBloom\" : \"0\",\n     \"cameraContrast\" : \"1\",\n     \"cameraExposure\" : \"1\",\n     \"fxaaOn\" : \"true\",\n     \"enableSimpleMeasurement\" : \"false\",\n     \"enableCoordinateDisplay\" : \"false\",\n     \"baseUnit\" : \"m\",\n     \"displayUnit\" : \"m\",\n     \"enableARBtn\" : \"false\",\n     \"enableAnimationControl\" : \"false\",\n     \"animationSpeed\" : \"1\",\n     \"animationIdleTime\" : \"5\",\n     \"backgroundIsGradient\" : \"false\",\n     \"backgroundIsColor\" : \"false\",\n     \"gradientBackgroundColor1\" : \"#ffffff\",\n     \"gradientBackgroundColor2\" : \"#aaaaaa\",\n     \"plainBackgroundColor\" : \"#ffffff\",\n     \"environmentName\" : \"studio_small\",\n     \"baseUnits\" : \"m,cm,mm,yd,ft,in\",\n     \"displayUnits\" : \"m,cm,mm,yd,ft,in\"\n}"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/embeds/create'
payload = {
    "model_id": 281,
    "name": "\"my embeds name\"",
    "save_user_theme": false,
    "config": "{\n     \"renderCanvasCSS\" : \"background:;\",\n     \"environmentURL\" : \"images\/environment.dds\",\n     \"companyLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\",\n     \"companyLogoToggle\" : \"true\",\n     \"companyLink\" : \"https:\/\/dgg3d.com\",\n     \"companyLogoCSS\" : \"width:120px;height:71.3004px;background:;\",\n     \"productLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\",\n     \"productLogoToggle\" : \"true\",\n     \"productLink\" : \"https:\/\/rapidcompact.com\",\n     \"productLogoCSS\" : \"width:120px;height:21.4819px;background:;\",\n     \"threeDLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\",\n     \"threeDLogoToggle\" : \"true\",\n     \"threeDLogoCSS\" : \"width:24px;height:24px;background:;\",\n     \"interactiveToolsCSS\" : \"background:;\",\n     \"skyBoxEnabled\" : \"false\",\n     \"skyBoxBlur\" : \"0\",\n     \"shadowToggle\" : \"false\",\n     \"shadowOpacity\" : \"0.5\",\n     \"shadowBlur\" : \"0\",\n     \"shadowLightIntensity\" : \"0.3\",\n     \"cameraMinVerticalAngle\" : \"-90\",\n     \"cameraMaxVerticalAngle\" : \"90\",\n     \"cameraMinZoom\" : \"1\",\n     \"cameraMaxZoom\" : \"6\",\n     \"cameraPanning\" : \"0.5\",\n     \"cameraBloom\" : \"0\",\n     \"cameraContrast\" : \"1\",\n     \"cameraExposure\" : \"1\",\n     \"fxaaOn\" : \"true\",\n     \"enableSimpleMeasurement\" : \"false\",\n     \"enableCoordinateDisplay\" : \"false\",\n     \"baseUnit\" : \"m\",\n     \"displayUnit\" : \"m\",\n     \"enableARBtn\" : \"false\",\n     \"enableAnimationControl\" : \"false\",\n     \"animationSpeed\" : \"1\",\n     \"animationIdleTime\" : \"5\",\n     \"backgroundIsGradient\" : \"false\",\n     \"backgroundIsColor\" : \"false\",\n     \"gradientBackgroundColor1\" : \"#ffffff\",\n     \"gradientBackgroundColor2\" : \"#aaaaaa\",\n     \"plainBackgroundColor\" : \"#ffffff\",\n     \"environmentName\" : \"studio_small\",\n     \"baseUnits\" : \"m,cm,mm,yd,ft,in\",\n     \"displayUnits\" : \"m,cm,mm,yd,ft,in\"\n}"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201, success):


{
   'status': 'Successful',
   'message': 'Embed created successfully.',
   'rapidmodel_id': 31,
   'embed_id': 513,
   'embed_url': 'http://api.rapidcompact.com/viewer?id=iKlCoxprxK',
}
 

Request      

POST api/v2/embeds/create

Body Parameters

model_id  integer  

The id of the rapid model

name  string  

The name of your embed

save_user_theme  boolean optional  

Saves the configurator config

config  string optional  

The viewer configuration. Must be a valid JSON string

Delete Embed

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/embeds/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/embeds/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/embeds/281'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

[Empty response]
 

Request      

DELETE api/v2/embeds/{id}

URL Parameters

id  integer  

The id of the embed

Create Embed from Base Asset

requires authentication

Create an embed from a base asset. The base asset must be in the .glb file format. The webhooks will be called with the 'embed_from_raw_creation' event to notify the user as soon as the embed is created

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/embeds/raw" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"raw_model_id\": 281,
    \"name\": \"\\\"my embeds name\\\"\",
    \"save_user_theme\": true,
    \"config\": \"{\\n     \\\"renderCanvasCSS\\\" : \\\"background:;\\\",\\n     \\\"environmentURL\\\" : \\\"images\\/environment.dds\\\",\\n     \\\"companyLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\\\",\\n     \\\"companyLogoToggle\\\" : \\\"true\\\",\\n     \\\"companyLink\\\" : \\\"https:\\/\\/dgg3d.com\\\",\\n     \\\"companyLogoCSS\\\" : \\\"width:120px;height:71.3004px;background:;\\\",\\n     \\\"productLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\\\",\\n     \\\"productLogoToggle\\\" : \\\"true\\\",\\n     \\\"productLink\\\" : \\\"https:\\/\\/rapidcompact.com\\\",\\n     \\\"productLogoCSS\\\" : \\\"width:120px;height:21.4819px;background:;\\\",\\n     \\\"threeDLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\\\",\\n     \\\"threeDLogoToggle\\\" : \\\"true\\\",\\n     \\\"threeDLogoCSS\\\" : \\\"width:24px;height:24px;background:;\\\",\\n     \\\"interactiveToolsCSS\\\" : \\\"background:;\\\",\\n     \\\"skyBoxEnabled\\\" : \\\"false\\\",\\n     \\\"skyBoxBlur\\\" : \\\"0\\\",\\n     \\\"shadowToggle\\\" : \\\"false\\\",\\n     \\\"shadowOpacity\\\" : \\\"0.5\\\",\\n     \\\"shadowBlur\\\" : \\\"0\\\",\\n     \\\"shadowLightIntensity\\\" : \\\"0.3\\\",\\n     \\\"cameraMinVerticalAngle\\\" : \\\"-90\\\",\\n     \\\"cameraMaxVerticalAngle\\\" : \\\"90\\\",\\n     \\\"cameraMinZoom\\\" : \\\"1\\\",\\n     \\\"cameraMaxZoom\\\" : \\\"6\\\",\\n     \\\"cameraPanning\\\" : \\\"0.5\\\",\\n     \\\"cameraBloom\\\" : \\\"0\\\",\\n     \\\"cameraContrast\\\" : \\\"1\\\",\\n     \\\"cameraExposure\\\" : \\\"1\\\",\\n     \\\"fxaaOn\\\" : \\\"true\\\",\\n     \\\"enableSimpleMeasurement\\\" : \\\"false\\\",\\n     \\\"enableCoordinateDisplay\\\" : \\\"false\\\",\\n     \\\"baseUnit\\\" : \\\"m\\\",\\n     \\\"displayUnit\\\" : \\\"m\\\",\\n     \\\"enableARBtn\\\" : \\\"false\\\",\\n     \\\"enableAnimationControl\\\" : \\\"false\\\",\\n     \\\"animationSpeed\\\" : \\\"1\\\",\\n     \\\"animationIdleTime\\\" : \\\"5\\\",\\n     \\\"backgroundIsGradient\\\" : \\\"false\\\",\\n     \\\"backgroundIsColor\\\" : \\\"false\\\",\\n     \\\"gradientBackgroundColor1\\\" : \\\"#ffffff\\\",\\n     \\\"gradientBackgroundColor2\\\" : \\\"#aaaaaa\\\",\\n     \\\"plainBackgroundColor\\\" : \\\"#ffffff\\\",\\n     \\\"environmentName\\\" : \\\"studio_small\\\",\\n     \\\"baseUnits\\\" : \\\"m,cm,mm,yd,ft,in\\\",\\n     \\\"displayUnits\\\" : \\\"m,cm,mm,yd,ft,in\\\"\\n}\"
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/embeds/raw"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "raw_model_id": 281,
    "name": "\"my embeds name\"",
    "save_user_theme": true,
    "config": "{\n     \"renderCanvasCSS\" : \"background:;\",\n     \"environmentURL\" : \"images\/environment.dds\",\n     \"companyLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\",\n     \"companyLogoToggle\" : \"true\",\n     \"companyLink\" : \"https:\/\/dgg3d.com\",\n     \"companyLogoCSS\" : \"width:120px;height:71.3004px;background:;\",\n     \"productLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\",\n     \"productLogoToggle\" : \"true\",\n     \"productLink\" : \"https:\/\/rapidcompact.com\",\n     \"productLogoCSS\" : \"width:120px;height:21.4819px;background:;\",\n     \"threeDLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\",\n     \"threeDLogoToggle\" : \"true\",\n     \"threeDLogoCSS\" : \"width:24px;height:24px;background:;\",\n     \"interactiveToolsCSS\" : \"background:;\",\n     \"skyBoxEnabled\" : \"false\",\n     \"skyBoxBlur\" : \"0\",\n     \"shadowToggle\" : \"false\",\n     \"shadowOpacity\" : \"0.5\",\n     \"shadowBlur\" : \"0\",\n     \"shadowLightIntensity\" : \"0.3\",\n     \"cameraMinVerticalAngle\" : \"-90\",\n     \"cameraMaxVerticalAngle\" : \"90\",\n     \"cameraMinZoom\" : \"1\",\n     \"cameraMaxZoom\" : \"6\",\n     \"cameraPanning\" : \"0.5\",\n     \"cameraBloom\" : \"0\",\n     \"cameraContrast\" : \"1\",\n     \"cameraExposure\" : \"1\",\n     \"fxaaOn\" : \"true\",\n     \"enableSimpleMeasurement\" : \"false\",\n     \"enableCoordinateDisplay\" : \"false\",\n     \"baseUnit\" : \"m\",\n     \"displayUnit\" : \"m\",\n     \"enableARBtn\" : \"false\",\n     \"enableAnimationControl\" : \"false\",\n     \"animationSpeed\" : \"1\",\n     \"animationIdleTime\" : \"5\",\n     \"backgroundIsGradient\" : \"false\",\n     \"backgroundIsColor\" : \"false\",\n     \"gradientBackgroundColor1\" : \"#ffffff\",\n     \"gradientBackgroundColor2\" : \"#aaaaaa\",\n     \"plainBackgroundColor\" : \"#ffffff\",\n     \"environmentName\" : \"studio_small\",\n     \"baseUnits\" : \"m,cm,mm,yd,ft,in\",\n     \"displayUnits\" : \"m,cm,mm,yd,ft,in\"\n}"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/embeds/raw'
payload = {
    "raw_model_id": 281,
    "name": "\"my embeds name\"",
    "save_user_theme": true,
    "config": "{\n     \"renderCanvasCSS\" : \"background:;\",\n     \"environmentURL\" : \"images\/environment.dds\",\n     \"companyLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\",\n     \"companyLogoToggle\" : \"true\",\n     \"companyLink\" : \"https:\/\/dgg3d.com\",\n     \"companyLogoCSS\" : \"width:120px;height:71.3004px;background:;\",\n     \"productLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\",\n     \"productLogoToggle\" : \"true\",\n     \"productLink\" : \"https:\/\/rapidcompact.com\",\n     \"productLogoCSS\" : \"width:120px;height:21.4819px;background:;\",\n     \"threeDLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\",\n     \"threeDLogoToggle\" : \"true\",\n     \"threeDLogoCSS\" : \"width:24px;height:24px;background:;\",\n     \"interactiveToolsCSS\" : \"background:;\",\n     \"skyBoxEnabled\" : \"false\",\n     \"skyBoxBlur\" : \"0\",\n     \"shadowToggle\" : \"false\",\n     \"shadowOpacity\" : \"0.5\",\n     \"shadowBlur\" : \"0\",\n     \"shadowLightIntensity\" : \"0.3\",\n     \"cameraMinVerticalAngle\" : \"-90\",\n     \"cameraMaxVerticalAngle\" : \"90\",\n     \"cameraMinZoom\" : \"1\",\n     \"cameraMaxZoom\" : \"6\",\n     \"cameraPanning\" : \"0.5\",\n     \"cameraBloom\" : \"0\",\n     \"cameraContrast\" : \"1\",\n     \"cameraExposure\" : \"1\",\n     \"fxaaOn\" : \"true\",\n     \"enableSimpleMeasurement\" : \"false\",\n     \"enableCoordinateDisplay\" : \"false\",\n     \"baseUnit\" : \"m\",\n     \"displayUnit\" : \"m\",\n     \"enableARBtn\" : \"false\",\n     \"enableAnimationControl\" : \"false\",\n     \"animationSpeed\" : \"1\",\n     \"animationIdleTime\" : \"5\",\n     \"backgroundIsGradient\" : \"false\",\n     \"backgroundIsColor\" : \"false\",\n     \"gradientBackgroundColor1\" : \"#ffffff\",\n     \"gradientBackgroundColor2\" : \"#aaaaaa\",\n     \"plainBackgroundColor\" : \"#ffffff\",\n     \"environmentName\" : \"studio_small\",\n     \"baseUnits\" : \"m,cm,mm,yd,ft,in\",\n     \"displayUnits\" : \"m,cm,mm,yd,ft,in\"\n}"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


{
 "message" : "Embed creation pending, wait for the webhook call",
 "embed_id": 513,
 "embed_url": 'http://api.rapidcompact.com/viewer?id=iKlCoxprxK',
}
 

Example response (422, no glb format):


{
    "message": "Raw model is not in the glb file format"
}
 

Request      

POST api/v2/embeds/raw

Body Parameters

raw_model_id  integer  

The id of the raw model

name  string  

The name of your embed

save_user_theme  boolean optional  

Saves the configurator config

config  string optional  

The viewer configuration. Must be a valid JSON string

Presets

Create Preset

requires authentication

The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/preset/create" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"name of the new preset\",
    \"description\": \"Optimizes for 20k faces and drops textures\",
    \"rapidCompactCoreVersion\": \"6.1.1\",
    \"config\": {
        \"schema\": \"2.5\",
        \"limits\": {
            \"faces\": {
                \"count\": 30000
            },
            \"textures\": {
                \"baseColor\": 2048,
                \"emissive\": 2048,
                \"normal\": 2048,
                \"orm\": 2048
            }
        },
        \"assetSimplification\": {
            \"meshDecimation\": {
                \"method\": \"rebake\"
            },
            \"topologySettings\": {
                \"vertexMergingDistance\": 0.005,
                \"meshDensityEqualization\": 0,
                \"boundaryPreservationFactor\": 0.5
            },
            \"uvAndAtlasSettings\": {
                \"uvStretchTolerance\": 0
            },
            \"materialAndTextureBaking\": {
                \"bakingQuality\": \"medium\",
                \"bakeNormalMap\": true,
                \"bakeAOMap\": false
            }
        },
        \"compressionAndExport\": {
            \"fileExports\": [
                {
                    \"fileType\": \"glb\",
                    \"meshCompressionMethod\": \"none\",
                    \"customScaling\": 1,
                    \"textureFormat\": {
                        \"baseColor\": \"auto\",
                        \"emissive\": \"auto\",
                        \"normal\": \"png\",
                        \"orm\": \"auto\"
                    }
                }
            ]
        }
    }
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "name of the new preset",
    "description": "Optimizes for 20k faces and drops textures",
    "rapidCompactCoreVersion": "6.1.1",
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/create'
payload = {
    "name": "name of the new preset",
    "description": "Optimizes for 20k faces and drops textures",
    "rapidCompactCoreVersion": "6.1.1",
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):



 

Request      

POST api/v2/preset/create

Body Parameters

name  string  

The name of the preset

description  string optional  

optional A short description of the preset

rapidCompactCoreVersion  string optional  

The minimum version of RapidCompact for the preset

config  object  

The config of the optimizer as a json object complying with the API Optimize Schema

Update Preset

requires authentication

The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side

Example request:
curl --request PATCH \
    "https://api.rapidcompact.com/api/v2/preset/update" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"id\": 42,
    \"name\": \"name of the new preset\",
    \"config\": {
        \"schema\": \"2.5\",
        \"limits\": {
            \"faces\": {
                \"count\": 30000
            },
            \"textures\": {
                \"baseColor\": 2048,
                \"emissive\": 2048,
                \"normal\": 2048,
                \"orm\": 2048
            }
        },
        \"assetSimplification\": {
            \"meshDecimation\": {
                \"method\": \"rebake\"
            },
            \"topologySettings\": {
                \"vertexMergingDistance\": 0.005,
                \"meshDensityEqualization\": 0,
                \"boundaryPreservationFactor\": 0.5
            },
            \"uvAndAtlasSettings\": {
                \"uvStretchTolerance\": 0
            },
            \"materialAndTextureBaking\": {
                \"bakingQuality\": \"medium\",
                \"bakeNormalMap\": true,
                \"bakeAOMap\": false
            }
        },
        \"compressionAndExport\": {
            \"fileExports\": [
                {
                    \"fileType\": \"glb\",
                    \"meshCompressionMethod\": \"none\",
                    \"customScaling\": 1,
                    \"textureFormat\": {
                        \"baseColor\": \"auto\",
                        \"emissive\": \"auto\",
                        \"normal\": \"png\",
                        \"orm\": \"auto\"
                    }
                }
            ]
        }
    }
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": 42,
    "name": "name of the new preset",
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    }
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/update'
payload = {
    "id": 42,
    "name": "name of the new preset",
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PATCH', url, headers=headers, json=payload)
response.json()

Example response (200, success):



 

Request      

PATCH api/v2/preset/update

Body Parameters

id  integer  

The id of the preset

name  string  

The name of the preset

config  object  

The config of the optimizer as a json object complying with the API Optimize Schema

Get all Factory Presets

requires authentication

Factory Presets are provided by RapidCompact

A factory presets describes a optimization setting for different applications e.g. Lens Studio, Game Engines (Unreal, Unity) and devices (e.g. Hololens). You can use the returned id when using the Optimize endpoint

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/preset/factory" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/factory"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/factory'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


[
  {
    "id": 1,
    "name": "Spark AR Low Res",
    "config": "{\"workflowSettings\":{\"targetMeshResolution\":{\"faceCount\":15000},\"targetTextureResolution\":{\"baseColor\":1024,\"emissive\":1024,\"normal\":1024,\"orm\":1024}},\"assetSimplification\":{\"meshDecimation\":{\"method\":\"rebake\"},\"topologySettings\":{\"vertexMergingDistance\":0.005,\"meshDensityEqualization\":0,\"boundaryPreservationFactor\":0.5},\"uvAndAtlasSettings\":{\"uvStretchTolerance\":0},\"materialAndTextureBaking\":{\"bakingQuality\":\"low\",\"bakeNormalMap\":true,\"bakeAOMap\":false}},\"compressionAndExport\":{\"fileExports\":[{\"fileType\":\"glb\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"jpg\",\"emissive\":\"jpg\",\"normal\":\"jpg\",\"orm\":\"jpg\"}}]}}"
  },
]
 

Request      

GET api/v2/preset/factory

Convert Preset

requires authentication

Convert a preset in API format to CLI format and CLI commands. The endpoint will return a zip file containing the requested files. The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/preset/rpdx" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"config\": {
        \"schema\": \"2.5\",
        \"limits\": {
            \"faces\": {
                \"count\": 30000
            },
            \"textures\": {
                \"baseColor\": 2048,
                \"emissive\": 2048,
                \"normal\": 2048,
                \"orm\": 2048
            }
        },
        \"assetSimplification\": {
            \"meshDecimation\": {
                \"method\": \"rebake\"
            },
            \"topologySettings\": {
                \"vertexMergingDistance\": 0.005,
                \"meshDensityEqualization\": 0,
                \"boundaryPreservationFactor\": 0.5
            },
            \"uvAndAtlasSettings\": {
                \"uvStretchTolerance\": 0
            },
            \"materialAndTextureBaking\": {
                \"bakingQuality\": \"medium\",
                \"bakeNormalMap\": true,
                \"bakeAOMap\": false
            }
        },
        \"compressionAndExport\": {
            \"fileExports\": [
                {
                    \"fileType\": \"glb\",
                    \"meshCompressionMethod\": \"none\",
                    \"customScaling\": 1,
                    \"textureFormat\": {
                        \"baseColor\": \"auto\",
                        \"emissive\": \"auto\",
                        \"normal\": \"png\",
                        \"orm\": \"auto\"
                    }
                }
            ]
        }
    }
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/rpdx"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/rpdx'
payload = {
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


<Zip File> Streamed Response
 

Request      

POST api/v2/preset/rpdx

Body Parameters

config  object  

The config of the optimizer in API format as a json object complying with the API Optimize Schema

Get Preset in CLI Format

requires authentication

The endpoint will return a zip file containing the requested files

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/preset/rpdx/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/rpdx/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/rpdx/281'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


<Zip File> Streamed Response
 

Request      

GET api/v2/preset/rpdx/{id}

URL Parameters

id  integer  

The id of the preset

Download Preset

requires authentication

Downloads a preset as zip file which contains both API and CLI formats.

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/preset/281/download" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/281/download"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/281/download'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


<Zip File> Streamed Response
 

Request      

GET api/v2/preset/{id}/download

URL Parameters

id  integer  

The id of the preset

Get Preset

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/preset/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/281'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "id": 11,
    "name": "preset 2",
    "config": {
        "schema": "2.5",
        "limits": {
            "faces": {
                "count": 30000
            },
            "textures": {
                "baseColor": 2048,
                "emissive": 2048,
                "normal": 2048,
                "orm": 2048
            }
        },
        "assetSimplification": {
            "meshDecimation": {
                "method": "rebake"
            },
            "topologySettings": {
                "vertexMergingDistance": 0.005,
                "meshDensityEqualization": 0,
                "boundaryPreservationFactor": 0.5
            },
            "uvAndAtlasSettings": {
                "uvStretchTolerance": 0
            },
            "materialAndTextureBaking": {
                "bakingQuality": "medium",
                "bakeNormalMap": true,
                "bakeAOMap": false
            }
        },
        "compressionAndExport": {
            "fileExports": [
                {
                    "fileType": "glb",
                    "meshCompressionMethod": "none",
                    "customScaling": 1,
                    "textureFormat": {
                        "baseColor": "auto",
                        "emissive": "auto",
                        "normal": "png",
                        "orm": "auto"
                    }
                }
            ]
        }
    },
    "rpdx_version": "6.1.1",
    "user_id": 328,
    "created_at": "2021-04-22T09:11:30.000000Z",
    "updated_at": "2021-04-22T09:11:30.000000Z"
}
 

Request      

GET api/v2/preset/{id}

URL Parameters

id  integer  

The id of the preset

Delete Preset

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/preset/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset/281'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200, success):



 

Request      

DELETE api/v2/preset/{id}

URL Parameters

id  integer  

The id of the preset

Get all Presets

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/preset" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/preset"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/preset'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


[
    {
        "id": 11,
        "name": "preset 2",
        "config": "{\"sceneManipulation\":{\"rotateZUp\":false,\"centerModel\":false,\"removeInvisibleGeometry\":false,\"discardAnimations\":false,\"removeSmallFeatures\":{\"removalPercentage\":0}},\"assetSimplification\":{\"meshDecimation\":{\"method\":\"rebake\"},\"topologySettings\":{\"vertexMergingDistance\":0.005,\"meshDensityEqualization\":0,\"boundaryPreservationFactor\":0.5,\"preserveTopology\":false},\"uvAndAtlasSettings\":{\"uvStretchTolerance\":0},\"materialAndTextureBaking\":{\"bakingQuality\":\"medium\",\"bakeNormalMap\":true,\"bakeAOMap\":true}},\"compressionAndExport\":{\"fileExports\":[{\"fileType\":\"glb\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}},{\"fileType\":\"usdz\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}},{\"fileType\":\"obj\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}}]},\"schema\":\"2.5\",\"limits\":{\"faces\":{\"percentage\":50},\"textures\":{\"baseColor\":2048,\"emissive\":2048,\"normal\":2048,\"orm\":2048}}}",
        "rpdx_version": "6.1.1",
        "user_id": 328,
        "created_at": "2023-01-22T09:11:30.000000Z",
        "updated_at": "2023-01-22T09:11:30.000000Z",
        "description": "",
        "meta": "{\"filename\": {\"useId\": false, \"useSuffix\": null, \"usePresetName\": false}}"
    }
]
 

Request      

GET api/v2/preset

Rapid Model

Get Rapid Models

requires authentication

Paginated response of your rapid models. Search for rapid models by name or tag

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rapidmodel?q=yourSearchString" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel"
);

const params = {
    "q": "yourSearchString",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel'
params = {
  'q': 'yourSearchString',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, success):


{
   "data": [
       {
           "id": 1,
           "name": "teapot ",
           "optimization_status": "done",
           "created_at": "2022-05-24T16:28:56+02:00",
           "updated_at": "2022-05-24T16:29:11+02:00",
           "processing_step": "Done",
           "external": false,
           "rapid_compact_core_version": "6.1.1",
           "tags": [
               {
                   "id": 1,
                   "name": "Low-Poly",
                   "created_at": "2022-05-24 15:06:03",
                   "updated_at": "2022-05-24 15:06:03",
                   "rapid_id": 1
               },
           ],
           "export_name": "teapot_1",
           "uuid": "f26cf299-c8df-4d4d-9eef-3f8e87d882b7",
           "accepted": false,
           "meta": {
               "size": 665168,
               "exportSize": 1495763
           },
           "origin": "",
           "optimization_formats": "[...]",
           "thumbnail": {
               "first": "signed url",
               "turntable": "signed url"
           },
           "model": {
               "rootUrl": "rootURL",
               "fileName": "fileName"
           },
           "rpd_info": "signed url",
           "rpd_warnings": "signed url",
           "downloads": {
               "usdz": "signed url",
               "glb": "signed url",
               "all": {
                   "rapid.glb": "signed url",
                   "rapid.usdz": "signed url"
               }
           }
       }
   ],
   "links": {
       "first": "https://url/api/v2/rapidmodel?page=1",
       "last": "https://url/api/v2/rapidmodel?page=1",
       "prev": null,
       "next": null
   },
   "meta": {
       "current_page": 1,
       "from": 1,
       "last_page": 1,
       "links": [
           {
               "url": null,
               "label": "&laquo; Previous",
               "active": false
           },
           {
               "url": "https://url/api/v2/rapidmodel?page=1",
               "label": "1",
               "active": true
           },
           {
               "url": null,
               "label": "Next &raquo;",
               "active": false
           }
       ],
       "path": "https://url/api/v2/rapidmodel",
       "per_page": 12,
       "to": 1,
       "total": 1
   }
}
 

Request      

GET api/v2/rapidmodel

Query Parameters

q  string optional  

Optional parameter to search for rapid models by name or tag

Get Rapid Model

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rapidmodel/635" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/635"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/635'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 635,
        "name": "teapot ",
        "optimization_status": "done",
        "created_at": "2021-02-16T16:50:41+01:00",
        "updated_at": "2021-02-16T16:50:53+01:00",
        "processing_step": "Done",
        "external": false,
        "rapid_compact_core_version": "6.1.1",
        "tags": [],
        "export_name": null,
        "uuid": "d8316d1f-3c7d-4777-b72e-c760064f9d08",
        "accepted": false,
        "meta": {
            "size": 573420,
            "exportSize": 1029548
        },
        "origin": "",
        "optimization_formats": "[...]",
        "thumbnail": {
            "first": "signed url for the thumbnail",
            "turntable": {
                "rapid.glb": "signed url for theturntable"
            }
        },
        "model": {
            "rootUrl": "s3 link",
            "fileName": "rapid.glb?signed"
        },
        "rpd_info": "signed url for rpd_info.json",
        "rpd_warnings": "signed url for the warning.log",
        "metrics": "signed url for the metrics.json",
        "downloads": {
            "glb": "signed url for the .glb",
            "all": {
                "rapid.glb": "signed url for the .glb"
            }
        }
    }
}
 

Request      

GET api/v2/rapidmodel/{id}

URL Parameters

id  integer  

The id of the rapid model

Delete Rapid Model

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/rapidmodel/635" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/635"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/635'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200, success):



 

Request      

DELETE api/v2/rapidmodel/{id}

URL Parameters

id  integer  

The id of the rapid model

Get Export Infos

requires authentication

Calling this endpoint return a list of links to download the exports and their respective infos

Please note that the export infos are generated only for glb and gltf formats

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rapidmodel/695/exports" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/695/exports"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/695/exports'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "rapid.glb": {
            "download": "signed s3 link to rapid.glb",
            "info": {
                "images": [
                    {
                        "channels": 3,
                        "compressedByteSize": 310996,
                        "height": 2048,
                        "mimetype": "image/jpeg",
                        "slot": "normal",
                        "width": 2048
                    }
                ]
            }
        },
        "rapid.usdz": {
            "download": "link to rapid.usdz",
            "info": null
        }
    }
}
 

Request      

GET api/v2/rapidmodel/{id}/exports

URL Parameters

id  integer  

The id of the rapid model

Delete Tag of a Rapid Model

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/rapidmodel/281/tags/2" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/281/tags/2"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/281/tags/2'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200, success):



 

Request      

DELETE api/v2/rapidmodel/{id}/tags/{tagId}

URL Parameters

id  integer  

The id of the base asset

tagId  integer  

The id of the tag that will be deleted

Add Tags to a Rapid Model

requires authentication

Example request:
curl --request PUT \
    "https://api.rapidcompact.com/api/v2/rapidmodel/281" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"chair\",
        \"brown\"
    ]
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/281"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "chair",
        "brown"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/281'
payload = {
    "tags": [
        "chair",
        "brown"
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200, success):



 

Request      

PUT api/v2/rapidmodel/{id}

URL Parameters

id  integer  

The id of the rapid model

Body Parameters

tags  string[]  

A list of tags that will be added to the rapid model

Download used Preset from Rapid Model

requires authentication

Downloads a preset as zip file which contains API and CLI formats

Only available for Rapidmodels that were optimized after 2023-03

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rapidmodel/281/download/preset" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/281/download/preset"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/281/download/preset'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


<Zip File> Streamed Response
 

Example response (404, error):


Only available for Rapidmodels that were optimized after 2023-03
 

Request      

GET api/v2/rapidmodel/{id}/download/preset

URL Parameters

id  integer  

The id of the preset

Delete Multiple Rapid Models

requires authentication

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/rapidmodel/delete" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ids\": [
        726,
        324
    ]
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ids": [
        726,
        324
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/delete'
payload = {
    "ids": [
        726,
        324
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):



 

Request      

POST api/v2/rapidmodel/delete

Body Parameters

ids  integer[]  

An array of rapid model ids that should be deleted

Tags

Get all Base Asset Tags

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rawmodel/tags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rawmodel/tags"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rawmodel/tags'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "data": [
        {
            "name": "My custom tag"
        },
        {
            "name": "Foo"
        },
        {
            "name": "Bar"
        }
    ]
}
 

Request      

GET api/v2/rawmodel/tags

Get all Rapid Model Tags

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/rapidmodel/tags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/rapidmodel/tags"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/rapidmodel/tags'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "data": [
        {
            "name": "5 MB"
        },
        {
            "name": "Medium Resolution"
        },
        {
            "name": "Low-scene complexity"
        }
    ]
}
 

Request      

GET api/v2/rapidmodel/tags

User

APIs for managing user profile.

Login

Returns a token that can be used for calling other endpoints

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"yourname@example.com\",
    \"password\": \"your password\"
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "yourname@example.com",
    "password": "your password"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/login'
payload = {
    "email": "yourname@example.com",
    "password": "your password"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v2/login

Body Parameters

email  string  

The email of the user

password  string  

The password of the user

Delete Account

requires authentication

Delete the user account and all the data associated with it

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/user/delete" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"password\": \"\\\"your password\\\"\"
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "password": "\"your password\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/delete'
payload = {
    "password": "\"your password\""
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):



 

Request      

POST api/v2/user/delete

Body Parameters

password  string  

The password of the user. The account will be deleted if it's correct

Get RapidPoints

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/user/rapidpoints" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/rapidpoints"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/rapidpoints'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "rapidpoints": 20
}
 

Request      

GET api/v2/user/rapidpoints

Get Storage Left

requires authentication

Returns how much storage you have left to use (bytes)

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/user/storage" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/storage"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/storage'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


{
    "storage_left": 107374182400
}
 

Request      

GET api/v2/user/storage

Webhooks

RapidCompact uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for upload and optimization events. Instead of polling the API to know the status of your upload or optimization, RapidCompact sends an event to your webhook.

Begin using webhooks with your RapidCompact integration in just three steps:

  1. Create a webhook endpoint on your server
  2. Register the endpoint with RapidCompact to go live
  3. Test your endpoint by clicking the test button in the webhooks page

What are webhooks

The webhook endpoint is just more code on your server, which could be written in Ruby, PHP, Node.js, or whatever. The webhook endpoint has an associated URL (e.g., https://example.com/webhooks). The RapidCompact notifications are Event objects sent as POST requests (Fire-and-forget, no retry). This Event object contains all the relevant information about what just happened, including the type of event and the data associated with that event. The webhook endpoint uses the event details to take any required actions, such as indicating that an optimization should be done.

Validation

In order to validate an incoming webhook event you need to first set up a secret when creating it on RapidCompact. This secret will be used to sign the body and send the signature as part of the requests header. You can use this secret on your receiving endpoint to validate the content of the body by signing it with the same secret. For an example check out this repository: https://github.com/DGG3D/webhook-api-example

Optimization Events

RapidCompact sends the "optimization_finished" event. You can see an example on the right side

  {
   "event_type": "optimization_finished",
   "timestamp": "2023-01-19T15:03:08.076920Z",
   "data": {
     "status": "Successful",
     "message": "Optimization has ended and your rapid model is available to download.",
     "rawmodel_id": 1961,
     "rapidmodel_id": 4213,
     "rapidmodel": {
       "rapid.glb": "link to rapid model"
     }
   }
 }

Upload Events

RapidCompact sends an "analysis_finished" event when your uploaded model has been finished being analyzed and is now ready to be optimized. You can see an two examples for the successful and failed state on the right side.

For uploaded zip files RapidCompact sends an "unzip_finished" event when your model has been finished being unzipped and is going to be analysed next. You can see an two examples for the successful and failed state on the right side.

  {
   "event_type": "analysis_finished",
   "timestamp": "2023-01-02T15:03:08.076920Z",
   "data": {
     "status": "Successful",
     "message": "Model analysis has ended and your base asset is ready to be optimized.",
     "rawmodel_id": 1961,
   }
 }
  {
   "event_type": "analysis_finished",
   "timestamp": "2023-01-02T15:03:08.076920Z",
   "data": {
     "status": "Failed",
     "message": "Analysis failed",
     "rawmodel_id": 1961,
   }
 }
  {
   "event_type": "unzip_finished",
   "timestamp": "2024-01-02T15:03:08.076920Z",
   "data": {
     "status": "Successful",
     "message": "Model successfully unzipped.",
     "rawmodel_id": 1961,
   }
 }
  {
   "event_type": "unzip_finished",
   "timestamp": "2024-01-02T15:03:08.076920Z",
   "data": {
     "status": "Failed",
     "message": "Unzip failed",
     "rawmodel_id": 1961,
   }
 }

Get Webhooks

requires authentication

Example request:
curl --request GET \
    --get "https://api.rapidcompact.com/api/v2/user/webhooks" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/webhooks"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/webhooks'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200, success):


[
    {
        "id": 6,
        "user_id": 303,
        "url": "https://mywebhookurl.com",
        "last_called_at": "2021-10-26T09:45:47.000000Z",
        "created_at": "2021-10-26T09:45:47.000000Z",
        "updated_at": "2021-10-26T09:45:47.000000Z",
        "secret": "secret",
        "last_status": null,
        "verify_ssl": true,
        "failed_calls": 0,
        "notified_at": null
    }
]
 

Request      

GET api/v2/user/webhooks

Create Webhook

requires authentication

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/user/webhooks" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"url\": \"https:\\/\\/example.com\\/webhook\",
    \"secret\": \"my secret\",
    \"verify_ssl\": true
}"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/webhooks"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "url": "https:\/\/example.com\/webhook",
    "secret": "my secret",
    "verify_ssl": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/webhooks'
payload = {
    "url": "https:\/\/example.com\/webhook",
    "secret": "my secret",
    "verify_ssl": true
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, success):


{
    "id": 6,
    "user_id": 303,
    "url": "https://example.com/webhook",
    "last_called_at": "2021-10-26T09:45:47.000000Z",
    "created_at": "2021-10-26T09:45:47.000000Z",
    "updated_at": "2021-10-26T09:45:47.000000Z",
    "secret": "aut",
    "last_status": null,
    "verify_ssl": true,
    "failed_calls": 0,
    "notified_at": null
}
 

Example response (500, Maximum number of tags reached):


[
 "code": 1,
 "message": "Maximum number of webhooks allowed already created"
]
 

Request      

POST api/v2/user/webhooks

Body Parameters

url  string  

The url of the webhook

secret  string optional  

A secret to be sent in the header of webhook requests

verify_ssl  boolean  

Whether to verify ssl or not

Delete Webhook

requires authentication

Example request:
curl --request DELETE \
    "https://api.rapidcompact.com/api/v2/user/webhooks/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/webhooks/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/webhooks/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200, success):



 

Request      

DELETE api/v2/user/webhooks/{id}

URL Parameters

id  integer  

The id of the webhook

Test Webhook

requires authentication

A test event will be sent to the webhook to make sure it is accessible and can receive events

Call the "Test Webhook" endpoint again to see if the webhook was successfully invoked

Example request:
curl --request POST \
    "https://api.rapidcompact.com/api/v2/user/webhooks/test/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.rapidcompact.com/api/v2/user/webhooks/test/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.rapidcompact.com/api/v2/user/webhooks/test/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (200, success):



 

Request      

POST api/v2/user/webhooks/test/{id}

URL Parameters

id  integer  

The id of the webhook