# Account does not enabled REST API

**URL:** <https://devforum.zoom.us/t/account-does-not-enabled-rest-api/81247>\
**Category:** Users and Groups\
**Created:** [January 11, 2023, 8:33am UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api/81247 "2023-01-11T08:33:33Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![jchavezb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jchavezb/32/17812_2.png) [@jchavezb](https://devforum.zoom.us/u/jchavezb)\
**Post date:** [September 19, 2023, 9:16pm UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api/81247/23 "2023-09-19T21:16:48Z")

</div>

Si ya estamos en ello , gracias

---

<div class="post-metadata">

**Author:** ![vishruth](https://avatars.discourse-cdn.com/v4/letter/v/e495f1/32.png) [@vishruth](https://devforum.zoom.us/u/vishruth)\
**Post date:** [November 18, 2023, 6:40am UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api/81247/24 "2023-11-18T06:40:31Z")

</div>

This still Doesn’t work for me. I am trying to add a user to my account using the API. I have a server-to-server Oauth App and Here’s my code:

```auto
from dotenv import load_dotenv, find_dotenv
import requests
import os

# Load environment variables
load_dotenv(find_dotenv())

# Function to generate an OAuth access token
def generate_oauth_token():
    url = "https://zoom.us/oauth/token"
    payload = {
        'grant_type': 'client_credentials'
    }
    headers = {
        'Authorization': 'Basic ' + os.getenv('ZOOM_CLIENT_CREDENTIALS')
    }
    response = requests.post(url, headers=headers, data=payload)
    token = response.json().get('access_token', None)
    if not token:
        raise Exception("Failed to retrieve access token")
    return token

# Generate the OAuth token
oauth_token = generate_oauth_token()

# Print the OAuth token
print(oauth_token)

# Set the authorization header with the OAuth token
headers = {
    'Authorization': f"Bearer {oauth_token}",
    'Content-Type': "application/json"
}

# Payload for creating a new user
payload = {
    'action': 'create',
    "user_info": {
        "email": "test@gmail.com",
        "type": 1,
        "first_name": "Justin",
        "last_name": "Test"
    }
}

# Make the API request to create a new user
response = requests.post("https://api.zoom.us/v2/users", headers=headers, json=payload)

# Print the status code and JSON response
print(response.status_code)
print(response.json())

```

I am doing this from the admin account which is Pro licensed and the app is active as well.  
This is the output I get:

```auto
400
{'code': 200, 'message': 'Account does not enabled REST API.'}

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [November 20, 2023, 5:49pm UTC](https://devforum.zoom.us/t/account-does-not-enabled-rest-api/81247/25 "2023-11-20T17:49:09Z")

</div>

Hi @vishruth , there’s many updated threads on this issue and I encourage a search, but from your code I can see you are not generating the S2S OAuth access token correctly. You need `account_id` as one of the query parameters and have to provide your `account_id`:

[https://zoom.us/oauth/token?grant\_type=account\_credentials&account\_id=[account\_id]](https://zoom.us/oauth/token?grant_type=account_credentials&account_id=%5Baccount_id%5D)

[Previous page](https://devforum.zoom.us/t/account-does-not-enabled-rest-api/81247.md?page=1)
