---
title: "Complete"
method: POST
path: "/api/v1/integrations/{provider}/complete"
tags: ["integrations"]
---

# Complete

`POST /api/v1/integrations/{provider}/complete`

## Request

- Base URL: `https://api.aws.cognee.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.aws.cognee.ai/api/v1/integrations/{provider}/complete`
- Auth: API key in header `X-Api-Key`

Finish an install the browser has just come back from.

Called by the frontend, not by the browser: the provider redirects the
browser to the frontend's own origin, which is the only place that
holds both the session and the nonce cookie. The frontend reads its
cookie and hands the raw nonce here (CLO-890).

Every outcome but an unknown provider is a 200 carrying a coarse slug.
The caller turns that into whatever the reader sees; the provider's own
error text stays in the log, where it is useful and not readable by
whoever holds the browser.

For a connector whose code came from ``link_existing``'s OAuth leg
rather than an app-installation callback (no ``installation_id``,
see ``_complete_link_existing``), this never writes a credential
itself: it always answers ``choose_installation`` with a
``choice_token``, even for zero or one installation, so the tenant
owner picks explicitly on ``POST /{provider}/link`` rather than this
route silently choosing on their behalf (CLO-627).

## Path parameters

- `provider` string, required

## Request body

- ConnectCompletion: What the frontend hands back once the provider has returned the browser. ``params`` is the provider's whole query string. It is passed through to the connector rather than picked apart here, because what a provider sends back differs per provider — GitHub's ``installation_id``, an OAuth2 provider's ``code`` alone — and this route has no business knowing which. Bounded on every axis: this is an authenticated route, but an authenticated caller is still not a trusted one, and everything here is attacker-shaped input that arrived through a browser.
  - `state` string, required
  - `nonce` string, required
  - `params` object

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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