Blame

e3558d DonovanDMC 2026-01-16 20:16:15
1
# Shortener
2
3
An [[API Key|YiffyAPI/APIKey]] <span style="color: red;">is</span> required for this service. See [[Shared Responses|YiffyAPI/Shared Responses]] for common error responses.
4
5
## Shorten A URL
6
> <code><span style="color: rgb(0, 136, 71);">POST</span></code> `https://yiff.rocks/create`
7
8
::: none
9
# Query Parameters
10
| Name | Type | Description |
11
| -------- | ------- | -------------------------------------------------------------------------- |
12
| editable | Boolean | If the shortened url should be editable (you will get a code to edit with) |
13
:::
14
15
::: none
16
# Body Parameters
17
| Name | Type | Description |
18
| ------------------------------------------------------ | ------ | ----------------------------------------------------------------------------------------- |
19
| code | String | The code to use, random if not specified. |
20
| credit | String | The name to credit, defaults to the discord name of the user associated with the api key. |
21
| url <span style="color: red" title="required">*</span> | String | The URL to shorten |
22
:::
23
24
::: success
25
# 200 OK: Success
26
```json
27
{
28
"success": true,
29
"data": {
30
"code": "ac611fcb338457fc4b3b83ad7072d632",
31
"createdAt": "2026-01-16T13:45:04.851-06:00",
32
"modifiedAt": "2026-01-16T13:45:04.851-06:00",
33
"url": "https://static.femboy.fan/posts/ac/61/ac611fcb338457fc4b3b83ad7072d632.png",
34
"pos": 37509,
35
"credit": "YiffyAPI",
36
"fullURL": "https://yiff.rocks/ac611fcb338457fc4b3b83ad7072d632"
37
}
38
}
39
```
40
:::
41
42
::: danger
43
# 409 Conflict: Code In Use
44
```json
45
{
46
"success": false,
47
"code": 1072,
48
"message": "Code has already been taken",
49
"errors": {}
50
}
51
```
52
:::
53
54
::: danger
55
# 422 Unprocessable Entity: Code Too Long
56
```json
57
{
58
"success": false,
59
"code": 1070,
60
"message": "Code is too long",
61
"errors": {}
62
}
63
```
64
:::
65
66
::: danger
67
# 422 Unprocessable Entity: Invalid Code
68
```json
69
{
70
"success": false,
71
"code": 1071,
72
"message": "Code is invalid",
73
"errors": {}
74
}
75
```
76
:::
77
78
::: danger
79
# 422 Unprocessable Entity: Invalid URL
80
```json
81
{
82
"success": false,
83
"code": 1073,
84
"message": "Url is invalid",
85
"errors": {}
86
}
87
```
88
:::
89
90
::: danger
91
# 422 Unprocessable Entity: URL Too Long
92
```json
93
{
94
"success": false,
95
"code": 1081,
96
"message": "Url is too long",
97
"errors": {}
98
}
99
```
100
:::
101
102
::: danger
103
# 422 Unprocessable Entity: Credit Too Long
104
```json
105
{
106
"success": false,
107
"code": 1074,
108
"message": "Creator name is too long",
109
"errors": {}
110
}
111
```
112
:::
113
114
<hr>
115
116
## Get A Short URL (Redirect)
117
> <code><span style="color: rgb(52, 141, 248);">GET</span></code> `https://yiff.rocks/{code}`
118
119
::: none
120
# Path Parameters
121
| Name | Type | Description |
122
| ------------------------------------------------------- | ------ | --------------------------------- |
123
| code <span style="color: red" title="required">*</span> | String | The code of the short url to get. |
124
:::
125
126
::: success
127
# 302 Found: Redirect
128
```
129
// Redirected to url
130
```
131
:::
132
133
::: danger
134
# 404 Not Found: Not Found
135
```
136
Unknown short url code.
137
```
138
:::
139
140
<hr>
141
142
## Get A Short URL (Preview)
143
> <code><span style="color: rgb(52, 141, 248);">GET</span></code> `https://yiff.rocks/{code}+`
144
145
::: none
146
# Path Parameters
147
| Name | Type | Description |
148
| ------------------------------------------------------- | ------ | --------------------------------- |
149
| code <span style="color: red" title="required">*</span> | String | The code of the short url to get. |
150
:::
151
152
::: success
153
# 200 OK: Success
154
```
155
// HTML page
156
```
157
:::
158
159
::: danger
160
# 404 Not Found: Not Found
161
```
162
Unknown short url code.
163
```
164
:::
165
166
<hr>
167
168
## Get A Short URL (JSON)
169
> <code><span style="color: rgb(52, 141, 248);">GET</span></code> `https://yiff.rocks/{code}.json`
170
171
::: none
172
# Path Parameters
173
| Name | Type | Description |
174
| ------------------------------------------------------- | ------ | --------------------------------- |
175
| code <span style="color: red" title="required">*</span> | String | The code of the short url to get. |
176
:::
177
178
::: success
179
# 200 OK: Success
180
```json
181
{
182
"success": true,
183
"data": {
184
"code": "ac611fcb338457fc4b3b83ad7072d632",
185
"createdAt": "2026-01-16T13:45:04.851-06:00",
186
"modifiedAt": "2026-01-16T13:45:04.851-06:00",
187
"url": "https://static.femboy.fan/posts/ac/61/ac611fcb338457fc4b3b83ad7072d632.png",
188
"pos": 37509,
189
"credit": "YiffyAPI",
190
"fullURL": "https://yiff.rocks/ac611fcb338457fc4b3b83ad7072d632"
191
}
192
}
193
```
194
:::
195
196
::: danger
197
# 404 Not Found: Not Found
198
```json
199
{
200
"success": false,
201
"code": 1075,
202
"error": "A short url with that code was not found."
203
}
204
```
205
:::
206
207
<hr>
208
209
## Delete A Short URL
210
> <code><span style="color: rgb(211, 61, 61);">DELETE</span></code> `https://yiff.rocks/{code}.json`
211
212
::: none
213
# Request Body
214
| Name | Type | Description |
215
| ----------------------------------------------------------------- | ------ | ------------------------------------------------------------ |
216
| managementCode <span style="color: red" title="required">*</span> | String | The management code you received when creating the shorturl. |
d4ef7d DonovanDMC 2026-01-16 20:17:18
217
:::
e3558d DonovanDMC 2026-01-16 20:16:15
218
219
::: success
220
# 204 No Content: Success
221
```
222
// No Content
223
```
224
:::
225
226
::: danger
227
# 401 Unauthorized: Management Code Required
228
```json
229
{
230
"success": false,
231
"code": 1076,
232
"message": "A management code is required."
233
}
234
```
235
:::
236
237
::: danger
238
# 401 Unauthorized: Management Code Mismatch
239
```json
240
{
241
"success": false,
242
"code": 1078,
243
"message": "That management code does not match this short url."
244
}
245
```
246
:::
247
248
::: danger
249
# 403 Forbidden: No Management Code
250
```json
251
{
252
"success": false,
253
"code": 1077,
254
"message": "That short url cannot be edited by you."
255
}
256
```
257
:::
258
259
::: danger
260
# 404 Not Found: Not Found
261
```json
262
{
263
"success": false,
264
"code": 1075,
265
"message": "A short url with that code was not found."
266
}
267
```
268
:::
269
270
<hr>
271
272
## Modify A Short URL
273
> <code><span style="color: rgb(115, 92, 255);">PATCH</span></code> `https://yiff.rocks/{code}.json`
274
275
::: none
276
# Request Body
277
| Name | Type | Description |
278
| ----------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------- |
279
| managementCode <span style="color: red" title="required">*</span> | String | The management code you received when creating the shorturl. |
280
| credit | String | The name to credit, defaults to the discord name of the user associated with the api key. |
d4ef7d DonovanDMC 2026-01-16 20:17:18
281
| url | String | The URL to shorten |
e3558d DonovanDMC 2026-01-16 20:16:15
282
:::
283
284
::: success
285
# 204 No Content: Success
286
```
287
// No Content
288
```
289
:::
290
291
::: danger
292
# 400 Bad Request: No Changes
293
```json
294
{
295
"success": false,
296
"code": 1080,
297
"message": "No changes were detected."
298
}
299
```
300
:::
301
302
::: danger
303
# 401 Unauthorized: Management Code Required
304
```json
305
{
306
"success": false,
307
"code": 1076,
308
"message": "A management code is required."
309
}
310
```
311
:::
312
313
::: danger
314
# 401 Unauthorized: Management Code Mismatch
315
```json
316
{
317
"success": false,
318
"code": 1078,
319
"message": "That management code does not match this short url."
320
}
321
```
322
:::
323
324
::: danger
325
# 403 Forbidden: No Management Code
326
```json
327
{
328
"success": false,
329
"code": 1077,
330
"message": "That short url cannot be edited by you."
331
}
332
```
333
:::
334
335
::: danger
336
# 404 Not Found: Not Found
337
```json
338
{
339
"success": false,
340
"code": 1075,
341
"message": "A short url with that code was not found."
342
}
343
```
344
:::
345
346
::: danger
347
# 422 Unprocessable Entity: Invalid URL
348
```json
349
{
350
"success": false,
351
"code": 1073,
352
"message": "Url is invalid",
353
"errors": {}
354
}
355
```
356
:::
357
358
::: danger
359
# 422 Unprocessable Entity: URL Too Long
360
```json
361
{
362
"success": false,
363
"code": 1081,
364
"message": "Url is too long",
365
"errors": {}
366
}
367
```
368
:::
369
370
::: danger
371
# 422 Unprocessable Entity: Credit Too Long
372
```json
373
{
374
"success": false,
375
"code": 1074,
376
"message": "Creator name is too long",
377
"errors": {}
378
}
379
```
380
:::