KindeK
Kinde8mo ago
6 replies
Parth

Not able to create/read environment variable using management API

I'm trying to create an environment variable using management api:
import { EnvironmentVariables } from '@kinde/management-api-js';

I've set all the scopes related to environment variables in M2M application already. Though whenever I try to read/create environment variable I'm getting below error:
S [ApiError]: Invalid request.
    at or (D:\node_modules\@kinde\management-api-js\dist\kinde-management-api-js.cjs:1:49952)
    at D:\node_modules\@kinde\management-api-js\dist\kinde-management-api-js.cjs:1:50557
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  url: 'https://{my-kinde-domain}/api/v1/environment_variables/q',
  status: 400,
  statusText: 'Bad Request',
  body: { errors: [ [Object] ] },
  request: {
    method: 'GET',
    url: '/api/v1/environment_variables/{variable_id}',
    path: { variable_id: 'q' },
    errors: {
      '400': 'Invalid request.',
      '403': 'Unauthorized - invalid credentials.',
      '429': 'Too many requests. Request was throttled.'
    }
  }
}


All other management APIs are working fine, only these environment variables related APIs are giving error
Help me why this error is occuring?
Was this page helpful?