Skip to content

Marketing skills for Claude Code and AI agents. CRO, copywriting, SEO, analytics, and growth engineering.

fix(savvycal): use documented scheduling link resources

Rudy Celekli7c30bb0fe18a
diff --git a/tests/clis/savvycal-link-resource.test.cjs b/tests/clis/savvycal-link-resource.test.cjs
new file mode 100644
index 0000000..4e05a82
--- /dev/null
+++ b/tests/clis/savvycal-link-resource.test.cjs
@@ -0,0 +1,39 @@
+const { test } = require('node:test')
+const assert = require('node:assert/strict')
+const { spawnSync } = require('node:child_process')
+const path = require('node:path')
+const cli = path.resolve(__dirname, '../../tools/clis/savvycal.js')
+const cases = [
+ { name: 'list', args: ['links', 'list', '--limit', '7', '--after', 'cursor+next'], method: 'GET', resource: '/links?limit=7&after=cursor%2Bnext' },
+ { name: 'get', args: ['links', 'get', '--id', 'owned-link'], method: 'GET', resource: '/links/owned-link' },
+ { name: 'create', args: ['links', 'create', '--name', 'Owned Meeting'], method: 'POST', resource: '/links', body: { name: 'Owned Meeting' } },
+ { name: 'update', args: ['links', 'update', '--id', 'owned-link', '--name', 'Updated Meeting'], method: 'PATCH', resource: '/links/owned-link', body: { name: 'Updated Meeting' } },
+ { name: 'delete', args: ['links', 'delete', '--id', 'owned-link'], method: 'DELETE', resource: '/links/owned-link' },
+ { name: 'duplicate', args: ['links', 'duplicate', '--id', 'owned-link'], method: 'POST', resource: '/links/owned-link/duplicate' },
+ { name: 'toggle', args: ['links', 'toggle', '--id', 'owned-link'], method: 'POST', resource: '/links/owned-link/toggle' },
+ { name: 'slots', args: ['links', 'slots', '--id', 'owned-link'], method: 'GET', resource: '/links/owned-link/slots' },
+]
+function run(args, oracle) {
+ const fixture = `global.fetch=async(url,options)=>{const assert=require('node:assert/strict');${oracle};return new Response(JSON.stringify({data:[{id:'owned-link'}],meta:{after:'next'}}),{status:200})};process.argv=['node',${JSON.stringify(cli)},...${JSON.stringify(args)}];require(${JSON.stringify(cli)});`
+ return spawnSync(process.execPath, ['-e', fixture], { encoding: 'utf8', timeout: 10000, env: { ...process.env, SAVVYCAL_API_KEY: 'fixture-token' } })
+}
+function output(result) { assert.equal(result.status, 0, result.stderr); return JSON.parse(result.stdout) }
+for (const item of cases) {
+ test(`links ${item.name} uses the documented resource and preserves request and response`, () => {
+ const oracle = `assert.equal(url,${JSON.stringify('https://api.savvycal.com/v1' + item.resource)});assert.equal(options.method,${JSON.stringify(item.method)});assert.equal(options.headers.Authorization,'Bearer fixture-token');assert.deepEqual(options.body?JSON.parse(options.body):undefined,${JSON.stringify(item.body) || 'undefined'})`
+ assert.deepEqual(output(run(item.args, oracle)), { data: [{ id: 'owned-link' }], meta: { after: 'next' } })
+ })
+ test(`links ${item.name} previews the same request without network access`, () => {
+ const result = output(run([...item.args, '--dry-run'], "throw new Error('unexpected request')"))
+ assert.equal(result.url, 'https://api.savvycal.com/v1' + item.resource)
+ assert.equal(result.method, item.method)
+ assert.equal(result.headers.Authorization, '***')
+ assert.deepEqual(result.body, item.body)
+ })
+}
+test('current-user discovery retains its existing resource', () => {
+ output(run(['me'], "assert.equal(url,'https://api.savvycal.com/v1/me');assert.equal(options.method,'GET')"))
+})
+test('event reads retain their existing resource', () => {
+ output(run(['events', 'get', '--id', 'owned-event'], "assert.equal(url,'https://api.savvycal.com/v1/events/owned-event');assert.equal(options.method,'GET')"))
+})
diff --git a/tools/clis/savvycal.js b/tools/clis/savvycal.js
index bf5b913..49aab57 100755
--- a/tools/clis/savvycal.js
+++ b/tools/clis/savvycal.js
@@ -69,13 +69,13 @@ async function main() {
params.set('limit', String(limit))
if (args.after) params.set('after', args.after)
if (args.before) params.set('before', args.before)
- result = await api('GET', `/scheduling-links?${params}`)
+ result = await api('GET', `/links?${params}`)
break
}
case 'get': {
const id = args.id
if (!id) { result = { error: '--id required' }; break }
- result = await api('GET', `/scheduling-links/${id}`)
+ result = await api('GET', `/links/${id}`)
break
}
case 'create': {
@@ -84,7 +84,7 @@ async function main() {
const body = { name }
if (args.slug) body.slug = args.slug
if (args.duration) body.duration_minutes = Number(args.duration)
- result = await api('POST', '/scheduling-links', body)
+ result = await api('POST', '/links', body)
break
}
case 'update': {
@@ -94,25 +94,25 @@ async function main() {
if (args.name) body.name = args.name
if (args.slug) body.slug = args.slug
if (args.duration) body.duration_minutes = Number(args.duration)
- result = await api('PATCH', `/scheduling-links/${id}`, body)
+ result = await api('PATCH', `/links/${id}`, body)
break
}
case 'delete': {
const id = args.id
if (!id) { result = { error: '--id required' }; break }
- result = await api('DELETE', `/scheduling-links/${id}`)
+ result = await api('DELETE', `/links/${id}`)
break
}
case 'duplicate': {
const id = args.id
if (!id) { result = { error: '--id required' }; break }
- result = await api('POST', `/scheduling-links/${id}/duplicate`)
+ result = await api('POST', `/links/${id}/duplicate`)
break
}
case 'toggle': {
const id = args.id
if (!id) { result = { error: '--id required' }; break }
- result = await api('POST', `/scheduling-links/${id}/toggle`)
+ result = await api('POST', `/links/${id}/toggle`)
break
}
case 'slots': {
@@ -122,7 +122,7 @@ async function main() {
if (args['start-time']) params.set('start_time', args['start-time'])
if (args['end-time']) params.set('end_time', args['end-time'])
const qs = params.toString()
- result = await api('GET', `/scheduling-links/${id}/slots${qs ? '?' + qs : ''}`)
+ result = await api('GET', `/links/${id}/slots${qs ? '?' + qs : ''}`)
break
}
default:
diff --git a/tools/integrations/savvycal.md b/tools/integrations/savvycal.md
index b355c8e..f1e4c24 100644
--- a/tools/integrations/savvycal.md
+++ b/tools/integrations/savvycal.md
@@ -28,31 +28,31 @@ GET https://api.savvycal.com/v1/me
### List scheduling links
```bash
-GET https://api.savvycal.com/v1/scheduling-links
+GET https://api.savvycal.com/v1/links
```
### Get a scheduling link
```bash
-GET https://api.savvycal.com/v1/scheduling-links/{id}
+GET https://api.savvycal.com/v1/links/{id}
```
### Create a scheduling link
```bash
-POST https://api.savvycal.com/v1/scheduling-links
+POST https://api.savvycal.com/v1/links
{
- "name": "30 Minute Meeting",
- "slug": "30min",
- "duration_minutes": 30
+ "name": "Introductory Meeting"
}
```
+The personal-link endpoint creates a link for the current authenticated user. These examples use the documented `name` field; configure meeting duration and URL details in SavvyCal rather than assuming undocumented request fields take effect.
+
### Update a scheduling link
```bash
-PATCH https://api.savvycal.com/v1/scheduling-links/{id}
+PATCH https://api.savvycal.com/v1/links/{id}
{
"name": "Updated Meeting Name"
@@ -62,25 +62,25 @@ PATCH https://api.savvycal.com/v1/scheduling-links/{id}
### Delete a scheduling link
```bash
-DELETE https://api.savvycal.com/v1/scheduling-links/{id}
+DELETE https://api.savvycal.com/v1/links/{id}
```
### Duplicate a scheduling link
```bash
-POST https://api.savvycal.com/v1/scheduling-links/{id}/duplicate
+POST https://api.savvycal.com/v1/links/{id}/duplicate
```
### Toggle link state (active/disabled)
```bash
-POST https://api.savvycal.com/v1/scheduling-links/{id}/toggle
+POST https://api.savvycal.com/v1/links/{id}/toggle
```
### Get available time slots
```bash
-GET https://api.savvycal.com/v1/scheduling-links/{id}/slots
+GET https://api.savvycal.com/v1/links/{id}/slots
```
### List events
@@ -179,3 +179,9 @@ POST https://api.savvycal.com/v1/webhooks
- sales-automation
- appointment-scheduling
- customer-onboarding
+
+## API References
+
+- [Scheduling-link endpoints](https://developers.savvycal.com/api/scheduling-links)
+- [Create-link request fields](https://developers.savvycal.com/api/schemas/createlinkrequest)
+- [Update-link request fields](https://developers.savvycal.com/api/schemas/updatelinkrequest)