Media

Create an upload URL

Changed on

Create a one-time upload URL, for code that cannot send the API key with the upload, such as an AI assistant's code sandbox. POST the file as multipart file to upload_url (POST /media/upload-by-token) within 10 minutes; the URL works once. The MCP server's upload tool uses this flow. Requires the media:write scope.

post/media/create-upload-url

Request

  • Base URL
    https://api.omnisocials.com/v1
  • URL
    https://api.omnisocials.com/v1/media/create-upload-url
  • Auth
    HTTP bearer

Response

The one-time upload URL and how to use it.

upload_urlstring

POST the file here (POST /media/upload-by-token with the token in the query).

upload_tokenstring

The one-time token (64 hex characters), also part of upload_url.

expires_in_secondsinteger
methodstring
content_typestring
instructionsstring

Upload commands (curl and Python) written for an AI assistant's code sandbox.

hintstring

What an AI assistant should tell the user when its sandbox blocks the upload host.

Example response

{
  "upload_url": "https://api.omnisocials.com/v1/media/upload-by-token?upload_token=9f2c4e1ab07d",
  "upload_token": "9f2c4e1ab07d",
  "expires_in_seconds": 600,
  "method": "POST",
  "content_type": "multipart/form-data"
}

Changes