How to execute py file using Jupyter Notebook Server API

im currently using Jupyter Notebook Server API to access my remote file.
However, i can’t execute remote py file using by using tho Jupyter Server API.
i already manage to create Terminal by:

import requests
import json
# link remote server
hostname = ''
port = '442'
password = 'xxx'
token = {'token':'xxx'}
base_url = 'https://{0}:{1}/'.format(hostname, port)

print (base_url)
h = {}
if password:
    r = + 'login', params={
        'password': password
    h = r.request.headers
# sessions = + 'api/terminals', headers=h, params=token).json()
# print (sessions)

## create terminal
command = 'python /report/'
# body = json.dumps(command)
body = json.dumps({'file_content':command})
sessions = + 'api/terminals', 
                         data = body, headers=h, params=token) # .json


but when i try to post my command ,it return <Response [404]>

script = '/report//' # remote script path
command = f'python {script}'
data = {'data': command }

response ='{base_url}/api/terminals/{terminal_id}/send', 
              headers=h, params=token, data=json.dumps(data))

In conclusion, is there any way to post/put/send/uploade the command into the remote terminal and run it ?

Thanks in advance.