OAuth + Optional Scope?

Hello.
What is the impact of `optional_scope` attribute when doing an OAuth Integration?
I thoguht it will be an optional for the user to agree as well.
But as you can see the user still has to accept all of the scopes I’m asking for.

Instead I would expect “READ” scopes as mandatory for the user, and other as OPTIONAL - with some checkboxes or other form.
Am I doing something wrong here?
Here’s my authorization URL:
https://app-eu1.hubspot.com/oauth/143120677/authorize?optional_scope=crm.objects.companies.write%20crm.lists.write%20crm.objects.line_items.write%20crm.objects.contacts.write%20crm.schemas.deals.write%20crm.objects.marketing_events.write%20crm.objects.custom.write%20crm.objects.deals.write%20crm.schemas.contacts.write%20crm.objects.quotes.write%20crm.schemas.companies.write&response_type=code&client_id=0ab82c0e-0eaa-4523-a09a-2903e327f50f&redirect_uri=http%3A%2F%2Flocalhost%3A8084%2Fv1%2Fhubspot%2Fcallback&scope=crm.objects.owners.read%20crm.lists.read%20crm.objects.deals.read%20crm.schemas.deals.read%20crm.objects.companies.read%20crm.schemas.companies.read%20crm.schemas.contacts.read%20crm.schemas.custom.read%20crm.objects.contacts.read%20crm.objects.custom.read
And here is the list of my scopes:

scopes: > crm.objects.owners.read, crm.objects.custom.read, crm.objects.companies.read, crm.lists.read, crm.objects.deals.read, crm.objects.contacts.read, crm.schemas.companies.read, crm.schemas.contacts.read, crm.schemas.custom.read, crm.schemas.deals.readoptional-scopes: > crm.objects.contacts.write, crm.objects.marketing_events.write, crm.objects.custom.write, crm.objects.companies.write, crm.lists.write, crm.objects.deals.write, crm.schemas.companies.write, crm.schemas.contacts.write, crm.schemas.deals.write, crm.objects.quotes.write, crm.objects.line_items.write

Hey @dmydlarz,

In short what you are seeing is expected behaviour and not something out of the ordinary.

Optional scopes are optional for your app, and will be dropped if the selected HubSpot portal does not have access to those products. For instance “automation” is the scope for using the workflows API but that is exclusive to portals using professional tiers of HubSpot so to ensure that a free or starter portal could install your app you can set the scope as potion.

Also, certain scopes like “transactional-email” require paid add-ons which not every portal would have.

HubSpot doesn’t support allowing users to pick and choose the scopes they’ll allow for a given app being installed.

Thank you for the clarificaiton :person_bowing:

Hey @coldrickjack ,
Im going through same issue.
I have added automation as optional scope to my public app.
For some of my clients, there are “403 Forbidden Error: Missing ‘workflows-access-public-api’ Scope in External Auth Request” error logs.
I have checked their scopes through “https://api.hubapi.com/oauth/v1/access-tokens/:token” api, i can see automation scope present in response of access-token-metadata → scopes. But got 403-forbidden for "/automation/v3/workflows".
Could you find whats wrong here?
Hoping for Response.
Thank you.

Hey @Shrinath
Thanks for the great question!
My recommendation is to create a new post for this. This gives your post the best shot at getting seen by as many of our amazing community members as possible. Feel free to tag me in the post and I’m happy to get you started
Best,
Victor

Hi @Victor_Becerra ,
I have created the new post for same.
Here is link:
https://community.hubspot.com/t5/APIs-Integrations/403-Forbidden-Missing-workflows-access-public-api-Scope-Even/m-p/1177611/highlight/true#M83299
Thank you.