LogoRecal

Create OAuth Connection

Set the token for the oauth provider

POST
/v1/users/{userId}/oauth/{provider}

Authorization

AuthorizationRequiredBearer <token>

The Recal API token

In: header

Request Body

application/jsonRequired
accessTokenRequiredunknown
refreshTokenstring
scopeRequiredarray<string>
expiresAtDate | string | number
emailstring
Minimum length: 1Maximum length: 256

Path Parameters

userIdRequiredstring
providerRequiredstring

Calendar provider (google or microsoft)

Pattern: "^(google|microsoft)$"

Response Body

TypeScript Definitions

Use the response body type in TypeScript.

providerRequiredstring

Calendar provider (google or microsoft)

Pattern: "^(google|microsoft)$"
accessTokenunknown
refreshTokennull
emailRequiredstring | null | null
expiresAtRequiredDate | null | null
scopeRequiredarray<string>
aliveRequiredboolean

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredstring
curl -X POST "https://api.recal.dev/v1/users/string/oauth/string" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "accessToken": null,
    "refreshToken": "string",
    "scope": [
      "string"
    ],
    "expiresAt": "2025-04-24T00:00:00.000Z",
    "email": "user@example.com"
  }'
const body = JSON.stringify({
  "accessToken": null,
  "refreshToken": "string",
  "scope": [
    "string"
  ],
  "expiresAt": "2025-04-24T00:00:00.000Z",
  "email": "user@example.com"
})

fetch("https://api.recal.dev/v1/users/string/oauth/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/oauth/string"
  body := strings.NewReader(`{
    "accessToken": null,
    "refreshToken": "string",
    "scope": [
      "string"
    ],
    "expiresAt": "2025-04-24T00:00:00.000Z",
    "email": "user@example.com"
  }`)
  req, _ := http.NewRequest("POST", 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/oauth/string"
body = {
  "accessToken": null,
  "refreshToken": "string",
  "scope": [
    "string"
  ],
  "expiresAt": "2025-04-24T00:00:00.000Z",
  "email": "user@example.com"
}
response = requests.request("POST", url, json = body, headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
})

print(response.text)
{
  "provider": "google",
  "accessToken": null,
  "refreshToken": {},
  "email": "user@example.com",
  "expiresAt": {},
  "scope": [
    "string"
  ],
  "alive": true
}
"User not found"