Skip to main content
Contributor III
December 1, 2022
Solved

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

  • December 1, 2022
  • 4 replies
  • 668 views

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!

    This topic has been closed for replies.
    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

    4 replies

    Brian Turcotte
    Klaviyo Alum
    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

    SmashPopsAuthor
    Contributor III
    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

    Contributor I
    March 2, 2024

    any updates?

     

    Contributor I
    September 13, 2024

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