> **Building with AI coding agents?** If you're using an AI coding agent, install the official Scalekit plugin. It gives your agent full awareness of the Scalekit API — reducing hallucinations and enabling faster, more accurate code generation.
>
> - **Claude Code**: `/plugin marketplace add scalekit-inc/claude-code-authstack` then `/plugin install <auth-type>@scalekit-auth-stack`
> - **GitHub Copilot CLI**: `copilot plugin marketplace add scalekit-inc/github-copilot-authstack` then `copilot plugin install <auth-type>@scalekit-auth-stack`
> - **Codex**: run the bash installer, restart, then open Plugin Directory and enable `<auth-type>`
> - **Skills CLI** (Windsurf, Cline, 40+ agents): `npx skills add scalekit-inc/skills --list` then `--skill <skill-name>`
>
> `<auth-type>` / `<skill-name>`: `agent-auth`, `full-stack-auth`, `mcp-auth`, `modular-sso`, `modular-scim` — [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Authorize a user

Scalekit provides a completely managed authentication platform to handle complex OAuth2.0, API Keys, Bearer Tokens and any other API authentication protocols required by third party applications to execute tool calls on behalf of users.

This managed authentication handling enables you to build powerful agents without having to worry about handling user authentication and API authentication across different applications like Salesforce, Hubspot, GMail, Google Calendar etc.

## Authorize a user

If you are building an agent that needs to execute actions on behalf of a user, your agent needs to get authorization from user to give access to their application.

The following code sample helps your agent complete user authorization required to make a successful authenticated tool call.

```python
link_response = actions.get_authorization_link(
    connection_name="gmail",  # connection name to which the user needs to grant access
    identifier="user_123"     # unique user id
)
print(f"click on the link to authorize gmail", link_response.link)
input(f"Press Enter after authorizing gmail...")
```

```typescript
const linkResponse = await actions.getAuthorizationLink({
  connectionName: 'gmail',  // connection name to which the user needs to grant access
  identifier: 'user_123',  // unique user id
});
console.log('click on the link to authorize gmail', linkResponse.link);
// In production, redirect the user to linkResponse.link to complete the OAuth flow
```

## Check Authorization Status

If you would like to check whether the user has completed authorization for a given application,

```python
response = actions.get_or_create_connected_account(
    connection_name="gmail",
    identifier="user_123"
)
connected_account = response.connected_account
print(f"Authorization status of the connected account", connected_account.status)
```

```typescript
const response = await actions.getOrCreateConnectedAccount({
  connectionName: 'gmail',
  identifier: 'user_123',
});
const connectedAccount = response.connectedAccount;
console.log('Authorization status of the connected account', connectedAccount?.status);
```

---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
