KindeK
Kinde10mo ago
Scott

Kinde API - "NAME_REQUIRED" error despite name being provided

Hi, I'm trying to call the create organization API but I'm getting stuck with a strange error. My code looks like this:

const headers = {
    Accept: "application/json",
    Authorization: `Bearer ${accessToken}`,
  };

const response = await fetch(
`${process.env.KINDE_ISSUER_URL}/api/v1/organization`,
  {
    method: "POST",
    headers,
    body: JSON.stringify({
      name,
      handle: createHandle(name),
      sender_email: email,
    }),
  }
);


But I keep getting this error:
[ { code: 'NAME_REQUIRED', message: 'Name is required' } ]


I've even tried hard coding different values for the name field, but still get the same error. Any idea what I might be doing wrong? Thanks in advance!
Was this page helpful?