> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.usepassport.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.usepassport.ai/_mcp/server.

# Make a call to the Passport API

The [Passport API](/passport/reference/passport-api/overview/) 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](/api-reference/).

> **Info**
>
> With the [Passport plugin](/passport/reference/passport-plugin/overview/), your coding agent can call the Passport API. It can register APIs and manage credentials and access without an API key or secrets touching your code or the conversation. To learn more, see [Manage Passport with the Passport plugin](/passport/reference/passport-plugin/work-with-agent/manage-passport/).

## 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](/passport/reference/passport-api/authentication/#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](/api-reference/namespaces/get-namespace) endpoint. This requires an existing namespace, so make sure you've [created one](/passport/set-up/create-namespace/) first.

1. Send a request without the `Authorization` header to see how the Passport API responds when a request isn't authenticated:

   ```sh showLineNumbers={false} wordWrap
   curl https://api.usepassport.ai/public/v1/namespaces/<namespaceId>
   ```

   The Passport API returns an HTTP `401 Unauthorized` response.

2. Send the same request with your API key:

   ```sh showLineNumbers={false} wordWrap
   curl https://api.usepassport.ai/public/v1/namespaces/<namespaceId> \
     -H "Authorization: Bearer sk_..."
   ```

   The Passport API returns a successful response with the namespace's details in the response body:

   ```json showLineNumbers={false}
   {
     "data": {
       "id": "3f7c2b6e-1c2d-4a5b-9e8f-0a1b2c3d4e5f",
       "name": "Production APIs",
       "description": "Production namespace for customer-facing services"
     }
   }
   ```

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.