forked from dubinc/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi-with-code-samples.yaml
13066 lines (13066 loc) · 523 KB
/
openapi-with-code-samples.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: "3.0.3"
info:
title: "Dub.co API"
description: "Dub is link management infrastructure for companies to create marketing campaigns, link sharing features, and referral programs."
version: "0.0.1"
contact:
name: "Dub.co Support"
email: "[email protected]"
url: "https://dub.co/api"
license:
name: "AGPL-3.0 license"
url: "https://github.com/dubinc/dub/blob/main/LICENSE.md"
servers:
- url: "https://api.dub.co"
description: "Production API"
paths:
"/links":
post:
operationId: "createLink"
x-speakeasy-name-override: "create"
x-speakeasy-usage-example: true
summary: "Create a new link"
x-codeSamples: [{"lang": "typescript", "label": "createLink", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.create();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "createLink", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Create(ctx, &operations.CreateLinkRequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "createLink", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::CreateLinkRequestBody.new(\n url: \"https://google.com\",\n external_id: \"123456\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n)\n \nres = s.links.create(req)\n\nif ! res.link_schema.nil?\n # handle response\nend"}, {"lang": "php", "label": "createLink", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = new Operations\\CreateLinkRequestBody(\n url: 'https://google.com',\n externalId: '123456',\n tagIds: [\n 'clux0rgak00011...',\n ],\n);\n\n$response = $sdk->links->create(\n request: $request\n);\n\nif ($response->linkSchema !== null) {\n // handle response\n}"}, {lang: python, label: createLink, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.create(request={\n \"url\": \"https://google.com\",\n \"external_id\": \"123456\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n})\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"url\\\":\\\"https://google.com\\\",\\\"domain\\\":\\\"string\\\",\\\"key\\\":\\\"string\\\",\\\"externalId\\\":\\\"123456\\\",\\\"prefix\\\":\\\"string\\\",\\\"trackConversion\\\":false,\\\"identifier\\\":\\\"string\\\",\\\"archived\\\":false,\\\"publicStats\\\":false,\\\"tagIds\\\":\\\"string\\\",\\\"tagNames\\\":\\\"string\\\",\\\"comments\\\":\\\"string\\\",\\\"expiresAt\\\":\\\"string\\\",\\\"expiredUrl\\\":\\\"string\\\",\\\"password\\\":\\\"string\\\",\\\"proxy\\\":false,\\\"title\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"image\\\":\\\"string\\\",\\\"video\\\":\\\"string\\\",\\\"rewrite\\\":false,\\\"ios\\\":\\\"string\\\",\\\"android\\\":\\\"string\\\",\\\"geo\\\":{\\\"AF\\\":\\\"string\\\",\\\"AL\\\":\\\"string\\\",\\\"DZ\\\":\\\"string\\\",\\\"AS\\\":\\\"string\\\",\\\"AD\\\":\\\"string\\\",\\\"AO\\\":\\\"string\\\",\\\"AI\\\":\\\"string\\\",\\\"AQ\\\":\\\"string\\\",\\\"AG\\\":\\\"string\\\",\\\"AR\\\":\\\"string\\\",\\\"AM\\\":\\\"string\\\",\\\"AW\\\":\\\"string\\\",\\\"AU\\\":\\\"string\\\",\\\"AT\\\":\\\"string\\\",\\\"AZ\\\":\\\"string\\\",\\\"BS\\\":\\\"string\\\",\\\"BH\\\":\\\"string\\\",\\\"BD\\\":\\\"string\\\",\\\"BB\\\":\\\"string\\\",\\\"BY\\\":\\\"string\\\",\\\"BE\\\":\\\"string\\\",\\\"BZ\\\":\\\"string\\\",\\\"BJ\\\":\\\"string\\\",\\\"BM\\\":\\\"string\\\",\\\"BT\\\":\\\"string\\\",\\\"BO\\\":\\\"string\\\",\\\"BA\\\":\\\"string\\\",\\\"BW\\\":\\\"string\\\",\\\"BV\\\":\\\"string\\\",\\\"BR\\\":\\\"string\\\",\\\"IO\\\":\\\"string\\\",\\\"BN\\\":\\\"string\\\",\\\"BG\\\":\\\"string\\\",\\\"BF\\\":\\\"string\\\",\\\"BI\\\":\\\"string\\\",\\\"KH\\\":\\\"string\\\",\\\"CM\\\":\\\"string\\\",\\\"CA\\\":\\\"string\\\",\\\"CV\\\":\\\"string\\\",\\\"KY\\\":\\\"string\\\",\\\"CF\\\":\\\"string\\\",\\\"TD\\\":\\\"string\\\",\\\"CL\\\":\\\"string\\\",\\\"CN\\\":\\\"string\\\",\\\"CX\\\":\\\"string\\\",\\\"CC\\\":\\\"string\\\",\\\"CO\\\":\\\"string\\\",\\\"KM\\\":\\\"string\\\",\\\"CG\\\":\\\"string\\\",\\\"CD\\\":\\\"string\\\",\\\"CK\\\":\\\"string\\\",\\\"CR\\\":\\\"string\\\",\\\"CI\\\":\\\"string\\\",\\\"HR\\\":\\\"string\\\",\\\"CU\\\":\\\"string\\\",\\\"CY\\\":\\\"string\\\",\\\"CZ\\\":\\\"string\\\",\\\"DK\\\":\\\"string\\\",\\\"DJ\\\":\\\"string\\\",\\\"DM\\\":\\\"string\\\",\\\"DO\\\":\\\"string\\\",\\\"EC\\\":\\\"string\\\",\\\"EG\\\":\\\"string\\\",\\\"SV\\\":\\\"string\\\",\\\"GQ\\\":\\\"string\\\",\\\"ER\\\":\\\"string\\\",\\\"EE\\\":\\\"string\\\",\\\"ET\\\":\\\"string\\\",\\\"FK\\\":\\\"string\\\",\\\"FO\\\":\\\"string\\\",\\\"FJ\\\":\\\"string\\\",\\\"FI\\\":\\\"string\\\",\\\"FR\\\":\\\"string\\\",\\\"GF\\\":\\\"string\\\",\\\"PF\\\":\\\"string\\\",\\\"TF\\\":\\\"string\\\",\\\"GA\\\":\\\"string\\\",\\\"GM\\\":\\\"string\\\",\\\"GE\\\":\\\"string\\\",\\\"DE\\\":\\\"string\\\",\\\"GH\\\":\\\"string\\\",\\\"GI\\\":\\\"string\\\",\\\"GR\\\":\\\"string\\\",\\\"GL\\\":\\\"string\\\",\\\"GD\\\":\\\"string\\\",\\\"GP\\\":\\\"string\\\",\\\"GU\\\":\\\"string\\\",\\\"GT\\\":\\\"string\\\",\\\"GN\\\":\\\"string\\\",\\\"GW\\\":\\\"string\\\",\\\"GY\\\":\\\"string\\\",\\\"HT\\\":\\\"string\\\",\\\"HM\\\":\\\"string\\\",\\\"VA\\\":\\\"string\\\",\\\"HN\\\":\\\"string\\\",\\\"HK\\\":\\\"string\\\",\\\"HU\\\":\\\"string\\\",\\\"IS\\\":\\\"string\\\",\\\"IN\\\":\\\"string\\\",\\\"ID\\\":\\\"string\\\",\\\"IR\\\":\\\"string\\\",\\\"IQ\\\":\\\"string\\\",\\\"IE\\\":\\\"string\\\",\\\"IL\\\":\\\"string\\\",\\\"IT\\\":\\\"string\\\",\\\"JM\\\":\\\"string\\\",\\\"JP\\\":\\\"string\\\",\\\"JO\\\":\\\"string\\\",\\\"KZ\\\":\\\"string\\\",\\\"KE\\\":\\\"string\\\",\\\"KI\\\":\\\"string\\\",\\\"KP\\\":\\\"string\\\",\\\"KR\\\":\\\"string\\\",\\\"KW\\\":\\\"string\\\",\\\"KG\\\":\\\"string\\\",\\\"LA\\\":\\\"string\\\",\\\"LV\\\":\\\"string\\\",\\\"LB\\\":\\\"string\\\",\\\"LS\\\":\\\"string\\\",\\\"LR\\\":\\\"string\\\",\\\"LY\\\":\\\"string\\\",\\\"LI\\\":\\\"string\\\",\\\"LT\\\":\\\"string\\\",\\\"LU\\\":\\\"string\\\",\\\"MO\\\":\\\"string\\\",\\\"MG\\\":\\\"string\\\",\\\"MW\\\":\\\"string\\\",\\\"MY\\\":\\\"string\\\",\\\"MV\\\":\\\"string\\\",\\\"ML\\\":\\\"string\\\",\\\"MT\\\":\\\"string\\\",\\\"MH\\\":\\\"string\\\",\\\"MQ\\\":\\\"string\\\",\\\"MR\\\":\\\"string\\\",\\\"MU\\\":\\\"string\\\",\\\"YT\\\":\\\"string\\\",\\\"MX\\\":\\\"string\\\",\\\"FM\\\":\\\"string\\\",\\\"MD\\\":\\\"string\\\",\\\"MC\\\":\\\"string\\\",\\\"MN\\\":\\\"string\\\",\\\"MS\\\":\\\"string\\\",\\\"MA\\\":\\\"string\\\",\\\"MZ\\\":\\\"string\\\",\\\"MM\\\":\\\"string\\\",\\\"NA\\\":\\\"string\\\",\\\"NR\\\":\\\"string\\\",\\\"NP\\\":\\\"string\\\",\\\"NL\\\":\\\"string\\\",\\\"NC\\\":\\\"string\\\",\\\"NZ\\\":\\\"string\\\",\\\"NI\\\":\\\"string\\\",\\\"NE\\\":\\\"string\\\",\\\"NG\\\":\\\"string\\\",\\\"NU\\\":\\\"string\\\",\\\"NF\\\":\\\"string\\\",\\\"MK\\\":\\\"string\\\",\\\"MP\\\":\\\"string\\\",\\\"NO\\\":\\\"string\\\",\\\"OM\\\":\\\"string\\\",\\\"PK\\\":\\\"string\\\",\\\"PW\\\":\\\"string\\\",\\\"PS\\\":\\\"string\\\",\\\"PA\\\":\\\"string\\\",\\\"PG\\\":\\\"string\\\",\\\"PY\\\":\\\"string\\\",\\\"PE\\\":\\\"string\\\",\\\"PH\\\":\\\"string\\\",\\\"PN\\\":\\\"string\\\",\\\"PL\\\":\\\"string\\\",\\\"PT\\\":\\\"string\\\",\\\"PR\\\":\\\"string\\\",\\\"QA\\\":\\\"string\\\",\\\"RE\\\":\\\"string\\\",\\\"RO\\\":\\\"string\\\",\\\"RU\\\":\\\"string\\\",\\\"RW\\\":\\\"string\\\",\\\"SH\\\":\\\"string\\\",\\\"KN\\\":\\\"string\\\",\\\"LC\\\":\\\"string\\\",\\\"PM\\\":\\\"string\\\",\\\"VC\\\":\\\"string\\\",\\\"WS\\\":\\\"string\\\",\\\"SM\\\":\\\"string\\\",\\\"ST\\\":\\\"string\\\",\\\"SA\\\":\\\"string\\\",\\\"SN\\\":\\\"string\\\",\\\"SC\\\":\\\"string\\\",\\\"SL\\\":\\\"string\\\",\\\"SG\\\":\\\"string\\\",\\\"SK\\\":\\\"string\\\",\\\"SI\\\":\\\"string\\\",\\\"SB\\\":\\\"string\\\",\\\"SO\\\":\\\"string\\\",\\\"ZA\\\":\\\"string\\\",\\\"GS\\\":\\\"string\\\",\\\"ES\\\":\\\"string\\\",\\\"LK\\\":\\\"string\\\",\\\"SD\\\":\\\"string\\\",\\\"SR\\\":\\\"string\\\",\\\"SJ\\\":\\\"string\\\",\\\"SZ\\\":\\\"string\\\",\\\"SE\\\":\\\"string\\\",\\\"CH\\\":\\\"string\\\",\\\"SY\\\":\\\"string\\\",\\\"TW\\\":\\\"string\\\",\\\"TJ\\\":\\\"string\\\",\\\"TZ\\\":\\\"string\\\",\\\"TH\\\":\\\"string\\\",\\\"TL\\\":\\\"string\\\",\\\"TG\\\":\\\"string\\\",\\\"TK\\\":\\\"string\\\",\\\"TO\\\":\\\"string\\\",\\\"TT\\\":\\\"string\\\",\\\"TN\\\":\\\"string\\\",\\\"TR\\\":\\\"string\\\",\\\"TM\\\":\\\"string\\\",\\\"TC\\\":\\\"string\\\",\\\"TV\\\":\\\"string\\\",\\\"UG\\\":\\\"string\\\",\\\"UA\\\":\\\"string\\\",\\\"AE\\\":\\\"string\\\",\\\"GB\\\":\\\"string\\\",\\\"US\\\":\\\"string\\\",\\\"UM\\\":\\\"string\\\",\\\"UY\\\":\\\"string\\\",\\\"UZ\\\":\\\"string\\\",\\\"VU\\\":\\\"string\\\",\\\"VE\\\":\\\"string\\\",\\\"VN\\\":\\\"string\\\",\\\"VG\\\":\\\"string\\\",\\\"VI\\\":\\\"string\\\",\\\"WF\\\":\\\"string\\\",\\\"EH\\\":\\\"string\\\",\\\"YE\\\":\\\"string\\\",\\\"ZM\\\":\\\"string\\\",\\\"ZW\\\":\\\"string\\\",\\\"AX\\\":\\\"string\\\",\\\"BQ\\\":\\\"string\\\",\\\"CW\\\":\\\"string\\\",\\\"GG\\\":\\\"string\\\",\\\"IM\\\":\\\"string\\\",\\\"JE\\\":\\\"string\\\",\\\"ME\\\":\\\"string\\\",\\\"BL\\\":\\\"string\\\",\\\"MF\\\":\\\"string\\\",\\\"RS\\\":\\\"string\\\",\\\"SX\\\":\\\"string\\\",\\\"SS\\\":\\\"string\\\",\\\"XK\\\":\\\"string\\\"},\\\"doIndex\\\":false,\\\"utm_source\\\":\\\"string\\\",\\\"utm_medium\\\":\\\"string\\\",\\\"utm_campaign\\\":\\\"string\\\",\\\"utm_term\\\":\\\"string\\\",\\\"utm_content\\\":\\\"string\\\",\\\"ref\\\":\\\"string\\\"}\");\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links\")\n .post(body)\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Create a new link for the authenticated workspace."
tags:
- "Links"
security:
- token: []
requestBody:
content:
"application/json":
schema:
type: "object"
properties:
"url":
type: "string"
description: "The destination URL of the short link."
example: "https://google.com"
"domain":
type: "string"
maxLength: 190
description: "The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."
"key":
type: "string"
maxLength: 190
description: "The short link slug. If not provided, a random 7-character slug will be generated."
"externalId":
type: "string"
nullable: true
minLength: 1
maxLength: 255
description: "This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter."
example: "123456"
"prefix":
type: "string"
description: "The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."
"trackConversion":
type: "boolean"
default: false
description: "Whether to track conversions for the short link."
"identifier":
type: "string"
nullable: true
description: "The identifier of the short link that is unique across your workspace. If set, it can be used to identify your short link for client-side click tracking."
"archived":
type: "boolean"
default: false
description: "Whether the short link is archived."
"publicStats":
type: "boolean"
default: false
description: "Whether the short link's stats are publicly accessible."
"tagId":
type: "string"
nullable: true
description: "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead."
deprecated: true
"tagIds":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique IDs of the tags assigned to the short link."
example: ["clux0rgak00011..."]
"tagNames":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique name of the tags assigned to the short link (case insensitive)."
"comments":
type: "string"
nullable: true
description: "The comments for the short link."
"expiresAt":
type: "string"
nullable: true
description: "The date and time when the short link will expire at."
"expiredUrl":
type: "string"
nullable: true
description: "The URL to redirect to when the short link has expired."
"password":
type: "string"
nullable: true
description: "The password required to access the destination URL of the short link."
"proxy":
type: "boolean"
default: false
description: "Whether the short link uses Custom Social Media Cards feature."
"title":
type: "string"
nullable: true
description: "The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"description":
type: "string"
nullable: true
description: "The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"image":
type: "string"
nullable: true
description: "The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"video":
type: "string"
nullable: true
description: "The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"rewrite":
type: "boolean"
default: false
description: "Whether the short link uses link cloaking."
"ios":
type: "string"
nullable: true
description: "The iOS destination URL for the short link for iOS device targeting."
"android":
type: "string"
nullable: true
description: "The Android destination URL for the short link for Android device targeting."
"geo": {"$ref": "#/components/schemas/linkGeoTargeting"}
"doIndex":
type: "boolean"
default: false
description: "Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"
"utm_source":
type: "string"
nullable: true
description: "The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."
"utm_medium":
type: "string"
nullable: true
description: "The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."
"utm_campaign":
type: "string"
nullable: true
description: "The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."
"utm_term":
type: "string"
nullable: true
description: "The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."
"utm_content":
type: "string"
nullable: true
description: "The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."
"ref":
type: "string"
nullable: true
description: "The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."
required:
- "url"
responses:
"200":
description: "The created link"
content:
"application/json":
schema: {"$ref": "#/components/schemas/LinkSchema"}
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
get:
operationId: "getLinks"
x-speakeasy-name-override: "list"
x-speakeasy-pagination: {"type": "offsetLimit", "inputs": [{"name": "page", "in": "parameters", "type": "page"}, {"name": "pageSize", "in": "parameters", "type": "limit"}], "outputs": {"results": "$"}}
x-codeSamples: [{"lang": "typescript", "label": "getLinks", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"}, {"lang": "go", "label": "getLinks", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.List(ctx, operations.GetLinksRequest{\n Page: dubgo.Float64(1),\n PageSize: dubgo.Float64(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n for {\n // handle items\n \n res, err = res.Next()\n \n if err != nil {\n // handle error\n }\n \n if res == nil {\n break\n }\n }\n \n }\n}"}, {"lang": "ruby", "label": "getLinks", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::GetLinksRequest.new(\n page: 1.0,\n page_size: 50.0,\n)\n \nres = s.links.list(req)\n\nif ! res.link_schemas.nil?\n # handle response\nend"}, {"lang": "php", "label": "getLinks", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = new Operations\\GetLinksRequest(\n page: 1,\n pageSize: 50,\n);\n\n$response = $sdk->links->list(\n request: $request\n);\n\nif ($response->linkSchemas !== null) {\n // handle response\n}"}, {lang: python, label: getLinks, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.list(request={\n \"page\": 1,\n \"page_size\": 50,\n})\n\nif res is not None:\n while True:\n # handle items\n\n res = res.next()\n if res is None:\n break"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
summary: "Retrieve a list of links"
description: "Retrieve a paginated list of links for the authenticated workspace."
tags:
- "Links"
security:
- token: []
parameters:
- in: "query"
name: "domain"
description: "The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."
schema:
type: "string"
description: "The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."
- in: "query"
name: "tagId"
description: "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead."
schema:
type: "string"
description: "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead."
deprecated: true
- in: "query"
name: "tagIds"
description: "The tag IDs to filter the links by."
schema:
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The tag IDs to filter the links by."
- in: "query"
name: "tagNames"
description: "The unique name of the tags assigned to the short link (case insensitive)."
schema:
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique name of the tags assigned to the short link (case insensitive)."
- in: "query"
name: "search"
description: "The search term to filter the links by. The search term will be matched against the short link slug and the destination url."
schema:
type: "string"
description: "The search term to filter the links by. The search term will be matched against the short link slug and the destination url."
- in: "query"
name: "userId"
description: "The user ID to filter the links by."
schema:
type: "string"
description: "The user ID to filter the links by."
- in: "query"
name: "showArchived"
description: "Whether to include archived links in the response. Defaults to `false` if not provided."
schema:
type: "boolean"
default: "false"
description: "Whether to include archived links in the response. Defaults to `false` if not provided."
- in: "query"
name: "withTags"
description: "Whether to include tags in the response. Defaults to `false` if not provided."
schema:
type: "boolean"
default: "false"
description: "Whether to include tags in the response. Defaults to `false` if not provided."
- in: "query"
name: "sort"
description: "The field to sort the links by. The default is `createdAt`, and sort order is always descending."
schema:
type: "string"
enum:
- "createdAt"
- "clicks"
- "lastClicked"
default: "createdAt"
description: "The field to sort the links by. The default is `createdAt`, and sort order is always descending."
- in: "query"
name: "page"
description: "The page number for pagination."
schema:
type: "number"
minimum: 0
exclusiveMinimum: true
default: 1
description: "The page number for pagination."
example: 1
- in: "query"
name: "pageSize"
description: "The number of items per page."
schema:
type: "number"
minimum: 0
exclusiveMinimum: true
maximum: 100
default: 100
description: "The number of items per page."
example: 50
responses:
"200":
description: "A list of links"
content:
"application/json":
schema:
type: "array"
items: {"$ref": "#/components/schemas/LinkSchema"}
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
"/links/count":
get:
operationId: "getLinksCount"
x-speakeasy-name-override: "count"
summary: "Retrieve links count"
x-codeSamples: [{"lang": "typescript", "label": "getLinksCount", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.count();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "getLinksCount", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Count(ctx, operations.GetLinksCountRequest{})\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "getLinksCount", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::GetLinksCountRequest.new()\n \nres = s.links.count(req)\n\nif ! res.number.nil?\n # handle response\nend"}, {"lang": "php", "label": "getLinksCount", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = new Operations\\GetLinksCountRequest();\n\n$response = $sdk->links->count(\n request: $request\n);\n\nif ($response->number !== null) {\n // handle response\n}"}, {lang: python, label: getLinksCount, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.count(request={})\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links/count\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Retrieve the number of links for the authenticated workspace."
tags:
- "Links"
security:
- token: []
parameters:
- in: "query"
name: "domain"
description: "The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."
schema:
type: "string"
description: "The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."
- in: "query"
name: "tagId"
description: "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead."
schema:
type: "string"
description: "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead."
deprecated: true
- in: "query"
name: "tagIds"
description: "The tag IDs to filter the links by."
schema:
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The tag IDs to filter the links by."
- in: "query"
name: "tagNames"
description: "The unique name of the tags assigned to the short link (case insensitive)."
schema:
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique name of the tags assigned to the short link (case insensitive)."
- in: "query"
name: "search"
description: "The search term to filter the links by. The search term will be matched against the short link slug and the destination url."
schema:
type: "string"
description: "The search term to filter the links by. The search term will be matched against the short link slug and the destination url."
- in: "query"
name: "userId"
description: "The user ID to filter the links by."
schema:
type: "string"
description: "The user ID to filter the links by."
- in: "query"
name: "showArchived"
description: "Whether to include archived links in the response. Defaults to `false` if not provided."
schema:
type: "boolean"
default: "false"
description: "Whether to include archived links in the response. Defaults to `false` if not provided."
- in: "query"
name: "withTags"
description: "Whether to include tags in the response. Defaults to `false` if not provided."
schema:
type: "boolean"
default: "false"
description: "Whether to include tags in the response. Defaults to `false` if not provided."
- in: "query"
name: "groupBy"
description: "The field to group the links by."
schema:
anyOf:
- type: "string"
enum:
- "domain"
- type: "string"
enum:
- "tagId"
- type: "string"
enum:
- "userId"
description: "The field to group the links by."
responses:
"200":
description: "A list of links"
content:
"application/json":
schema:
type: "number"
description: "The number of links matching the query."
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
"/links/info":
get:
operationId: "getLinkInfo"
x-speakeasy-name-override: "get"
summary: "Retrieve a link"
x-codeSamples: [{"lang": "typescript", "label": "getLinkInfo", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.get();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "getLinkInfo", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Get(ctx, operations.GetLinkInfoRequest{\n LinkID: dubgo.String(\"clux0rgak00011...\"),\n ExternalID: dubgo.String(\"123456\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "getLinkInfo", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::GetLinkInfoRequest.new(\n link_id: \"clux0rgak00011...\",\n external_id: \"123456\",\n)\n \nres = s.links.get(req)\n\nif ! res.link_schema.nil?\n # handle response\nend"}, {"lang": "php", "label": "getLinkInfo", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n\n\n$response = $sdk->links->get(\n domain: 'rural-mathematics.name',\n key: '<key>',\n linkId: 'clux0rgak00011...',\n externalId: '123456'\n\n);\n\nif ($response->linkSchema !== null) {\n // handle response\n}"}, {lang: python, label: getLinkInfo, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.get(request={\n \"link_id\": \"clux0rgak00011...\",\n \"external_id\": \"123456\",\n})\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links/info\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Retrieve the info for a link."
tags:
- "Links"
security:
- token: []
parameters:
- in: "query"
name: "domain"
schema:
type: "string"
minLength: 1
description: "The domain of the link to retrieve. E.g. for `d.to/github`, the domain is `d.to`."
- in: "query"
name: "key"
description: "The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`."
schema:
type: "string"
minLength: 1
description: "The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`."
- in: "query"
name: "linkId"
description: "The unique ID of the short link."
schema:
type: "string"
description: "The unique ID of the short link."
example: "clux0rgak00011..."
- in: "query"
name: "externalId"
description: "This is the ID of the link in the your database."
schema:
type: "string"
description: "This is the ID of the link in the your database."
example: "123456"
responses:
"200":
description: "The retrieved link"
content:
"application/json":
schema: {"$ref": "#/components/schemas/LinkSchema"}
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
"/links/{linkId}":
patch:
operationId: "updateLink"
x-speakeasy-name-override: "update"
x-speakeasy-max-method-params: 2
summary: "Update a link"
x-codeSamples: [{"lang": "typescript", "label": "updateLink", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.update(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "updateLink", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Update(ctx, \"<id>\", &operations.UpdateLinkRequestBody{\n URL: dubgo.String(\"https://google.com\"),\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateUpdateLinkTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "updateLink", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n \nres = s.links.update(link_id=\"<id>\", request_body=::OpenApiSDK::Operations::UpdateLinkRequestBody.new(\n url: \"https://google.com\",\n external_id: \"123456\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n))\n\nif ! res.link_schema.nil?\n # handle response\nend"}, {"lang": "php", "label": "updateLink", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$requestBody = new Operations\\UpdateLinkRequestBody(\n url: 'https://google.com',\n externalId: '123456',\n tagIds: [\n 'clux0rgak00011...',\n ],\n);\n\n$response = $sdk->links->update(\n linkId: '<id>',\n requestBody: $requestBody\n\n);\n\nif ($response->linkSchema !== null) {\n // handle response\n}"}, {lang: python, label: updateLink, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.update(link_id=\"<id>\", request_body={\n \"url\": \"https://google.com\",\n \"external_id\": \"123456\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n})\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"url\\\":\\\"https://google.com\\\",\\\"domain\\\":\\\"string\\\",\\\"key\\\":\\\"string\\\",\\\"externalId\\\":\\\"123456\\\",\\\"prefix\\\":\\\"string\\\",\\\"trackConversion\\\":false,\\\"identifier\\\":\\\"string\\\",\\\"archived\\\":false,\\\"publicStats\\\":false,\\\"tagIds\\\":\\\"string\\\",\\\"tagNames\\\":\\\"string\\\",\\\"comments\\\":\\\"string\\\",\\\"expiresAt\\\":\\\"string\\\",\\\"expiredUrl\\\":\\\"string\\\",\\\"password\\\":\\\"string\\\",\\\"proxy\\\":false,\\\"title\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"image\\\":\\\"string\\\",\\\"video\\\":\\\"string\\\",\\\"rewrite\\\":false,\\\"ios\\\":\\\"string\\\",\\\"android\\\":\\\"string\\\",\\\"geo\\\":{\\\"AF\\\":\\\"string\\\",\\\"AL\\\":\\\"string\\\",\\\"DZ\\\":\\\"string\\\",\\\"AS\\\":\\\"string\\\",\\\"AD\\\":\\\"string\\\",\\\"AO\\\":\\\"string\\\",\\\"AI\\\":\\\"string\\\",\\\"AQ\\\":\\\"string\\\",\\\"AG\\\":\\\"string\\\",\\\"AR\\\":\\\"string\\\",\\\"AM\\\":\\\"string\\\",\\\"AW\\\":\\\"string\\\",\\\"AU\\\":\\\"string\\\",\\\"AT\\\":\\\"string\\\",\\\"AZ\\\":\\\"string\\\",\\\"BS\\\":\\\"string\\\",\\\"BH\\\":\\\"string\\\",\\\"BD\\\":\\\"string\\\",\\\"BB\\\":\\\"string\\\",\\\"BY\\\":\\\"string\\\",\\\"BE\\\":\\\"string\\\",\\\"BZ\\\":\\\"string\\\",\\\"BJ\\\":\\\"string\\\",\\\"BM\\\":\\\"string\\\",\\\"BT\\\":\\\"string\\\",\\\"BO\\\":\\\"string\\\",\\\"BA\\\":\\\"string\\\",\\\"BW\\\":\\\"string\\\",\\\"BV\\\":\\\"string\\\",\\\"BR\\\":\\\"string\\\",\\\"IO\\\":\\\"string\\\",\\\"BN\\\":\\\"string\\\",\\\"BG\\\":\\\"string\\\",\\\"BF\\\":\\\"string\\\",\\\"BI\\\":\\\"string\\\",\\\"KH\\\":\\\"string\\\",\\\"CM\\\":\\\"string\\\",\\\"CA\\\":\\\"string\\\",\\\"CV\\\":\\\"string\\\",\\\"KY\\\":\\\"string\\\",\\\"CF\\\":\\\"string\\\",\\\"TD\\\":\\\"string\\\",\\\"CL\\\":\\\"string\\\",\\\"CN\\\":\\\"string\\\",\\\"CX\\\":\\\"string\\\",\\\"CC\\\":\\\"string\\\",\\\"CO\\\":\\\"string\\\",\\\"KM\\\":\\\"string\\\",\\\"CG\\\":\\\"string\\\",\\\"CD\\\":\\\"string\\\",\\\"CK\\\":\\\"string\\\",\\\"CR\\\":\\\"string\\\",\\\"CI\\\":\\\"string\\\",\\\"HR\\\":\\\"string\\\",\\\"CU\\\":\\\"string\\\",\\\"CY\\\":\\\"string\\\",\\\"CZ\\\":\\\"string\\\",\\\"DK\\\":\\\"string\\\",\\\"DJ\\\":\\\"string\\\",\\\"DM\\\":\\\"string\\\",\\\"DO\\\":\\\"string\\\",\\\"EC\\\":\\\"string\\\",\\\"EG\\\":\\\"string\\\",\\\"SV\\\":\\\"string\\\",\\\"GQ\\\":\\\"string\\\",\\\"ER\\\":\\\"string\\\",\\\"EE\\\":\\\"string\\\",\\\"ET\\\":\\\"string\\\",\\\"FK\\\":\\\"string\\\",\\\"FO\\\":\\\"string\\\",\\\"FJ\\\":\\\"string\\\",\\\"FI\\\":\\\"string\\\",\\\"FR\\\":\\\"string\\\",\\\"GF\\\":\\\"string\\\",\\\"PF\\\":\\\"string\\\",\\\"TF\\\":\\\"string\\\",\\\"GA\\\":\\\"string\\\",\\\"GM\\\":\\\"string\\\",\\\"GE\\\":\\\"string\\\",\\\"DE\\\":\\\"string\\\",\\\"GH\\\":\\\"string\\\",\\\"GI\\\":\\\"string\\\",\\\"GR\\\":\\\"string\\\",\\\"GL\\\":\\\"string\\\",\\\"GD\\\":\\\"string\\\",\\\"GP\\\":\\\"string\\\",\\\"GU\\\":\\\"string\\\",\\\"GT\\\":\\\"string\\\",\\\"GN\\\":\\\"string\\\",\\\"GW\\\":\\\"string\\\",\\\"GY\\\":\\\"string\\\",\\\"HT\\\":\\\"string\\\",\\\"HM\\\":\\\"string\\\",\\\"VA\\\":\\\"string\\\",\\\"HN\\\":\\\"string\\\",\\\"HK\\\":\\\"string\\\",\\\"HU\\\":\\\"string\\\",\\\"IS\\\":\\\"string\\\",\\\"IN\\\":\\\"string\\\",\\\"ID\\\":\\\"string\\\",\\\"IR\\\":\\\"string\\\",\\\"IQ\\\":\\\"string\\\",\\\"IE\\\":\\\"string\\\",\\\"IL\\\":\\\"string\\\",\\\"IT\\\":\\\"string\\\",\\\"JM\\\":\\\"string\\\",\\\"JP\\\":\\\"string\\\",\\\"JO\\\":\\\"string\\\",\\\"KZ\\\":\\\"string\\\",\\\"KE\\\":\\\"string\\\",\\\"KI\\\":\\\"string\\\",\\\"KP\\\":\\\"string\\\",\\\"KR\\\":\\\"string\\\",\\\"KW\\\":\\\"string\\\",\\\"KG\\\":\\\"string\\\",\\\"LA\\\":\\\"string\\\",\\\"LV\\\":\\\"string\\\",\\\"LB\\\":\\\"string\\\",\\\"LS\\\":\\\"string\\\",\\\"LR\\\":\\\"string\\\",\\\"LY\\\":\\\"string\\\",\\\"LI\\\":\\\"string\\\",\\\"LT\\\":\\\"string\\\",\\\"LU\\\":\\\"string\\\",\\\"MO\\\":\\\"string\\\",\\\"MG\\\":\\\"string\\\",\\\"MW\\\":\\\"string\\\",\\\"MY\\\":\\\"string\\\",\\\"MV\\\":\\\"string\\\",\\\"ML\\\":\\\"string\\\",\\\"MT\\\":\\\"string\\\",\\\"MH\\\":\\\"string\\\",\\\"MQ\\\":\\\"string\\\",\\\"MR\\\":\\\"string\\\",\\\"MU\\\":\\\"string\\\",\\\"YT\\\":\\\"string\\\",\\\"MX\\\":\\\"string\\\",\\\"FM\\\":\\\"string\\\",\\\"MD\\\":\\\"string\\\",\\\"MC\\\":\\\"string\\\",\\\"MN\\\":\\\"string\\\",\\\"MS\\\":\\\"string\\\",\\\"MA\\\":\\\"string\\\",\\\"MZ\\\":\\\"string\\\",\\\"MM\\\":\\\"string\\\",\\\"NA\\\":\\\"string\\\",\\\"NR\\\":\\\"string\\\",\\\"NP\\\":\\\"string\\\",\\\"NL\\\":\\\"string\\\",\\\"NC\\\":\\\"string\\\",\\\"NZ\\\":\\\"string\\\",\\\"NI\\\":\\\"string\\\",\\\"NE\\\":\\\"string\\\",\\\"NG\\\":\\\"string\\\",\\\"NU\\\":\\\"string\\\",\\\"NF\\\":\\\"string\\\",\\\"MK\\\":\\\"string\\\",\\\"MP\\\":\\\"string\\\",\\\"NO\\\":\\\"string\\\",\\\"OM\\\":\\\"string\\\",\\\"PK\\\":\\\"string\\\",\\\"PW\\\":\\\"string\\\",\\\"PS\\\":\\\"string\\\",\\\"PA\\\":\\\"string\\\",\\\"PG\\\":\\\"string\\\",\\\"PY\\\":\\\"string\\\",\\\"PE\\\":\\\"string\\\",\\\"PH\\\":\\\"string\\\",\\\"PN\\\":\\\"string\\\",\\\"PL\\\":\\\"string\\\",\\\"PT\\\":\\\"string\\\",\\\"PR\\\":\\\"string\\\",\\\"QA\\\":\\\"string\\\",\\\"RE\\\":\\\"string\\\",\\\"RO\\\":\\\"string\\\",\\\"RU\\\":\\\"string\\\",\\\"RW\\\":\\\"string\\\",\\\"SH\\\":\\\"string\\\",\\\"KN\\\":\\\"string\\\",\\\"LC\\\":\\\"string\\\",\\\"PM\\\":\\\"string\\\",\\\"VC\\\":\\\"string\\\",\\\"WS\\\":\\\"string\\\",\\\"SM\\\":\\\"string\\\",\\\"ST\\\":\\\"string\\\",\\\"SA\\\":\\\"string\\\",\\\"SN\\\":\\\"string\\\",\\\"SC\\\":\\\"string\\\",\\\"SL\\\":\\\"string\\\",\\\"SG\\\":\\\"string\\\",\\\"SK\\\":\\\"string\\\",\\\"SI\\\":\\\"string\\\",\\\"SB\\\":\\\"string\\\",\\\"SO\\\":\\\"string\\\",\\\"ZA\\\":\\\"string\\\",\\\"GS\\\":\\\"string\\\",\\\"ES\\\":\\\"string\\\",\\\"LK\\\":\\\"string\\\",\\\"SD\\\":\\\"string\\\",\\\"SR\\\":\\\"string\\\",\\\"SJ\\\":\\\"string\\\",\\\"SZ\\\":\\\"string\\\",\\\"SE\\\":\\\"string\\\",\\\"CH\\\":\\\"string\\\",\\\"SY\\\":\\\"string\\\",\\\"TW\\\":\\\"string\\\",\\\"TJ\\\":\\\"string\\\",\\\"TZ\\\":\\\"string\\\",\\\"TH\\\":\\\"string\\\",\\\"TL\\\":\\\"string\\\",\\\"TG\\\":\\\"string\\\",\\\"TK\\\":\\\"string\\\",\\\"TO\\\":\\\"string\\\",\\\"TT\\\":\\\"string\\\",\\\"TN\\\":\\\"string\\\",\\\"TR\\\":\\\"string\\\",\\\"TM\\\":\\\"string\\\",\\\"TC\\\":\\\"string\\\",\\\"TV\\\":\\\"string\\\",\\\"UG\\\":\\\"string\\\",\\\"UA\\\":\\\"string\\\",\\\"AE\\\":\\\"string\\\",\\\"GB\\\":\\\"string\\\",\\\"US\\\":\\\"string\\\",\\\"UM\\\":\\\"string\\\",\\\"UY\\\":\\\"string\\\",\\\"UZ\\\":\\\"string\\\",\\\"VU\\\":\\\"string\\\",\\\"VE\\\":\\\"string\\\",\\\"VN\\\":\\\"string\\\",\\\"VG\\\":\\\"string\\\",\\\"VI\\\":\\\"string\\\",\\\"WF\\\":\\\"string\\\",\\\"EH\\\":\\\"string\\\",\\\"YE\\\":\\\"string\\\",\\\"ZM\\\":\\\"string\\\",\\\"ZW\\\":\\\"string\\\",\\\"AX\\\":\\\"string\\\",\\\"BQ\\\":\\\"string\\\",\\\"CW\\\":\\\"string\\\",\\\"GG\\\":\\\"string\\\",\\\"IM\\\":\\\"string\\\",\\\"JE\\\":\\\"string\\\",\\\"ME\\\":\\\"string\\\",\\\"BL\\\":\\\"string\\\",\\\"MF\\\":\\\"string\\\",\\\"RS\\\":\\\"string\\\",\\\"SX\\\":\\\"string\\\",\\\"SS\\\":\\\"string\\\",\\\"XK\\\":\\\"string\\\"},\\\"doIndex\\\":false,\\\"utm_source\\\":\\\"string\\\",\\\"utm_medium\\\":\\\"string\\\",\\\"utm_campaign\\\":\\\"string\\\",\\\"utm_term\\\":\\\"string\\\",\\\"utm_content\\\":\\\"string\\\",\\\"ref\\\":\\\"string\\\"}\");\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links/linkId\")\n .patch(body)\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Update a link for the authenticated workspace. If there's no change, returns it as it is."
tags:
- "Links"
security:
- token: []
parameters:
- in: "path"
name: "linkId"
description: "The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."
schema:
type: "string"
description: "The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."
required: true
requestBody:
content:
"application/json":
schema:
type: "object"
properties:
"url":
type: "string"
description: "The destination URL of the short link."
example: "https://google.com"
"domain":
type: "string"
maxLength: 190
description: "The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."
"key":
type: "string"
maxLength: 190
description: "The short link slug. If not provided, a random 7-character slug will be generated."
"externalId":
type: "string"
nullable: true
minLength: 1
maxLength: 255
description: "This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter."
example: "123456"
"prefix":
type: "string"
description: "The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."
"trackConversion":
type: "boolean"
default: false
description: "Whether to track conversions for the short link."
"identifier":
type: "string"
nullable: true
description: "The identifier of the short link that is unique across your workspace. If set, it can be used to identify your short link for client-side click tracking."
"archived":
type: "boolean"
default: false
description: "Whether the short link is archived."
"publicStats":
type: "boolean"
default: false
description: "Whether the short link's stats are publicly accessible."
"tagId":
type: "string"
nullable: true
description: "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead."
deprecated: true
"tagIds":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique IDs of the tags assigned to the short link."
example: ["clux0rgak00011..."]
"tagNames":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique name of the tags assigned to the short link (case insensitive)."
"comments":
type: "string"
nullable: true
description: "The comments for the short link."
"expiresAt":
type: "string"
nullable: true
description: "The date and time when the short link will expire at."
"expiredUrl":
type: "string"
nullable: true
description: "The URL to redirect to when the short link has expired."
"password":
type: "string"
nullable: true
description: "The password required to access the destination URL of the short link."
"proxy":
type: "boolean"
default: false
description: "Whether the short link uses Custom Social Media Cards feature."
"title":
type: "string"
nullable: true
description: "The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"description":
type: "string"
nullable: true
description: "The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"image":
type: "string"
nullable: true
description: "The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"video":
type: "string"
nullable: true
description: "The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"rewrite":
type: "boolean"
default: false
description: "Whether the short link uses link cloaking."
"ios":
type: "string"
nullable: true
description: "The iOS destination URL for the short link for iOS device targeting."
"android":
type: "string"
nullable: true
description: "The Android destination URL for the short link for Android device targeting."
"geo": {"$ref": "#/components/schemas/linkGeoTargeting"}
"doIndex":
type: "boolean"
default: false
description: "Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"
"utm_source":
type: "string"
nullable: true
description: "The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."
"utm_medium":
type: "string"
nullable: true
description: "The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."
"utm_campaign":
type: "string"
nullable: true
description: "The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."
"utm_term":
type: "string"
nullable: true
description: "The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."
"utm_content":
type: "string"
nullable: true
description: "The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."
"ref":
type: "string"
nullable: true
description: "The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."
responses:
"200":
description: "The updated link"
content:
"application/json":
schema: {"$ref": "#/components/schemas/LinkSchema"}
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
delete:
operationId: "deleteLink"
x-speakeasy-name-override: "delete"
x-speakeasy-max-method-params: 1
summary: "Delete a link"
x-codeSamples: [{"lang": "typescript", "label": "deleteLink", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.delete(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "deleteLink", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Delete(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "deleteLink", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n \nres = s.links.delete(link_id=\"<id>\")\n\nif ! res.object.nil?\n # handle response\nend"}, {"lang": "php", "label": "deleteLink", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n\n\n$response = $sdk->links->delete(\n linkId: '<id>'\n);\n\nif ($response->object !== null) {\n // handle response\n}"}, {lang: python, label: deleteLink, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.delete(link_id=\"<id>\")\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links/linkId\")\n .delete(null)\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Delete a link for the authenticated workspace."
tags:
- "Links"
security:
- token: []
parameters:
- in: "path"
name: "linkId"
description: "The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."
schema:
type: "string"
description: "The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."
required: true
responses:
"200":
description: "The deleted link ID."
content:
"application/json":
schema:
type: "object"
properties:
"id":
type: "string"
description: "The ID of the link."
required:
- "id"
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
"/links/bulk":
post:
operationId: "bulkCreateLinks"
x-speakeasy-name-override: "createMany"
summary: "Bulk create links"
x-codeSamples: [{"lang": "typescript", "label": "bulkCreateLinks", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.createMany();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "bulkCreateLinks", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.CreateMany(ctx, []operations.RequestBody{\n operations.RequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateBulkCreateLinksTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n },\n operations.RequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateBulkCreateLinksTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "bulkCreateLinks", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = [\n ::OpenApiSDK::Operations::RequestBody.new(\n url: \"https://google.com\",\n external_id: \"123456\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n ),\n]\n \nres = s.links.create_many(req)\n\nif ! res.link_schemas.nil?\n # handle response\nend"}, {"lang": "php", "label": "bulkCreateLinks", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = [\n new Operations\\RequestBody(\n url: 'https://google.com',\n externalId: '123456',\n tagIds: [\n 'clux0rgak00011...',\n ],\n ),\n];\n\n$response = $sdk->links->createMany(\n request: $request\n);\n\nif ($response->linkSchemas !== null) {\n // handle response\n}"}, {lang: python, label: bulkCreateLinks, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.create_many(request=[\n {\n \"url\": \"https://google.com\",\n \"external_id\": \"123456\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n },\n {\n \"url\": \"https://google.com\",\n \"external_id\": \"123456\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n },\n])\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"[{\\\"url\\\":\\\"https://google.com\\\",\\\"domain\\\":\\\"string\\\",\\\"key\\\":\\\"string\\\",\\\"externalId\\\":\\\"123456\\\",\\\"prefix\\\":\\\"string\\\",\\\"trackConversion\\\":false,\\\"identifier\\\":\\\"string\\\",\\\"archived\\\":false,\\\"publicStats\\\":false,\\\"tagIds\\\":\\\"string\\\",\\\"tagNames\\\":\\\"string\\\",\\\"comments\\\":\\\"string\\\",\\\"expiresAt\\\":\\\"string\\\",\\\"expiredUrl\\\":\\\"string\\\",\\\"password\\\":\\\"string\\\",\\\"proxy\\\":false,\\\"title\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"image\\\":\\\"string\\\",\\\"video\\\":\\\"string\\\",\\\"rewrite\\\":false,\\\"ios\\\":\\\"string\\\",\\\"android\\\":\\\"string\\\",\\\"geo\\\":{\\\"AF\\\":\\\"string\\\",\\\"AL\\\":\\\"string\\\",\\\"DZ\\\":\\\"string\\\",\\\"AS\\\":\\\"string\\\",\\\"AD\\\":\\\"string\\\",\\\"AO\\\":\\\"string\\\",\\\"AI\\\":\\\"string\\\",\\\"AQ\\\":\\\"string\\\",\\\"AG\\\":\\\"string\\\",\\\"AR\\\":\\\"string\\\",\\\"AM\\\":\\\"string\\\",\\\"AW\\\":\\\"string\\\",\\\"AU\\\":\\\"string\\\",\\\"AT\\\":\\\"string\\\",\\\"AZ\\\":\\\"string\\\",\\\"BS\\\":\\\"string\\\",\\\"BH\\\":\\\"string\\\",\\\"BD\\\":\\\"string\\\",\\\"BB\\\":\\\"string\\\",\\\"BY\\\":\\\"string\\\",\\\"BE\\\":\\\"string\\\",\\\"BZ\\\":\\\"string\\\",\\\"BJ\\\":\\\"string\\\",\\\"BM\\\":\\\"string\\\",\\\"BT\\\":\\\"string\\\",\\\"BO\\\":\\\"string\\\",\\\"BA\\\":\\\"string\\\",\\\"BW\\\":\\\"string\\\",\\\"BV\\\":\\\"string\\\",\\\"BR\\\":\\\"string\\\",\\\"IO\\\":\\\"string\\\",\\\"BN\\\":\\\"string\\\",\\\"BG\\\":\\\"string\\\",\\\"BF\\\":\\\"string\\\",\\\"BI\\\":\\\"string\\\",\\\"KH\\\":\\\"string\\\",\\\"CM\\\":\\\"string\\\",\\\"CA\\\":\\\"string\\\",\\\"CV\\\":\\\"string\\\",\\\"KY\\\":\\\"string\\\",\\\"CF\\\":\\\"string\\\",\\\"TD\\\":\\\"string\\\",\\\"CL\\\":\\\"string\\\",\\\"CN\\\":\\\"string\\\",\\\"CX\\\":\\\"string\\\",\\\"CC\\\":\\\"string\\\",\\\"CO\\\":\\\"string\\\",\\\"KM\\\":\\\"string\\\",\\\"CG\\\":\\\"string\\\",\\\"CD\\\":\\\"string\\\",\\\"CK\\\":\\\"string\\\",\\\"CR\\\":\\\"string\\\",\\\"CI\\\":\\\"string\\\",\\\"HR\\\":\\\"string\\\",\\\"CU\\\":\\\"string\\\",\\\"CY\\\":\\\"string\\\",\\\"CZ\\\":\\\"string\\\",\\\"DK\\\":\\\"string\\\",\\\"DJ\\\":\\\"string\\\",\\\"DM\\\":\\\"string\\\",\\\"DO\\\":\\\"string\\\",\\\"EC\\\":\\\"string\\\",\\\"EG\\\":\\\"string\\\",\\\"SV\\\":\\\"string\\\",\\\"GQ\\\":\\\"string\\\",\\\"ER\\\":\\\"string\\\",\\\"EE\\\":\\\"string\\\",\\\"ET\\\":\\\"string\\\",\\\"FK\\\":\\\"string\\\",\\\"FO\\\":\\\"string\\\",\\\"FJ\\\":\\\"string\\\",\\\"FI\\\":\\\"string\\\",\\\"FR\\\":\\\"string\\\",\\\"GF\\\":\\\"string\\\",\\\"PF\\\":\\\"string\\\",\\\"TF\\\":\\\"string\\\",\\\"GA\\\":\\\"string\\\",\\\"GM\\\":\\\"string\\\",\\\"GE\\\":\\\"string\\\",\\\"DE\\\":\\\"string\\\",\\\"GH\\\":\\\"string\\\",\\\"GI\\\":\\\"string\\\",\\\"GR\\\":\\\"string\\\",\\\"GL\\\":\\\"string\\\",\\\"GD\\\":\\\"string\\\",\\\"GP\\\":\\\"string\\\",\\\"GU\\\":\\\"string\\\",\\\"GT\\\":\\\"string\\\",\\\"GN\\\":\\\"string\\\",\\\"GW\\\":\\\"string\\\",\\\"GY\\\":\\\"string\\\",\\\"HT\\\":\\\"string\\\",\\\"HM\\\":\\\"string\\\",\\\"VA\\\":\\\"string\\\",\\\"HN\\\":\\\"string\\\",\\\"HK\\\":\\\"string\\\",\\\"HU\\\":\\\"string\\\",\\\"IS\\\":\\\"string\\\",\\\"IN\\\":\\\"string\\\",\\\"ID\\\":\\\"string\\\",\\\"IR\\\":\\\"string\\\",\\\"IQ\\\":\\\"string\\\",\\\"IE\\\":\\\"string\\\",\\\"IL\\\":\\\"string\\\",\\\"IT\\\":\\\"string\\\",\\\"JM\\\":\\\"string\\\",\\\"JP\\\":\\\"string\\\",\\\"JO\\\":\\\"string\\\",\\\"KZ\\\":\\\"string\\\",\\\"KE\\\":\\\"string\\\",\\\"KI\\\":\\\"string\\\",\\\"KP\\\":\\\"string\\\",\\\"KR\\\":\\\"string\\\",\\\"KW\\\":\\\"string\\\",\\\"KG\\\":\\\"string\\\",\\\"LA\\\":\\\"string\\\",\\\"LV\\\":\\\"string\\\",\\\"LB\\\":\\\"string\\\",\\\"LS\\\":\\\"string\\\",\\\"LR\\\":\\\"string\\\",\\\"LY\\\":\\\"string\\\",\\\"LI\\\":\\\"string\\\",\\\"LT\\\":\\\"string\\\",\\\"LU\\\":\\\"string\\\",\\\"MO\\\":\\\"string\\\",\\\"MG\\\":\\\"string\\\",\\\"MW\\\":\\\"string\\\",\\\"MY\\\":\\\"string\\\",\\\"MV\\\":\\\"string\\\",\\\"ML\\\":\\\"string\\\",\\\"MT\\\":\\\"string\\\",\\\"MH\\\":\\\"string\\\",\\\"MQ\\\":\\\"string\\\",\\\"MR\\\":\\\"string\\\",\\\"MU\\\":\\\"string\\\",\\\"YT\\\":\\\"string\\\",\\\"MX\\\":\\\"string\\\",\\\"FM\\\":\\\"string\\\",\\\"MD\\\":\\\"string\\\",\\\"MC\\\":\\\"string\\\",\\\"MN\\\":\\\"string\\\",\\\"MS\\\":\\\"string\\\",\\\"MA\\\":\\\"string\\\",\\\"MZ\\\":\\\"string\\\",\\\"MM\\\":\\\"string\\\",\\\"NA\\\":\\\"string\\\",\\\"NR\\\":\\\"string\\\",\\\"NP\\\":\\\"string\\\",\\\"NL\\\":\\\"string\\\",\\\"NC\\\":\\\"string\\\",\\\"NZ\\\":\\\"string\\\",\\\"NI\\\":\\\"string\\\",\\\"NE\\\":\\\"string\\\",\\\"NG\\\":\\\"string\\\",\\\"NU\\\":\\\"string\\\",\\\"NF\\\":\\\"string\\\",\\\"MK\\\":\\\"string\\\",\\\"MP\\\":\\\"string\\\",\\\"NO\\\":\\\"string\\\",\\\"OM\\\":\\\"string\\\",\\\"PK\\\":\\\"string\\\",\\\"PW\\\":\\\"string\\\",\\\"PS\\\":\\\"string\\\",\\\"PA\\\":\\\"string\\\",\\\"PG\\\":\\\"string\\\",\\\"PY\\\":\\\"string\\\",\\\"PE\\\":\\\"string\\\",\\\"PH\\\":\\\"string\\\",\\\"PN\\\":\\\"string\\\",\\\"PL\\\":\\\"string\\\",\\\"PT\\\":\\\"string\\\",\\\"PR\\\":\\\"string\\\",\\\"QA\\\":\\\"string\\\",\\\"RE\\\":\\\"string\\\",\\\"RO\\\":\\\"string\\\",\\\"RU\\\":\\\"string\\\",\\\"RW\\\":\\\"string\\\",\\\"SH\\\":\\\"string\\\",\\\"KN\\\":\\\"string\\\",\\\"LC\\\":\\\"string\\\",\\\"PM\\\":\\\"string\\\",\\\"VC\\\":\\\"string\\\",\\\"WS\\\":\\\"string\\\",\\\"SM\\\":\\\"string\\\",\\\"ST\\\":\\\"string\\\",\\\"SA\\\":\\\"string\\\",\\\"SN\\\":\\\"string\\\",\\\"SC\\\":\\\"string\\\",\\\"SL\\\":\\\"string\\\",\\\"SG\\\":\\\"string\\\",\\\"SK\\\":\\\"string\\\",\\\"SI\\\":\\\"string\\\",\\\"SB\\\":\\\"string\\\",\\\"SO\\\":\\\"string\\\",\\\"ZA\\\":\\\"string\\\",\\\"GS\\\":\\\"string\\\",\\\"ES\\\":\\\"string\\\",\\\"LK\\\":\\\"string\\\",\\\"SD\\\":\\\"string\\\",\\\"SR\\\":\\\"string\\\",\\\"SJ\\\":\\\"string\\\",\\\"SZ\\\":\\\"string\\\",\\\"SE\\\":\\\"string\\\",\\\"CH\\\":\\\"string\\\",\\\"SY\\\":\\\"string\\\",\\\"TW\\\":\\\"string\\\",\\\"TJ\\\":\\\"string\\\",\\\"TZ\\\":\\\"string\\\",\\\"TH\\\":\\\"string\\\",\\\"TL\\\":\\\"string\\\",\\\"TG\\\":\\\"string\\\",\\\"TK\\\":\\\"string\\\",\\\"TO\\\":\\\"string\\\",\\\"TT\\\":\\\"string\\\",\\\"TN\\\":\\\"string\\\",\\\"TR\\\":\\\"string\\\",\\\"TM\\\":\\\"string\\\",\\\"TC\\\":\\\"string\\\",\\\"TV\\\":\\\"string\\\",\\\"UG\\\":\\\"string\\\",\\\"UA\\\":\\\"string\\\",\\\"AE\\\":\\\"string\\\",\\\"GB\\\":\\\"string\\\",\\\"US\\\":\\\"string\\\",\\\"UM\\\":\\\"string\\\",\\\"UY\\\":\\\"string\\\",\\\"UZ\\\":\\\"string\\\",\\\"VU\\\":\\\"string\\\",\\\"VE\\\":\\\"string\\\",\\\"VN\\\":\\\"string\\\",\\\"VG\\\":\\\"string\\\",\\\"VI\\\":\\\"string\\\",\\\"WF\\\":\\\"string\\\",\\\"EH\\\":\\\"string\\\",\\\"YE\\\":\\\"string\\\",\\\"ZM\\\":\\\"string\\\",\\\"ZW\\\":\\\"string\\\",\\\"AX\\\":\\\"string\\\",\\\"BQ\\\":\\\"string\\\",\\\"CW\\\":\\\"string\\\",\\\"GG\\\":\\\"string\\\",\\\"IM\\\":\\\"string\\\",\\\"JE\\\":\\\"string\\\",\\\"ME\\\":\\\"string\\\",\\\"BL\\\":\\\"string\\\",\\\"MF\\\":\\\"string\\\",\\\"RS\\\":\\\"string\\\",\\\"SX\\\":\\\"string\\\",\\\"SS\\\":\\\"string\\\",\\\"XK\\\":\\\"string\\\"},\\\"doIndex\\\":false,\\\"utm_source\\\":\\\"string\\\",\\\"utm_medium\\\":\\\"string\\\",\\\"utm_campaign\\\":\\\"string\\\",\\\"utm_term\\\":\\\"string\\\",\\\"utm_content\\\":\\\"string\\\",\\\"ref\\\":\\\"string\\\"}]\");\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links/bulk\")\n .post(body)\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Bulk create up to 100 links for the authenticated workspace."
tags:
- "Links"
security:
- token: []
requestBody:
content:
"application/json":
schema:
type: "array"
items:
type: "object"
properties:
"url":
type: "string"
description: "The destination URL of the short link."
example: "https://google.com"
"domain":
type: "string"
maxLength: 190
description: "The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."
"key":
type: "string"
maxLength: 190
description: "The short link slug. If not provided, a random 7-character slug will be generated."
"externalId":
type: "string"
nullable: true
minLength: 1
maxLength: 255
description: "This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter."
example: "123456"
"prefix":
type: "string"
description: "The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."
"trackConversion":
type: "boolean"
default: false
description: "Whether to track conversions for the short link."
"identifier":
type: "string"
nullable: true
description: "The identifier of the short link that is unique across your workspace. If set, it can be used to identify your short link for client-side click tracking."
"archived":
type: "boolean"
default: false
description: "Whether the short link is archived."
"publicStats":
type: "boolean"
default: false
description: "Whether the short link's stats are publicly accessible."
"tagId":
type: "string"
nullable: true
description: "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead."
deprecated: true
"tagIds":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique IDs of the tags assigned to the short link."
example: ["clux0rgak00011..."]
"tagNames":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique name of the tags assigned to the short link (case insensitive)."
"comments":
type: "string"
nullable: true
description: "The comments for the short link."
"expiresAt":
type: "string"
nullable: true
description: "The date and time when the short link will expire at."
"expiredUrl":
type: "string"
nullable: true
description: "The URL to redirect to when the short link has expired."
"password":
type: "string"
nullable: true
description: "The password required to access the destination URL of the short link."
"proxy":
type: "boolean"
default: false
description: "Whether the short link uses Custom Social Media Cards feature."
"title":
type: "string"
nullable: true
description: "The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"description":
type: "string"
nullable: true
description: "The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"image":
type: "string"
nullable: true
description: "The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"video":
type: "string"
nullable: true
description: "The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"rewrite":
type: "boolean"
default: false
description: "Whether the short link uses link cloaking."
"ios":
type: "string"
nullable: true
description: "The iOS destination URL for the short link for iOS device targeting."
"android":
type: "string"
nullable: true
description: "The Android destination URL for the short link for Android device targeting."
"geo": {"$ref": "#/components/schemas/linkGeoTargeting"}
"doIndex":
type: "boolean"
default: false
description: "Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"
"utm_source":
type: "string"
nullable: true
description: "The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."
"utm_medium":
type: "string"
nullable: true
description: "The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."
"utm_campaign":
type: "string"
nullable: true
description: "The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."
"utm_term":
type: "string"
nullable: true
description: "The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."
"utm_content":
type: "string"
nullable: true
description: "The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."
"ref":
type: "string"
nullable: true
description: "The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."
required:
- "url"
responses:
"200":
description: "The created links"
content:
"application/json":
schema:
type: "array"
items: {"$ref": "#/components/schemas/LinkSchema"}
"400": {"$ref": "#/components/responses/400"}
"401": {"$ref": "#/components/responses/401"}
"403": {"$ref": "#/components/responses/403"}
"404": {"$ref": "#/components/responses/404"}
"409": {"$ref": "#/components/responses/409"}
"410": {"$ref": "#/components/responses/410"}
"422": {"$ref": "#/components/responses/422"}
"429": {"$ref": "#/components/responses/429"}
"500": {"$ref": "#/components/responses/500"}
patch:
operationId: "bulkUpdateLinks"
x-speakeasy-name-override: "updateMany"
summary: "Bulk update links"
x-codeSamples: [{"lang": "typescript", "label": "bulkUpdateLinks", "source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.updateMany();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}, {"lang": "go", "label": "bulkUpdateLinks", "source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.UpdateMany(ctx, &operations.BulkUpdateLinksRequestBody{\n Data: operations.Data{\n URL: dubgo.String(\"https://google.com\"),\n TagIds: dubgo.Pointer(operations.CreateBulkUpdateLinksTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"}, {"lang": "ruby", "label": "bulkUpdateLinks", "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::BulkUpdateLinksRequestBody.new(\n data: ::OpenApiSDK::Operations::Data.new(\n url: \"https://google.com\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n ),\n)\n \nres = s.links.update_many(req)\n\nif ! res.link_schemas.nil?\n # handle response\nend"}, {"lang": "php", "label": "bulkUpdateLinks", "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = new Operations\\BulkUpdateLinksRequestBody(\n data: new Operations\\Data(\n url: 'https://google.com',\n tagIds: [\n 'clux0rgak00011...',\n ],\n ),\n);\n\n$response = $sdk->links->updateMany(\n request: $request\n);\n\nif ($response->linkSchemas !== null) {\n // handle response\n}"}, {lang: python, label: bulkUpdateLinks, source: "from dub import Dub\n\ns = Dub(\n token=\"DUB_API_KEY\",\n)\n\nres = s.links.update_many(request={\n \"data\": {\n \"url\": \"https://google.com\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n },\n})\n\nif res is not None:\n # handle response\n pass"}, {"lang": "java", "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"linkIds\\\":[\\\"string\\\"],\\\"externalIds\\\":[\\\"string\\\"],\\\"data\\\":{\\\"url\\\":\\\"https://google.com\\\",\\\"trackConversion\\\":false,\\\"archived\\\":false,\\\"publicStats\\\":false,\\\"tagIds\\\":\\\"string\\\",\\\"tagNames\\\":\\\"string\\\",\\\"comments\\\":\\\"string\\\",\\\"expiresAt\\\":\\\"string\\\",\\\"expiredUrl\\\":\\\"string\\\",\\\"password\\\":\\\"string\\\",\\\"proxy\\\":false,\\\"title\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"image\\\":\\\"string\\\",\\\"video\\\":\\\"string\\\",\\\"rewrite\\\":false,\\\"ios\\\":\\\"string\\\",\\\"android\\\":\\\"string\\\",\\\"geo\\\":{\\\"AF\\\":\\\"string\\\",\\\"AL\\\":\\\"string\\\",\\\"DZ\\\":\\\"string\\\",\\\"AS\\\":\\\"string\\\",\\\"AD\\\":\\\"string\\\",\\\"AO\\\":\\\"string\\\",\\\"AI\\\":\\\"string\\\",\\\"AQ\\\":\\\"string\\\",\\\"AG\\\":\\\"string\\\",\\\"AR\\\":\\\"string\\\",\\\"AM\\\":\\\"string\\\",\\\"AW\\\":\\\"string\\\",\\\"AU\\\":\\\"string\\\",\\\"AT\\\":\\\"string\\\",\\\"AZ\\\":\\\"string\\\",\\\"BS\\\":\\\"string\\\",\\\"BH\\\":\\\"string\\\",\\\"BD\\\":\\\"string\\\",\\\"BB\\\":\\\"string\\\",\\\"BY\\\":\\\"string\\\",\\\"BE\\\":\\\"string\\\",\\\"BZ\\\":\\\"string\\\",\\\"BJ\\\":\\\"string\\\",\\\"BM\\\":\\\"string\\\",\\\"BT\\\":\\\"string\\\",\\\"BO\\\":\\\"string\\\",\\\"BA\\\":\\\"string\\\",\\\"BW\\\":\\\"string\\\",\\\"BV\\\":\\\"string\\\",\\\"BR\\\":\\\"string\\\",\\\"IO\\\":\\\"string\\\",\\\"BN\\\":\\\"string\\\",\\\"BG\\\":\\\"string\\\",\\\"BF\\\":\\\"string\\\",\\\"BI\\\":\\\"string\\\",\\\"KH\\\":\\\"string\\\",\\\"CM\\\":\\\"string\\\",\\\"CA\\\":\\\"string\\\",\\\"CV\\\":\\\"string\\\",\\\"KY\\\":\\\"string\\\",\\\"CF\\\":\\\"string\\\",\\\"TD\\\":\\\"string\\\",\\\"CL\\\":\\\"string\\\",\\\"CN\\\":\\\"string\\\",\\\"CX\\\":\\\"string\\\",\\\"CC\\\":\\\"string\\\",\\\"CO\\\":\\\"string\\\",\\\"KM\\\":\\\"string\\\",\\\"CG\\\":\\\"string\\\",\\\"CD\\\":\\\"string\\\",\\\"CK\\\":\\\"string\\\",\\\"CR\\\":\\\"string\\\",\\\"CI\\\":\\\"string\\\",\\\"HR\\\":\\\"string\\\",\\\"CU\\\":\\\"string\\\",\\\"CY\\\":\\\"string\\\",\\\"CZ\\\":\\\"string\\\",\\\"DK\\\":\\\"string\\\",\\\"DJ\\\":\\\"string\\\",\\\"DM\\\":\\\"string\\\",\\\"DO\\\":\\\"string\\\",\\\"EC\\\":\\\"string\\\",\\\"EG\\\":\\\"string\\\",\\\"SV\\\":\\\"string\\\",\\\"GQ\\\":\\\"string\\\",\\\"ER\\\":\\\"string\\\",\\\"EE\\\":\\\"string\\\",\\\"ET\\\":\\\"string\\\",\\\"FK\\\":\\\"string\\\",\\\"FO\\\":\\\"string\\\",\\\"FJ\\\":\\\"string\\\",\\\"FI\\\":\\\"string\\\",\\\"FR\\\":\\\"string\\\",\\\"GF\\\":\\\"string\\\",\\\"PF\\\":\\\"string\\\",\\\"TF\\\":\\\"string\\\",\\\"GA\\\":\\\"string\\\",\\\"GM\\\":\\\"string\\\",\\\"GE\\\":\\\"string\\\",\\\"DE\\\":\\\"string\\\",\\\"GH\\\":\\\"string\\\",\\\"GI\\\":\\\"string\\\",\\\"GR\\\":\\\"string\\\",\\\"GL\\\":\\\"string\\\",\\\"GD\\\":\\\"string\\\",\\\"GP\\\":\\\"string\\\",\\\"GU\\\":\\\"string\\\",\\\"GT\\\":\\\"string\\\",\\\"GN\\\":\\\"string\\\",\\\"GW\\\":\\\"string\\\",\\\"GY\\\":\\\"string\\\",\\\"HT\\\":\\\"string\\\",\\\"HM\\\":\\\"string\\\",\\\"VA\\\":\\\"string\\\",\\\"HN\\\":\\\"string\\\",\\\"HK\\\":\\\"string\\\",\\\"HU\\\":\\\"string\\\",\\\"IS\\\":\\\"string\\\",\\\"IN\\\":\\\"string\\\",\\\"ID\\\":\\\"string\\\",\\\"IR\\\":\\\"string\\\",\\\"IQ\\\":\\\"string\\\",\\\"IE\\\":\\\"string\\\",\\\"IL\\\":\\\"string\\\",\\\"IT\\\":\\\"string\\\",\\\"JM\\\":\\\"string\\\",\\\"JP\\\":\\\"string\\\",\\\"JO\\\":\\\"string\\\",\\\"KZ\\\":\\\"string\\\",\\\"KE\\\":\\\"string\\\",\\\"KI\\\":\\\"string\\\",\\\"KP\\\":\\\"string\\\",\\\"KR\\\":\\\"string\\\",\\\"KW\\\":\\\"string\\\",\\\"KG\\\":\\\"string\\\",\\\"LA\\\":\\\"string\\\",\\\"LV\\\":\\\"string\\\",\\\"LB\\\":\\\"string\\\",\\\"LS\\\":\\\"string\\\",\\\"LR\\\":\\\"string\\\",\\\"LY\\\":\\\"string\\\",\\\"LI\\\":\\\"string\\\",\\\"LT\\\":\\\"string\\\",\\\"LU\\\":\\\"string\\\",\\\"MO\\\":\\\"string\\\",\\\"MG\\\":\\\"string\\\",\\\"MW\\\":\\\"string\\\",\\\"MY\\\":\\\"string\\\",\\\"MV\\\":\\\"string\\\",\\\"ML\\\":\\\"string\\\",\\\"MT\\\":\\\"string\\\",\\\"MH\\\":\\\"string\\\",\\\"MQ\\\":\\\"string\\\",\\\"MR\\\":\\\"string\\\",\\\"MU\\\":\\\"string\\\",\\\"YT\\\":\\\"string\\\",\\\"MX\\\":\\\"string\\\",\\\"FM\\\":\\\"string\\\",\\\"MD\\\":\\\"string\\\",\\\"MC\\\":\\\"string\\\",\\\"MN\\\":\\\"string\\\",\\\"MS\\\":\\\"string\\\",\\\"MA\\\":\\\"string\\\",\\\"MZ\\\":\\\"string\\\",\\\"MM\\\":\\\"string\\\",\\\"NA\\\":\\\"string\\\",\\\"NR\\\":\\\"string\\\",\\\"NP\\\":\\\"string\\\",\\\"NL\\\":\\\"string\\\",\\\"NC\\\":\\\"string\\\",\\\"NZ\\\":\\\"string\\\",\\\"NI\\\":\\\"string\\\",\\\"NE\\\":\\\"string\\\",\\\"NG\\\":\\\"string\\\",\\\"NU\\\":\\\"string\\\",\\\"NF\\\":\\\"string\\\",\\\"MK\\\":\\\"string\\\",\\\"MP\\\":\\\"string\\\",\\\"NO\\\":\\\"string\\\",\\\"OM\\\":\\\"string\\\",\\\"PK\\\":\\\"string\\\",\\\"PW\\\":\\\"string\\\",\\\"PS\\\":\\\"string\\\",\\\"PA\\\":\\\"string\\\",\\\"PG\\\":\\\"string\\\",\\\"PY\\\":\\\"string\\\",\\\"PE\\\":\\\"string\\\",\\\"PH\\\":\\\"string\\\",\\\"PN\\\":\\\"string\\\",\\\"PL\\\":\\\"string\\\",\\\"PT\\\":\\\"string\\\",\\\"PR\\\":\\\"string\\\",\\\"QA\\\":\\\"string\\\",\\\"RE\\\":\\\"string\\\",\\\"RO\\\":\\\"string\\\",\\\"RU\\\":\\\"string\\\",\\\"RW\\\":\\\"string\\\",\\\"SH\\\":\\\"string\\\",\\\"KN\\\":\\\"string\\\",\\\"LC\\\":\\\"string\\\",\\\"PM\\\":\\\"string\\\",\\\"VC\\\":\\\"string\\\",\\\"WS\\\":\\\"string\\\",\\\"SM\\\":\\\"string\\\",\\\"ST\\\":\\\"string\\\",\\\"SA\\\":\\\"string\\\",\\\"SN\\\":\\\"string\\\",\\\"SC\\\":\\\"string\\\",\\\"SL\\\":\\\"string\\\",\\\"SG\\\":\\\"string\\\",\\\"SK\\\":\\\"string\\\",\\\"SI\\\":\\\"string\\\",\\\"SB\\\":\\\"string\\\",\\\"SO\\\":\\\"string\\\",\\\"ZA\\\":\\\"string\\\",\\\"GS\\\":\\\"string\\\",\\\"ES\\\":\\\"string\\\",\\\"LK\\\":\\\"string\\\",\\\"SD\\\":\\\"string\\\",\\\"SR\\\":\\\"string\\\",\\\"SJ\\\":\\\"string\\\",\\\"SZ\\\":\\\"string\\\",\\\"SE\\\":\\\"string\\\",\\\"CH\\\":\\\"string\\\",\\\"SY\\\":\\\"string\\\",\\\"TW\\\":\\\"string\\\",\\\"TJ\\\":\\\"string\\\",\\\"TZ\\\":\\\"string\\\",\\\"TH\\\":\\\"string\\\",\\\"TL\\\":\\\"string\\\",\\\"TG\\\":\\\"string\\\",\\\"TK\\\":\\\"string\\\",\\\"TO\\\":\\\"string\\\",\\\"TT\\\":\\\"string\\\",\\\"TN\\\":\\\"string\\\",\\\"TR\\\":\\\"string\\\",\\\"TM\\\":\\\"string\\\",\\\"TC\\\":\\\"string\\\",\\\"TV\\\":\\\"string\\\",\\\"UG\\\":\\\"string\\\",\\\"UA\\\":\\\"string\\\",\\\"AE\\\":\\\"string\\\",\\\"GB\\\":\\\"string\\\",\\\"US\\\":\\\"string\\\",\\\"UM\\\":\\\"string\\\",\\\"UY\\\":\\\"string\\\",\\\"UZ\\\":\\\"string\\\",\\\"VU\\\":\\\"string\\\",\\\"VE\\\":\\\"string\\\",\\\"VN\\\":\\\"string\\\",\\\"VG\\\":\\\"string\\\",\\\"VI\\\":\\\"string\\\",\\\"WF\\\":\\\"string\\\",\\\"EH\\\":\\\"string\\\",\\\"YE\\\":\\\"string\\\",\\\"ZM\\\":\\\"string\\\",\\\"ZW\\\":\\\"string\\\",\\\"AX\\\":\\\"string\\\",\\\"BQ\\\":\\\"string\\\",\\\"CW\\\":\\\"string\\\",\\\"GG\\\":\\\"string\\\",\\\"IM\\\":\\\"string\\\",\\\"JE\\\":\\\"string\\\",\\\"ME\\\":\\\"string\\\",\\\"BL\\\":\\\"string\\\",\\\"MF\\\":\\\"string\\\",\\\"RS\\\":\\\"string\\\",\\\"SX\\\":\\\"string\\\",\\\"SS\\\":\\\"string\\\",\\\"XK\\\":\\\"string\\\"},\\\"doIndex\\\":false,\\\"utm_source\\\":\\\"string\\\",\\\"utm_medium\\\":\\\"string\\\",\\\"utm_campaign\\\":\\\"string\\\",\\\"utm_term\\\":\\\"string\\\",\\\"utm_content\\\":\\\"string\\\",\\\"ref\\\":\\\"string\\\"}}\");\nRequest request = new Request.Builder()\n .url(\"https://api.dub.co/links/bulk\")\n .patch(body)\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer MY_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"}]
description: "Bulk update up to 100 links with the same data for the authenticated workspace."
tags:
- "Links"
security:
- token: []
requestBody:
content:
"application/json":
schema:
type: "object"
properties:
"linkIds":
type: "array"
items:
type: "string"
maxItems: 100
description: "The IDs of the links to update. Takes precedence over `externalIds`."
default: []
"externalIds":
type: "array"
items:
type: "string"
maxItems: 100
description: "The external IDs of the links to update as stored in your database."
default: []
"data":
type: "object"
properties:
"url":
type: "string"
description: "The destination URL of the short link."
example: "https://google.com"
"trackConversion":
type: "boolean"
default: false
description: "Whether to track conversions for the short link."
"archived":
type: "boolean"
default: false
description: "Whether the short link is archived."
"publicStats":
type: "boolean"
default: false
description: "Whether the short link's stats are publicly accessible."
"tagId":
type: "string"
nullable: true
description: "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead."
deprecated: true
"tagIds":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique IDs of the tags assigned to the short link."
example: ["clux0rgak00011..."]
"tagNames":
anyOf:
- type: "string"
- type: "array"
items:
type: "string"
description: "The unique name of the tags assigned to the short link (case insensitive)."
"comments":
type: "string"
nullable: true
description: "The comments for the short link."
"expiresAt":
type: "string"
nullable: true
description: "The date and time when the short link will expire at."
"expiredUrl":
type: "string"
nullable: true
description: "The URL to redirect to when the short link has expired."
"password":
type: "string"
nullable: true
description: "The password required to access the destination URL of the short link."
"proxy":
type: "boolean"
default: false
description: "Whether the short link uses Custom Social Media Cards feature."
"title":
type: "string"
nullable: true
description: "The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"description":
type: "string"
nullable: true
description: "The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"image":
type: "string"
nullable: true
description: "The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"video":
type: "string"
nullable: true
description: "The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og"
"rewrite":
type: "boolean"
default: false
description: "Whether the short link uses link cloaking."
"ios":
type: "string"
nullable: true
description: "The iOS destination URL for the short link for iOS device targeting."
"android":
type: "string"
nullable: true
description: "The Android destination URL for the short link for Android device targeting."
"geo": {"$ref": "#/components/schemas/linkGeoTargeting"}
"doIndex":
type: "boolean"
default: false
description: "Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"
"utm_source":
type: "string"
nullable: true
description: "The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."
"utm_medium":
type: "string"
nullable: true
description: "The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."
"utm_campaign":
type: "string"
nullable: true
description: "The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."
"utm_term":
type: "string"
nullable: true
description: "The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."
"utm_content":
type: "string"
nullable: true
description: "The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."
"ref":
type: "string"
nullable: true
description: "The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."
required: