---
title: "Generate a tool integration OAuth URL"
method: POST
path: "/v1/agents/{id}/tool-integrations/{integrationId}/auth-url"
---

# Generate a tool integration OAuth URL

`POST /v1/agents/{id}/tool-integrations/{integrationId}/auth-url`

## Request

- Base URL: `https://api.runbear.io`
- URL: `https://api.runbear.io/v1/agents/{id}/tool-integrations/{integrationId}/auth-url`
- Auth: HTTP bearer

Generate a Runbear-hosted OAuth URL for an integration that needs browser-based authorization (step two of the two-step OAuth flow). The caller opens `authUrl` in a browser; Runbear completes the handshake server-side. `authUrl` is `null` when the integration is already authorized. Returns 400 `auth_url_not_applicable` for rows that need no browser auth (Pipedream `none`/`null`, Managed MCP stdio, remote/custom MCP with `auth.type` `none`/`static`), 400 when the agent's provider does not support tool integrations, and 404 when the agent or integration is not found.

## Path parameters

- `id` string, uuid, required: Agent ID
- `integrationId` string, uuid, required: Tool integration ID

## Response `200`

Default Response

- AgentToolIntegrationAuthUrlResponse
  - `authUrl` string, uri, nullable, required

## Other responses

- `400`: Default Response
- `404`: Default Response

---

[API](https://skmtc.dev/runbear/apis/runbear-api.md) - [All operations](https://skmtc.dev/runbear/apis/runbear-api/llms.txt) - [OpenAPI document](https://skmtc.dev/runbear/apis/runbear-api/revisions/c6a9c3066a5a?raw)
