---
title: "Oauth2 Callback"
method: POST
path: "/connections/{projectId}/oauth2"
tags: ["Connections"]
---

# Oauth2 Callback

`POST /connections/{projectId}/oauth2`

## Request

- Base URL: `https://partner.peaka.studio/api/v1`
- URL: `https://partner.peaka.studio/api/v1/connections/{projectId}/oauth2`
- Auth: HTTP bearer

This callback/webhook is used while creating a new connection with Oauth2. See https://docs.peaka.com/how-to-guides/how-to-create-oauth2-based-connections-via-peaka for more information.

## Path parameters

- `projectId` string, required

## Request body

- Oauth2Callback
  - `queryParameters` string: Query parameters received from the Oauth2 redirection. Pass all query parameters as a single string. Example: "https://yourdomain.com/oauth2/mycallback?code=1234&state=xyz&param1=value1&param2=value2" "queryParameters": "code=1234&state=xyz&param1=value1&param2=value2"

## Response `200`

Connection created successfully

- Connection
  - `id` string: Connection ID
  - `name` string: Name of the connection
  - `type` string: Type of connection. Example: airtable for AirTable, stripe for Stripe, hubspot_access_token for HubSpot (with Access Token), etc. Exact list can be fetched by following url: /connections/config
  - `url` string: Oauth callback url if the connection is Oauth based.

---

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