---
title: "Complete OAuth connection"
method: POST
path: "/v1/users/{user_id}/integrations/connect"
tags: ["Integrations"]
---

# Complete OAuth connection

`POST /v1/users/{user_id}/integrations/connect`

## Request

- Base URL: `http://0.0.0.0:3000`
- URL: `http://0.0.0.0:3000/v1/users/{user_id}/integrations/connect`
- Auth: none declared

Exchanges an OAuth authorization code to complete an integration connection.

**Flow**:
1. Call `GET /v1/users/:user_id/integrations/connect` with `provider` to get an `authUrl`
2. Redirect the user to the `authUrl`
3. After user authorizes, they're redirected back with a `code`
4. Call this POST endpoint with the `code`, `provider`, and `state` to complete the connection

**Supported providers**: `gmail`, `slack`, `outlook`, `teams`

**Reconnection**: Pass `reconnect` with an integration ID (int_xxx format) to reconnect an existing integration

## Path parameters

- `user_id` string, uuid, required

## Request body

- object
  - `provider` string, required: Integration provider (gmail, slack, outlook, teams)
  - `code` string, required: OAuth authorization code
  - `state` string: OAuth state parameter returned by the provider. Supports redirect_url in JSON/base64url JSON state.
  - `reconnect` string: Integration ID to reconnect (int_xxx format)
  - `response_mode` 'json' | 'redirect': Set to redirect for direct browser POST callbacks. Default json preserves XHR flows.

## Response `200`

Default Response

- object
  - `success` boolean, required
  - `integration_id` string: Created/reconnected integration ID
  - `redirect_url` string: Partner return URL with OAuth completion query parameters appended, when configured.

## Other responses

- `400`: Default Response
- `401`: Default Response
- `403`: Default Response
- `409`: Default Response
- `500`: Default Response

---

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