Skip to main content
Solved

API endpoint to know what are the scopes of the API key?

  • December 1, 2022
  • 4 replies
  • 454 views

Forum|alt.badge.img+2

Hello,

First, congrats on the new API release, I’m excited to work with it!

Since we are now dealing with API scopes attached to API keys, I was wondering if there was an API that would tell me what are the scopes attached to an API key? I can’t seem to find any in the doc/OpenAPI spec.

Perhaps something like :

curl --request GET \
  --url 'https://a.klaviyo.com/api/key-scopes'
  --header 'Authorization: Klaviyo-API-Key {my-private-api-key}'


That would answer with :

{
  "data": ["Catalogs Read", "Catalogs Write"]
}



Thanks!

Best answer by Brian Turcotte

Hi @SmashPops and welcome back to the Community!

 

This is great question! At this time, there’s no supported endpoint to retrieve the scope of an API key. However, another Community member asked a similar question here, so I will definitely submit a request with our product team, as I agree that this would be a great feature!

 

I hope this helps to clarify, and thanks for using the Community!

- Brian

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • December 1, 2022

Hi @SmashPops and welcome back to the Community!

 

This is great question! At this time, there’s no supported endpoint to retrieve the scope of an API key. However, another Community member asked a similar question here, so I will definitely submit a request with our product team, as I agree that this would be a great feature!

 

I hope this helps to clarify, and thanks for using the Community!

- Brian


Forum|alt.badge.img+2
  • Author
  • Contributor II
  • 3 replies
  • December 1, 2022

Hello Brian,

Oops, sorry for the duplicate content!

And thank you for your answer. Well, for now I’ll use a workaround then : calling an endpoint that requires some scopes and see if I’m rejected with a 403 HTTP status code (instead of a 400 for instance), which would mean that my token doesn’t have the required scopes.

Anyway, thanks again!
William


Forum|alt.badge.img+2
  • Contributor I
  • 7 replies
  • March 2, 2024

any updates?

 


Forum|alt.badge.img
  • Contributor I
  • 3 replies
  • September 13, 2024

Any updates? It would be super useful to make a single call and get this info