> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.meetstream.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.meetstream.ai/_mcp/server.

# Create Zoom OAuth Connection

POST https://api.meetstream.ai/api/v1/zoom/oauth/connections
Content-Type: application/json

Exchange the `code` from Zoom's redirect for a stored connection. Call this from your server when your redirect URI receives `?code=...&state=...`. Save the returned `zoom_user_id` against your end-user record - you pass it back on create_bot as `zoom.zoom_oauth_connection_user_id`.

Reference: https://docs.meetstream.ai/api-reference/api-endpoints/zoom-o-auth-obf/create-zoom-o-auth-connection

## Authentication

- `Authorization` header (required) (prefixed with `Token `) — Format: Token \<your\_api\_key>

## Request

### Body (application/json)

- `code` (string, required) — The authorization code from Zoom's redirect to your callback
- `redirect_uri` (string, required) — The exact same redirect URL registered on your Zoom app and used on authorize-url
- `metadata` (map from string to string, optional) — Your own key/values to store with the connection (e.g. tenant_user_id)

## Response

### 200

Connection stored

- `zoom_user_id` (string, optional) — The end-user's Zoom user ID - pass as zoom.zoom_oauth_connection_user_id on create_bot
- `zoom_account_id` (string, optional)
- `email` (string, optional)
- `display_name` (string, optional)
- `metadata` (map from string to string, optional)
- `state` (string, optional)
- `created_at` (string, optional)
- `updated_at` (string, optional)
- `has_refresh_token` (boolean, optional)

## Examples

**Request**

```json
{
  "code": "<from Zoom redirect>",
  "redirect_uri": "https://yourapp.example.com/zoom/oauth/callback",
  "metadata": {
    "tenant_user_id": "alice-internal-uuid"
  }
}
```

**Response**

```json
{
  "zoom_user_id": "string",
  "zoom_account_id": "string",
  "email": "string",
  "display_name": "string",
  "metadata": {},
  "state": "connected",
  "created_at": "string",
  "updated_at": "string",
  "has_refresh_token": true
}
```

**SDK Code**

```python
import requests

url = "https://api.meetstream.ai/api/v1/zoom/oauth/connections"

payload = {
    "code": "<from Zoom redirect>",
    "redirect_uri": "https://yourapp.example.com/zoom/oauth/callback",
    "metadata": { "tenant_user_id": "alice-internal-uuid" }
}
headers = {
    "Authorization": "Token <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.meetstream.ai/api/v1/zoom/oauth/connections';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <apiKey>', 'Content-Type': 'application/json'},
  body: '{"code":"<from Zoom redirect>","redirect_uri":"https://yourapp.example.com/zoom/oauth/callback","metadata":{"tenant_user_id":"alice-internal-uuid"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.meetstream.ai/api/v1/zoom/oauth/connections"

	payload := strings.NewReader("{\n  \"code\": \"<from Zoom redirect>\",\n  \"redirect_uri\": \"https://yourapp.example.com/zoom/oauth/callback\",\n  \"metadata\": {\n    \"tenant_user_id\": \"alice-internal-uuid\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Token <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.meetstream.ai/api/v1/zoom/oauth/connections")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"code\": \"<from Zoom redirect>\",\n  \"redirect_uri\": \"https://yourapp.example.com/zoom/oauth/callback\",\n  \"metadata\": {\n    \"tenant_user_id\": \"alice-internal-uuid\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.meetstream.ai/api/v1/zoom/oauth/connections")
  .header("Authorization", "Token <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"code\": \"<from Zoom redirect>\",\n  \"redirect_uri\": \"https://yourapp.example.com/zoom/oauth/callback\",\n  \"metadata\": {\n    \"tenant_user_id\": \"alice-internal-uuid\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.meetstream.ai/api/v1/zoom/oauth/connections', [
  'body' => '{
  "code": "<from Zoom redirect>",
  "redirect_uri": "https://yourapp.example.com/zoom/oauth/callback",
  "metadata": {
    "tenant_user_id": "alice-internal-uuid"
  }
}',
  'headers' => [
    'Authorization' => 'Token <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.meetstream.ai/api/v1/zoom/oauth/connections");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"code\": \"<from Zoom redirect>\",\n  \"redirect_uri\": \"https://yourapp.example.com/zoom/oauth/callback\",\n  \"metadata\": {\n    \"tenant_user_id\": \"alice-internal-uuid\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "code": "<from Zoom redirect>",
  "redirect_uri": "https://yourapp.example.com/zoom/oauth/callback",
  "metadata": ["tenant_user_id": "alice-internal-uuid"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.meetstream.ai/api/v1/zoom/oauth/connections")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```