POST /api/v2/clients doesn't allow create a new client - Bad request

I need your help please, i’m trying to create a new client using the endpoint POST /api/v2/clients but always i get:

“statusCode”: 400,
“error”: “Bad Request”,
“message”: “Payload validation error: ‘Expected type object but found type null’.”,
“errorCode”: “invalid_body”

I know that Bad Request is my error but i don’t know where is the error, i don’t know what is missing, i tried with different json body but the result is the same.

This is the code in python to test:

import http.client
import json

headers = {‘Content-type’: ‘application/json’,
‘authorization’: “Bearer eyJ0eXAiOiJKV1…”}

client_post = {
“name”: “MyApplication1”,
“description”: “test”,
“logo_uri”: “”,
“callbacks”: [
“allowed_origins”: [
“client_aliases”: [
“allowed_clients”: [
“allowed_logout_urls”: [
“token_endpoint_auth_method”: “client_secret_post”,
“app_type”: “non_interactive”,
“oidc_conformant”: False,
“jwt_configuration”: {
“alg”: “RS256”,
“lifetime_in_seconds”: 1728000,
“secret_encoded”: False
“encryption_key”: {
“pub”: “”,
“cert”: “”,
“subject”: “”
“sso”: False,
“sso_disabled”: False,
“cross_origin_auth”: False,
“cross_origin_loc”: “”,
“custom_login_page_on”: False,
“custom_login_page”: “”,
“custom_login_page_preview”: “”,
“form_template”: “”,
“is_heroku_app”: False,
“addons”: {
“slack”: {
“team”: “MyTeam”
“client_metadata”: {},
“mobile”: {
“android”: {
“app_package_name”: “”,
“sha256_cert_fingerprints”: [
“ios”: {
“team_id”: “9JA89QQLNQ”,
“app_bundle_identifier”: “”

json_data_post = json.dumps(client_post)
conn.request(“POST”, “/api/v2/clients”, headers=headers)

However i can to do GET /api/v2/clients good.

Could someone help me please?


Carlos Llano

It looks as if the payload (json_data_post) is missing in the request.

Instead of:

conn.request(“POST”, “/api/v2/clients”, headers=headers)


conn.request(“POST”, “/api/v2/clients”, body=json_data_post, headers=headers)

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.