> For the complete documentation index, see [llms.txt](https://docs.pyas.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyas.io/rest-api-reference/zoom/auth.md).

# Auth

## Get OAuth URL

There are 2 steps for connecting a zoom account. The first step is to request a Zoom OAuth URL.

## Get an OAuth URL

<mark style="color:blue;">`GET`</mark> `https://api.pyas.io/zoom/oauth`

Get a Zoom OAuth URL

#### Query Parameters

| Name  | Type   | Description                |
| ----- | ------ | -------------------------- |
| state | String | optional application state |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API key     |

{% tabs %}
{% tab title="200: OK OAuth URL was generated successfully" %}

```json
{
    "success": true,
    "url": "https://zoom.us/oauth/authorize?client_id=some-client-id&response_type=code&redirect_uri=some-redirect-url&state=some-state"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid or no api key provided" %}

```json
{
    "error": "Unauthorized. Invalid API key."
}
```

{% endtab %}
{% endtabs %}

## Connect Account

The next step is to connect the account. After you get an OAuth URL, you should direct your user to that URL in the browser. The user will then have to authorized/allow access on the OAuth screen. Once the user allows access, Zoom will redirect the user back to whatever redirect URL that you've set in Pyas. The URL will contain a `code` parameter, which you will need to use in the connect request.

<figure><img src="/files/qekf0f4bK6PlDCEzwfdD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MH9cLEoIxdBYZ5AgX4Dh" alt=""><figcaption></figcaption></figure>

## Connect Account

<mark style="color:green;">`POST`</mark> `https://api.pyas.io/zoom/connect`

Connect Zoom Account

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API key     |

#### Request Body

| Name                                   | Type   | Description                   |
| -------------------------------------- | ------ | ----------------------------- |
| code<mark style="color:red;">\*</mark> | String | code returned from Zoom OAuth |
| name<mark style="color:red;">\*</mark> | String | user's full name              |

{% tabs %}
{% tab title="200: OK Account connected successfully" %}

```json
{
    "success": true,
    "data": {
        "account": {
            "accountId": "46204525-b574-9ad72ae18c9e-9894161fvsvokok",
            "email": "user@example.com",
            "name": "John Doe",
            "provider": "zoom",
            "status": "active",
            "scopes": [
                "meeting:write",
                "user:read",
                "user_info:read",
                "meeting:read"
            ]
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request invalid code" %}

```json
{
    "success": false,
    "error": "Invalid authorization code",
    "code": 400
}
```

{% endtab %}

{% tab title="400: Bad Request no code provided" %}

```json
{
    "errors": [
        {
            "msg": "a code is required.",
            "param": "code",
            "location": "body"
        },
        {
            "msg": "code must be a string.",
            "param": "code",
            "location": "body"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

**Note:** Be sure to save the <mark style="color:blue;">`accountId`</mark> returned from the successful connect request. You will need it in order to access the user's Zoom account.
