---
agentTools:
  projectIndex: https://docs.gifs.com/llms.txt
---

# /media/upload

You can upload `image/gif`, `video/mp4`, and `video/webm` media by sending a `POST` `multipart/form-data` request. 

Use your Authentication Key for added benefits. Read [Authentication Key](http://docs.gifs.com/docs/authentication-key) for full benefits.

[block:textarea]
{
  "text": "## Request",
  "sidebar": true
}
[/block]

[block:code]
{
  "codes": [
    {
      "language": "curl",
      "code": "curl \\\n  -H \"Gifs-API-Key: gifs56d63999f0f34\" \\\n  -F \"file=@/media/gifs/awesome.gif\" \\\n  -F \"title=The most awesome gif eva\" \\\n  -F \"tags=awesome, cool, fun, gnarly\" \\\n  https://api.gifs.com/media/upload"
    }
  ],
  "sidebar": true
}
[/block]

[block:textarea]
{
  "text": "## Results",
  "sidebar": true
}
[/block]

[block:code]
{
  "codes": [
    {
      "status": 200,
      "language": "json",
      "code": "{\n \"success\":{\n    \"page\": \"https://gifs.com/gif/2k9BMv\",\n    \"files\": {\n        \"gif\": \"https://j.gifs.com/2k9BMv.gif\",\n        \"jpg\": \"https://j.gifs.com/2k9BMv.jpg\",\n        \"mp4\": \"https://j.gifs.com/2k9BMv.mp4\",\n        \"webm\": \"https://j.gifs.com/2k9BMv.webm\"\n    },\n    \"oembed\": \"https://gifs.com/oembed/2k9BMv\",\n    \"embed\": \"<iframe src='https://gifs.com/embed/2k9BMv' frameborder='0' scrolling='no' width='640' height='360' style='-webkit-backface-visibility: hidden;-webkit-transform: scale(1);' ></iframe>\",\n    \"meta\": {\n        \"duration\": \"4.104s\",\n        \"frames\": \"123\",\n        \"height\": \"360\",\n        \"width\": \"640\"\n    }\n }\n}",
      "name": 200
    },
    {
      "status": 400,
      "language": "json",
      "code": "{\n    \"errors\": {\n        \"message\": \"We've encountered an unexpected issue, please try again.\"\n    }\n}",
      "name": 400
    }
  ],
  "sidebar": true
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "API Settings",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.gifs.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "gifs-api-key",
        "in": "header",
        "x-default": "gifs56d63999f0f34"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/media/upload": {
      "post": {
        "summary": "/media/upload",
        "description": "You can upload `image/gif`, `video/mp4`, and `video/webm` media by sending a `POST` `multipart/form-data` request. \n\nUse your Authentication Key for added benefits. Read [Authentication Key](http://docs.gifs.com/docs/authentication-key) for full benefits.",
        "operationId": "mediaupload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The file being uploaded",
                    "format": "binary"
                  },
                  "title": {
                    "type": "string",
                    "description": "The title of the media"
                  },
                  "tags": {
                    "type": "array",
                    "description": "The tags relating the the media",
                    "items": {
                      "type": "string"
                    }
                  },
                  "nsfw": {
                    "type": "boolean",
                    "description": "If the media is not safe for work"
                  },
                  "attribution_site": {
                    "type": "string",
                    "description": "twitter, reddit, instagram, or a custom URL"
                  },
                  "attribution_user": {
                    "type": "string",
                    "description": "The username for social media sites"
                  },
                  "attribution_url": {
                    "type": "string",
                    "description": "The url if site != social media"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "63053f479807941f67a92c32:56cfa3cf287eb20b009f9fe9"
}
```