Anyone here have made API calls to a D1 instance to query the db? The error im receiving: `The req

Anyone here have made API calls to a D1 instance to query the db?

The error im receiving: The request is malformed: failed to decode id

url: https://api.cloudflare.com/client/v4/accounts/{account_id}/d1/database/{db_id}/query

const insertStatement = `INSERT INTO table (column1, column2) VALUES ('value1', 'value2');`;


const options = {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer {api_token}'
    },
    body: `{"sql": ${insertStatement}`
  }


I'm not exactly where to go from here unfortunately. Any assistance would be greatly appreciated.
Was this page helpful?