Skip to main content
Answer

Why am I getting 403 Forbidden Access error on Json Imports?

  • July 3, 2025
  • 3 replies
  • 77 views

Forum|alt.badge.img+3

HI All, I’m looking at taking advantage of the Json Import features that was added last year to create some diagrams programatically. I’ve gotten to the point I should be able to import, but I’m getting 403 errors. Could someone help me figure this out? 

 

curl 'https://api.lucid.co/documents'\
--request 'POST'\
--header 'Authorization: Bearer <TOKEN>'\
--header 'Lucid-Api-Version: 1'\
--form 'file=@./network.lucid;type=x-application/vnd.lucid.standardImport'\
--form 'title=New Document'\
--form 'product=lucidchart'\
--form 'parent=1234'
{"code":"accessForbidden","message":"Access to this resource is forbidden","requestId":"2cee5d6383fdcfac"}%

 

 

I’m trying to import the example from here… https://github.com/lucidsoftware/sample-lucid-rest-applications/tree/main/standard-import/demo-files/network

 

 

Best answer by Humas1985

Hi ​@Markeen 

 It's likely due to insufficient permissions in your API token or attempting to access a restricted resource, such as a folder. Kindly check that your OAuth token includes necessary scopes like "document:write" and "user:read" in the Lucid developer portal.

Besides try removing the "parent" field from your API call to test if the issue persists. Ensure you're using the correct product parameter ("lucidchart") and that your Lucid account has API-enabled permissions.

To learn more - Newbie question doing my first API call - 403 response | Community

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Comments

Humas1985
Lucid Legend Level 10
Forum|alt.badge.img+24
  • Lucid Legend Level 10
  • Answer
  • July 3, 2025

Hi ​@Markeen 

 It's likely due to insufficient permissions in your API token or attempting to access a restricted resource, such as a folder. Kindly check that your OAuth token includes necessary scopes like "document:write" and "user:read" in the Lucid developer portal.

Besides try removing the "parent" field from your API call to test if the issue persists. Ensure you're using the correct product parameter ("lucidchart") and that your Lucid account has API-enabled permissions.

To learn more - Newbie question doing my first API call - 403 response | Community

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards


Forum|alt.badge.img+3
  • Author
  • July 3, 2025

Thanks ​@Humas1985 . Is this the appropriate way to set the scopes? 

 

https://lucid.app/oauth2/authorize?client_id=<CLIENT_ID>&redirect_uri=https://lucid.app/oauth2/clients/<CLIENT_ID>/redirect&scope=lucidchart.document%20offline_access%20user.profile

That doesn’t seem to be working for me. 

 

Is there a definitive list of all the scopes needed for a json import? 

 

My original scopes were:

 

  "scopes": [
"lucidchart.document.content",
"offline_access",
"user.profile"
]

 


Forum|alt.badge.img+3
  • Author
  • July 3, 2025

Nevermind. The issue was the parent. Thanks!