Create calendar sync authorization URL
curl --request POST \
--url https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "connect",
"return_url": "https://consumer.younegotiate.com/upcoming-payments"
}
'import requests
url = "https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url"
payload = {
"mode": "connect",
"return_url": "https://consumer.younegotiate.com/upcoming-payments"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: 'connect',
return_url: 'https://consumer.younegotiate.com/upcoming-payments'
})
};
fetch('https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'connect',
'return_url' => 'https://consumer.younegotiate.com/upcoming-payments'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url"
payload := strings.NewReader("{\n \"mode\": \"connect\",\n \"return_url\": \"https://consumer.younegotiate.com/upcoming-payments\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"connect\",\n \"return_url\": \"https://consumer.younegotiate.com/upcoming-payments\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"connect\",\n \"return_url\": \"https://consumer.younegotiate.com/upcoming-payments\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"provider": "google",
"mode": "connect",
"authorization_url": "https://accounts.google.com/o/oauth2/auth?client_id=...",
"expires_in": 600
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"code": "profile_incomplete",
"message": "Please complete your communication profile before viewing accounts.",
"required_steps": [
"profile_communication"
]
}{
"message": "<string>",
"errors": {}
}Create calendar sync authorization URL
Create a short-lived OAuth authorization URL for Google or Microsoft calendar sync. The frontend should redirect the browser to data.authorization_url; after provider approval, the provider calls the public callback endpoint and the backend redirects back to the supplied safe return_url.
POST
/
calendar-sync
/
{provider}
/
authorization-url
Create calendar sync authorization URL
curl --request POST \
--url https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "connect",
"return_url": "https://consumer.younegotiate.com/upcoming-payments"
}
'import requests
url = "https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url"
payload = {
"mode": "connect",
"return_url": "https://consumer.younegotiate.com/upcoming-payments"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: 'connect',
return_url: 'https://consumer.younegotiate.com/upcoming-payments'
})
};
fetch('https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'connect',
'return_url' => 'https://consumer.younegotiate.com/upcoming-payments'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url"
payload := strings.NewReader("{\n \"mode\": \"connect\",\n \"return_url\": \"https://consumer.younegotiate.com/upcoming-payments\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"connect\",\n \"return_url\": \"https://consumer.younegotiate.com/upcoming-payments\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.consumer.younegotiate.com/calendar-sync/{provider}/authorization-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"connect\",\n \"return_url\": \"https://consumer.younegotiate.com/upcoming-payments\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"provider": "google",
"mode": "connect",
"authorization_url": "https://accounts.google.com/o/oauth2/auth?client_id=...",
"expires_in": 600
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"code": "profile_incomplete",
"message": "Please complete your communication profile before viewing accounts.",
"required_steps": [
"profile_communication"
]
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Calendar provider slug.
Available options:
google, microsoft Body
application/json
Available options:
connect, reconnect Example:
"connect"
Optional consumer frontend URL to return to after provider approval. Unsafe origins are ignored and replaced with the configured Upcoming Payments URL.
Maximum string length:
2048Example:
"https://consumer.younegotiate.com/upcoming-payments"
Response
Authorization URL returned.
Show child attributes
Show child attributes
Last modified on July 19, 2026
Was this page helpful?
⌘I

