Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

chore: Add bulk link update endpoint to API reference

Kiran K93b383106c44
diff --git a/apps/docs/api-reference/endpoint/bulk-update-links.mdx b/apps/docs/api-reference/endpoint/bulk-update-links.mdx
new file mode 100644
index 0000000000..b7f12c524e
--- /dev/null
+++ b/apps/docs/api-reference/endpoint/bulk-update-links.mdx
@@ -0,0 +1,49 @@
+---
+openapi: patch /links/bulk
+og:title: "Bulk update links with the Dub.co API - API Reference"
+---
+
+<Warning>
+ Bulk link update does not support the following features: [Link
+ cloaking](https://dub.co/help/article/link-cloaking), [Custom social media
+ cards](https://dub.co/help/article/custom-social-media-cards)
+</Warning>
+
+<RequestExample>
+```bash cURL
+curl --request PATCH \
+ --url https://api.dub.co/links/bulk \
+ --header 'Authorization: Bearer {YOUR_TOKEN}' \
+ --header 'Content-Type: application/json' \
+ --data '
+ {
+ linkIds: ["clvtf4l4i0001wlr3c64kh2nk", "clvtf4l4i0001wlr3c64kh2nk"],
+ data: {
+ "domain": "newdomain.com",
+ "tagIds": ["1wlr3c64kh2nkclvtf4l4i000"],
+ }
+ }
+ ...
+ '
+```
+```javascript JavaScript
+const options = {
+ method: 'PATCH',
+ headers: {Authorization: 'Bearer {YOUR_TOKEN}', 'Content-Type': 'application/json'},
+ body: JSON.stringify({
+ linkIds: ["clvtf4l4i0001wlr3c64kh2nk", "clvtf4l4i0001wlr3c64kh2nk"],
+ data: {
+ "domain": "newdomain.com",
+ "tagIds": ["1wlr3c64kh2nkclvtf4l4i000"],
+ }
+ })
+};
+
+fetch('https://api.dub.co/links/bulk', options)
+.then(response => response.json())
+.then(response => console.log(response))
+.catch(err => console.error(err));
+
+```
+</RequestExample>
+```
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index f4bfe43ff0..e93f9eff77 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -115,7 +115,8 @@
"api-reference/endpoint/delete-a-link",
"api-reference/endpoint/retrieve-a-list-of-links",
"api-reference/endpoint/retrieve-number-of-links",
- "api-reference/endpoint/bulk-create-links"
+ "api-reference/endpoint/bulk-create-links",
+ "api-reference/endpoint/bulk-update-links"
]
},
{