---
title: "Handle OAuth callback"
method: GET
path: "/api/actions/connector/_oauth_callback"
tags: ["connectors"]
---

# Handle OAuth callback

`GET /api/actions/connector/_oauth_callback`

**Spaces method and path for this operation:**

<div><span class="operation-verb get">get</span>&nbsp;<span class="operation-path">/s/{space_id}/api/actions/connector/_oauth_callback</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Handles the OAuth 2.0 authorization code callback from external providers. Exchanges the authorization code for access and refresh tokens.<br/><br/>[Required authorization] Route required privileges: actions:oauth.

## Query parameters

- `code` string
- `state` string
- `error` string
- `error_description` string
- `session_state` string

## Response `200`

Returns an HTML callback page.

## Other responses

- `302` — Redirects to the return URL with authorization result query parameters.
- `401` — User is not authenticated.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
