Make a call to the Passport API
The Passport API lets you manage namespaces, resource groups, secret references, and endpoints programmatically. This tutorial shows you how to make your first call to it using curl.
For details on every available endpoint, see the API reference.
Get an API key
Before you can call the Passport API, you’ll need an API key. To learn more, see Create an API key.
Make an API call
Include your API key in the Authorization header of every request as a bearer token. Passport validates it against your organization’s WorkOS account, and a valid key has admin-equivalent access to every namespace, resource group, secret reference, and endpoint in your organization, including the secrets mapped to them.
For your first call, use the Get a namespace endpoint. This requires an existing namespace, so make sure you’ve created one first.
-
Send a request without the
Authorizationheader to see how the Passport API responds when a request isn’t authenticated:The Passport API returns an HTTP
401 Unauthorizedresponse. -
Send the same request with your API key:
The Passport API returns a successful response with the namespace’s details in the response body:
Every successful Passport API response follows this data envelope. List endpoints also include a pagination object. Error responses use an error envelope with code and message fields instead.
Rate limiting
Each API key is limited to a fixed number of requests per minute. If you exceed it, the Passport API returns an HTTP 429 Too Many Requests response with a Retry-After header and RateLimit-* headers describing your current limit and how much of it remains.

