> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fucksornot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Tags

> Get and add tags to uploads

## Get Upload Tags

Retrieve all tags associated with an upload.

### Request

```bash theme={null}
curl https://fucksornot.com/api/uploads/550e8400-e29b-41d4-a716-446655440000/tags
```

### Response

```json theme={null}
{
  "tags": [
    {
      "id": "tag-uuid-1",
      "name": "gadget",
      "slug": "gadget"
    },
    {
      "id": "tag-uuid-2",
      "name": "tech",
      "slug": "tech"
    }
  ]
}
```

***

## Add Tags to Upload

Add tags to an existing upload.

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://fucksornot.com/api/uploads/550e8400-e29b-41d4-a716-446655440000/tags \
    -H "Cookie: auth-token=YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"tags": ["new-tag", "another-tag"]}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://fucksornot.com/api/uploads/550e8400-e29b-41d4-a716-446655440000/tags',
    {
      method: 'POST',
      credentials: 'include',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        tags: ['new-tag', 'another-tag']
      })
    }
  );
  ```
</CodeGroup>

### Parameters

| Parameter | Type  | Description                                 |
| --------- | ----- | ------------------------------------------- |
| `tags`    | array | Array of tag names (max 10 total on upload) |

### Response

```json theme={null}
{
  "success": true,
  "tags": [
    {
      "id": "tag-uuid-1",
      "name": "gadget",
      "slug": "gadget"
    },
    {
      "id": "tag-uuid-2",
      "name": "new-tag",
      "slug": "new-tag"
    },
    {
      "id": "tag-uuid-3",
      "name": "another-tag",
      "slug": "another-tag"
    }
  ],
  "added": 2
}
```

`tags` is the full, updated list of tags on the upload after the request. `added` is the number of tags that were newly added (tags already present on the upload are silently skipped and not counted).

## Tag Limits

* Maximum **10 tags** per upload
* If adding tags would exceed the limit, the request is rejected
* Tag names must be between **2 and 50 characters**
* Tag names can only contain letters, numbers, spaces, and hyphens — names with other characters are rejected (with a `400` error), not stripped
* Tag names are trimmed, but their case is preserved (only the generated `slug` is lowercased)
* Tags that are already on the upload are silently ignored — they don't count toward `added` and won't cause an error

## Authorization

* Only the upload owner can add tags
* Admins can add tags to any upload

## Errors

| Status | Description                                              |
| ------ | -------------------------------------------------------- |
| 400    | Tags array is required (missing, empty, or not an array) |
| 400    | Too many tags or invalid tag names                       |
| 401    | Not authenticated                                        |
| 403    | Not authorized (not the owner)                           |
| 404    | Upload not found                                         |
| 500    | Server error                                             |
