Problems creating a bucket with google api storage

Hello I am trying to use the google api storage dependencies to create a a bucket in google storage, the problem is that i am not being able to do it because I get this error after ejecution the code

   __client__: %Tesla.Client{
     adapter: nil,
     fun: nil,
     post: [],
     pre: [
       {Tesla.Middleware.Headers, :call,
             "Bearer .."}
   __module__: GoogleApi.Storage.V1.Connection,
   body: "{\n  \"error\": {\n    \"code\": 400,\n    \"message\": \"Required\",\n    \"errors\": [\n      {\n        \"message\": \"Required\",\n        \"domain\": \"global\",\n        \"reason\": \"required\"\n      }\n    ]\n  }\n}\n",
   headers: [
     {"cache-control", "no-cache, no-store, max-age=0, must-revalidate"},
     {"date", "Tue, 11 Jan 2022 21:36:34 GMT"},
     {"pragma", "no-cache"},
     {"server", "UploadServer"},
     {"vary", "Origin"},
     {"content-length", "191"},
     {"content-type", "application/json; charset=UTF-8"},
     {"expires", "Mon, 01 Jan 1990 00:00:00 GMT"},
      "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""}
   method: :post,
   opts: [],
   query: [project: "project_id"],
   status: 400,
   url: ""

that is not very descriptive of the problem. I am getting the token with Goth and creating a connection with that but still fails. I suspect it is related to the fact that i am not passing a name to the bucket but i can’t confirm it. the documentation is not very helpfull really. the code is the next one

  def create_bucket() do
    {:ok, token} = Goth.Token.for_scope("")
    conn =

    project_id = "project_Id"

    {:ok, bucket} = Buckets.storage_buckets_insert(conn, project_id)


the project_id is a valid project name extracted from the generated keys of the project in google storage.

Google storage docs say name is a required property in the request body. Buckets: insert  |  Cloud Storage  |  Google Cloud

Could you try passing name to it ?

You can play around with the api from web page itself using “Try this API” section.