---
title: "Initiate OAuth connection"
method: POST
path: "/v1/agents/{agent_id}/oauth/connect"
tags: ["OAuth Connect"]
---

# Initiate OAuth connection

`POST /v1/agents/{agent_id}/oauth/connect`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/agents/{agent_id}/oauth/connect`
- Auth: HTTP bearer

Start an OAuth authorization flow for the specified agent and provider.
Returns the authorization URL to redirect the user to. Human-only.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- ConnectOAuthRequest
  - `provider_slug` string, required: Provider to connect (e.g. "github", "google", "slack")
  - `scopes` string[]: Override default scopes for this connection
  - `redirect_after` string: URL to redirect to after the OAuth flow completes

## Response `200`

Authorization URL generated

- ConnectOAuthResponse
  - `authorization_url` string, uri: Redirect the user to this URL to authorize the connection

## Other responses

- `400`: Invalid request
- `403`: Insufficient permissions
- `404`: Resource not found

---

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