> For the complete documentation index, see [llms.txt](https://docs.metahumansdk.io/service-apis-for-creating-virtual-avatars/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metahumansdk.io/service-apis-for-creating-virtual-avatars/errors/glb-constructor.md).

# GLB Constructor

### 0. unregistered token

```json
{
  "error": {
    "code": 0,
    "message": "unregistered token"
  }
}
```

This error means that the provided token is not recognized by the service.

[Obtain a token](/service-apis-for-creating-virtual-avatars/getting-started/getting-a-token.md), or, if you already have one, make sure you entered it correctly.

### 1. authorization fail

```json
{
  "error": {
    "code": 1,
    "message": "authorization fail"
  }
}
```

You are not authorized to access this service. [Contact support](/service-apis-for-creating-virtual-avatars/welcome/about-us.md).

### 2. schema is not loaded

```json
{
  "error": {
    "code": 2,
    "message": "schema not loaded"
  }
}
```

You haven't uploaded the schema yet.&#x20;

To get started, you need to download the schema and models. Please check [the GLB Constructor Service](/service-apis-for-creating-virtual-avatars/getting-started/glb-constructor.md) section when getting started.

### 3. invalid checksum

```json
{
  "error": {
    "code": 3,
    "message": "invalid checksum"
  }
}
```

Checksum does not match the saved model, which means errors occurred while uploading the model.

[Try again](#glb). If the problem persists, [contact support](/service-apis-for-creating-virtual-avatars/welcome/about-us.md).

### 4. invalid model type

```json
{
  "error": {
    "code": 4,
    "message": "invalid model type"
  }
}
```

The field 'data\_type' is filled incorrectly. Please check your schema.

### 5. invalid model id

```json
{
  "error": {
    "code": 5,
    "message": "invalid model id for type"
  }
}
```

The field 'data\_id' is filled incorrectly. Please check your schema using POST /schema request.

### 6. model must be in GLB format

```json
{
  "error": {
    "code": 6,
    "message": "model must be in glb format"
  }
}
```

The service could not read the file. Check if it's in the right format.

### 7. unable to load model&#x20;

```json
{
  "error": {
    "code": 7,
    "message": "model load fail"
  }
}
```

Error while parsing the uploaded model.

Try again. If the problem persists, [contact support](/service-apis-for-creating-virtual-avatars/welcome/about-us.md).

### 8. reading schema error

```json
{
  "error": {
    "code": 8,
    "message": "schema reading problems"
  }
}
```

Error while reading the uploaded schema.&#x20;

Try again. If the problem persists, [contact support](/service-apis-for-creating-virtual-avatars/welcome/about-us.md).

### 9. invalid head config

```json
{
  "error": {
    "code": 9,
    "message": "invalid head config"
  }
}
```

For config template see [3D Face Reconstruction Service](/service-apis-for-creating-virtual-avatars/getting-started/3d-face-reconstruction.md).

### 10. invalid models config

```json
{
  "error": {
    "code": 10,
    "message": "invalid models config"
  }
}
```

The same rules apply to the models config as to [the schema](#schema), with the exception that there should only be one ID in the model type list.

Correct config example:

```json
{
   "hair" : [
      "hairF_01"
   ],
   "body": [
      "body_01"
   ]
}
```

### 11. invalid model type in request

```json
{
  "error": {
    "code": 11,
    "message": "invalid types in models config"
  }
}
```

Request contains model type not declared in the models config.

### 12. invalid model ID in request

```json
{
  "error": {
    "code": 12,
    "message": "model not loaded or invalid id in models config"
  }
}
```

Request contains model ID not declared in the models config, or model was not loaded via PUT /glb. Please check your schema via POST /schema request.

### 13. invalid head\_uv file

```json
{
  "error": {
    "code": 13,
    "message": "invalid head_uv file, image expected"
  }
}
```

Service expects image file.

It is recommended that you use UV texture generated from the [3D Face Reconstruction Service](/service-apis-for-creating-virtual-avatars/getting-started/3d-face-reconstruction.md).

### 14. head\_uv file size must be less than 2 Mb

```json
{
  "error": {
    "code": 14,
    "message": "head_uv image must be less than 2 Mb"
  }
}
```

Submitted image file is over the size limit.

### 15. model file size in custom\_models must be less than 50 Mb

```json
{
  "error": {
    "code": 15,
    "message": "each model in custom_models must be less than 50 Mb"
  }
}
```

Submitted GLB file is over the size limit.

### 16. invalid file in custom\_models

```json
{
  "error": {
    "code": 16,
    "message": "invalid files in custom_models, GLB format expected"
  }
}
```

The service could not read the file. Make sure it's in GLB format.

### 17. invalid json fields in head config

```json
{
  "error": {
    "code": 17,
    "message": "invalid json fields in head config"
  }
}
```

Invalid JSON structure.

It is recommended that you use head config generated from the [3D Face Reconstruction Service](/service-apis-for-creating-virtual-avatars/getting-started/3d-face-reconstruction.md).

### 18. internal error

```json
{
  "error": {
    "code": 18,
    "message": "internal error"
  }
}
```

Internal error occured. Try again. If the problem persists, [contact support](/service-apis-for-creating-virtual-avatars/welcome/about-us.md).

### 19. internal error: assemble

```json
{
  "error": {
    "code": 19,
    "message": "internal error: assemble fail"
  }
}
```

Internal error occured. Try again. If the problem persists, [contact support](/service-apis-for-creating-virtual-avatars/welcome/about-us.md).

### 20. missing schema

```json
{
  "error": {
    "code": 20,
    "message": "missing schema"
  }
}
```

Upload schema first. Please check [the GLB Constructor Service](/service-apis-for-creating-virtual-avatars/getting-started/glb-constructor.md) section when getting started.

### 21. schema error

```json
{
  "error": {
    "code": 21,
    "message": "schema error"
  }
}
```

Schema can contain several possible formating errors:

**1. Schema configuration must be enclosed in curly brackets.**

For example:

```json
{
   "hair" : [
      "hairM_01", "hairF_01"
   ],
   "body": [
      "body_01", "body_02"
   ]
}
```

or

```
{
}
```

for empty config.

**2. Each model type must contain list (enclosed in brackets) of file IDs.**

Correct config example:

```json
{
   "hair" : [
      "hairM_01"
   ]
}
```

Wrong config example:

```json
{
   "hair" : (
      "hairM_01"
   )
}
```

**3. All model identifiers must be strings.**

Wrong config example:

```json
{
   "hair" : [
      0, 1, 2
   ],
   "body": [
      body_01, body_02
   ]
}
```

**4. File IDs should be unique for each model type.**

Wrong config example:

```json
{
   "hair" : [
      "hairM_01", "hairM_01"
   ]
}
```
