LogoRecal
Rest apiEndpointsV1UsersUserid

Update User

Update a user

PUT
/v1/users/{userId}

Authorization

AuthorizationRequiredBearer <token>

The Recal API token

In: header

Request Body

application/jsonRequired
userIdRequiredstring

Path Parameters

userIdRequiredstring

Response Body

TypeScript Definitions

Use the response body type in TypeScript.

idRequiredstring
createdAtRequiredDate | string | number
organizationsarray<object>
oauthConnectionsarray<object>

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredstring

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredstring
curl -X PUT "https://api.recal.dev/v1/users/string" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "string"
  }'
const body = JSON.stringify({
  "userId": "string"
})

fetch("https://api.recal.dev/v1/users/string", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://api.recal.dev/v1/users/string"
  body := strings.NewReader(`{
    "userId": "string"
  }`)
  req, _ := http.NewRequest("PUT", url, body)
  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.recal.dev/v1/users/string"
body = {
  "userId": "string"
}
response = requests.request("PUT", url, json = body, headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
})

print(response.text)
{
  "id": "user_1234567890",
  "createdAt": "2025-05-03T13:50:25.000Z",
  "organizations": [
    {
      "name": "Recal",
      "slug": "recal",
      "createdAt": "2025-04-24T00:00:00.000Z",
      "members": []
    }
  ],
  "oauthConnections": [
    {
      "provider": "google",
      "accessToken": null,
      "refreshToken": {},
      "email": "user@example.com",
      "expiresAt": {},
      "scope": [
        "string"
      ],
      "alive": true
    }
  ]
}
"User with id custom-id not found"
"User with id new-id already exists"