# An error occured when getting the model upload URL: 401 Client Error: Unauthorized

**URL:** <https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535>\
**Category:** 🤝  Community Help\
**Tags:** export, research\
**Created:** [September 30, 2026, 12:16am UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535 "2026-09-30T00:16:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Arruda\_Moura](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/felipe_arruda_moura/32/9925_2.png) [@Felipe\_Arruda\_Moura](https://discuss.roboflow.com/u/Felipe_Arruda_Moura)\
**Post date:** [September 30, 2026, 12:16am UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535/1 "2026-09-30T00:16:29Z")

</div>

_Describe your question/issue here! (delete this when you post)_

- **Project Type: Players detection**
- **Operating System & Browser: Google Colab**
- **Project Universe Link or Workspace/Project ID:** project = rf.workspace(“felipemoura-uhruu”).project(“quartas\_ourteam-82yjc”)
- **Do you grant Roboflow Support permission to access your Workspace for troubleshooting? (Yes/No): Yes**

I have trained a model inside the google colab and I am trying to deploy de model, but there is this unauthorized message. My api-key is correct and I am using the same code I always used. However, now, it is unavailable. Please, can someone help me?

Error:

An error occured when getting the model upload URL: 401 Client Error: Unauthorized for url: [https://api.roboflow.com/felipemoura-uhruu/quartas\_ourteam-82yjc/1/uploadModel](https://api.roboflow.com/felipemoura-uhruu/quartas_ourteam-82yjc/1/uploadModel)?

Thanks!!

---

<div class="post-metadata">

**Author:** ![Nathan\_Badanjek](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nathan_badanjek/32/9816_2.png) [@Nathan\_Badanjek](https://discuss.roboflow.com/u/Nathan_Badanjek)\
**Post date:** [September 30, 2026, 3:03pm UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535/2 "2026-09-30T15:03:43Z")

</div>

Hi Felipe,

Thanks for the details! That 401 can come from a couple of different things, and the Python package hides the actual error message. Could you run this in your Colab and paste the output?

```python
import requests
r = requests.get(
    "https://api.roboflow.com/felipemoura-uhruu/quartas_ourteam-82yjc/1/uploadModel",
    params={"api_key": "YOUR_API_KEY", "modelType": "THE_MODEL_TYPE_YOU_PASS_TO_DEPLOY", "nocache": "true"},
)
print(r.status_code, r.text)

```

Please remove your API key before posting the output. Also let us know:

- the exact `model_type` you pass to `deploy()`
- your package version (the output of `!pip show roboflow`)

---

<div class="post-metadata">

**Author:** ![Felipe\_Arruda\_Moura](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/felipe_arruda_moura/32/9925_2.png) [@Felipe\_Arruda\_Moura](https://discuss.roboflow.com/u/Felipe_Arruda_Moura)\
**Post date:** [September 30, 2026, 5:20pm UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535/3 "2026-09-30T17:20:52Z")

</div>

Hi, Nathan. Thanks for you reply.

Please, find below the answers:

import requests

r = requests.get(

“[https://api.roboflow.com/felipemoura-uhruu/quartas\_ourteam-82yjc/1/uploadModel](https://api.roboflow.com/felipemoura-uhruu/quartas_ourteam-82yjc/1/uploadModel)”,

params={“api\_key”: “XXXX”, “modelType”: “yolov8”, “nocache”: “true”},

)

print(r.status\_code, r.text)

401 {“message”:“Model type \“yolov8\” is not recognized.”,“type”:“InvalidModelTypeException”,“hint”:“Please specify a supported model type with its size suffix.”}

* * *

That was my deploy command:

project.version(dataset.version).deploy(model\_type=“yolov8”, model\_path=f"{HOME}/runs/detect/train/")

* * *

Name: roboflow  
Version: 1.1.48  
Summary: Official Python package for working with the Roboflow API  
Home-page: [GitHub - roboflow/roboflow-python: The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application. · GitHub](https://github.com/roboflow-ai/roboflow-python)  
Author: Roboflow  
Author-email:  
License: UNKNOWN  
Location: /usr/local/lib/python3.13/dist-packages  
Requires: certifi, cycler, filetype, idna, kiwisolver, matplotlib, numpy, opencv-python-headless, Pillow, python-dateutil, python-dotenv, PyYAML, requests, requests-toolbelt, six, tqdm, urllib3  
Required-by:

Thanks for your support,

Felipe.

---

<div class="post-metadata">

**Author:** ![Nathan\_Badanjek](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/nathan_badanjek/32/9816_2.png) [@Nathan\_Badanjek](https://discuss.roboflow.com/u/Nathan_Badanjek)\
**Post date:** [September 30, 2026, 5:39pm UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535/4 "2026-09-30T17:39:03Z")

</div>

Hi Felipe,

Thank you for running that quick test. Our server now needs the model size in the model type (like `yolov8n`), and your version of the Roboflow package (1.1.48) sends a plain `"yolov8"` as-is. Either fix below will get the upload working.

**Option 1:** upgrade the Roboflow package. Newer versions read the size from your trained weights and add it automatically, so your existing `deploy()` call will work unchanged:

```bash
!pip install -U roboflow

```

Restart the Colab runtime after upgrading, then run your `deploy()` call again.

**Option 2:** keep your current version and pass the exact size you trained. For example, if you trained from `yolov8n.pt`:

```python
project.version(dataset.version).deploy(model_type="yolov8n", model_path=f"{HOME}/runs/detect/train/")

```

Use `yolov8s`, `yolov8m`, `yolov8l` or `yolov8x` if you trained one of those sizes instead.

Sorry the original error message wasn’t more helpful, I’ll get this feedback to our product team. Let us know if you run into any other issue!

Best Regards,  
Nathan Badanjek

---

<div class="post-metadata">

**Author:** ![Felipe\_Arruda\_Moura](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/felipe_arruda_moura/32/9925_2.png) [@Felipe\_Arruda\_Moura](https://discuss.roboflow.com/u/Felipe_Arruda_Moura)\
**Post date:** [September 30, 2026, 9:06pm UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535/5 "2026-09-30T21:06:43Z")

</div>

> [@Nathan\_Badanjek](#):
>
> yolov8s

Dear Nathan,

Thanks for your feedback. Option 2 worked! =)

My best regards!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [October 21, 2026, 9:07pm UTC](https://discuss.roboflow.com/t/an-error-occured-when-getting-the-model-upload-url-401-client-error-unauthorized/12535/6 "2026-10-21T21:07:34Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
