Skip to main content
POST
Upload Files
Upload between 1 and 50 files in one request. Every upload creates a post. Two or more files are grouped into one album post unless you ask for individual posts.

Headers

Header values are trimmed and case-insensitive. Boolean headers accept only true or false; anything else returns 400.

Form fields

Behavior

  • One file: creates one post. post-type is ignored.
  • Two or more files: creates one album post, or one post per file with post-type: individual.
  • Response shape: when one post is created the body is {url, post}, where url is the direct URL of the post’s first file (post.files[0].url). When several posts are created (individual), the body is {posts}. An album where only one file survived also returns {url, post}.
  • url and post.url: the top-level url is the direct file on i.snipp.gg. post.url is the share page, https://snipp.gg/p/{code}, or https://{domain}/{code} when the account has picked another link domain.
  • Private posts: file URLs are signed and expire after 24 hours. Fetch the post again with GET /posts/{code} for fresh ones.
  • Videos: .mp4, .mov and .mkv are remuxed to MP4 with +faststart, so .mov and .mkv come back with an .mp4 name. A file that cannot be remuxed is rejected as corrupt. Uploaded videos get a thumbnail in files[].thumbnail_url. See File Types.
  • Metadata: stripped by default. PNG, JPG, WebP and GIF are stripped at any size without re-encoding, so pixels are untouched; JPG and WebP keep their orientation and GIF keeps its animation. Videos lose container metadata during the remux.
  • Priority streaming: eligible videos use adaptive streaming by default and spend priority minutes. post.priority is true when a video was queued for it. Minutes are charged after the response; if your budget runs out first, the video falls back to standard quality and the post later reports priority: false.
  • Partial failures: files that fail are listed in failed, each with its zero-based index and an error object. The stored files are still returned with 200.
  • Every file failed: a one-file request returns that file’s error at the top level, with 413 for file_too_large, 500 for internal and 400 otherwise. A request with several files returns 400 with type upload_failed and the same failed array. See Errors.
  • Weekly quota: a file that would exceed your weekly usage limit fails with type quota_exceeded, carrying quota, used and resets_at.
  • Size limits: a file over your plan’s per-file limit fails with type file_too_large. A request whose declared Content-Length is already larger than your weekly quota (or 50 times the per-file limit) is refused with 413 before any file is read.
  • Team keys: posts are always created private, whatever post-privacy says, and count against the team’s quota. A lapsed team returns 403 with type forbidden.
  • New posts are scanned automatically. A flagged post is moderated after the response.

Examples

One file:
An album:
One post per file:

Responses

One file:
A private upload. The file URLs are signed:
An album:
Individual posts, where the third file went over the weekly quota:
Every file failed:

Errors

Authorizations

api-key
string
header
required

Your API key from an app on snipp.gg/settings/apps

Headers

post-privacy
enum<string>
default:private

public, unlisted or private. Omitted means private.

Available options:
public,
unlisted,
private
post-type
enum<string>
default:album

album or individual. Only matters for two or more files.

Available options:
album,
individual
include-metadata
boolean
default:false

true keeps file metadata. Omitted or false strips it.

priority
boolean
default:true

false opts videos out of priority (adaptive) streaming.

Body

multipart/form-data
file
file[]
required

1 to 50 files. Repeat the file field.

title
string

Up to 30 characters.

Maximum string length: 30
description
string

Up to 200 characters.

Maximum string length: 200

Response

Success

One post was created.

url
string
required

Direct URL of the first file (post.files[0].url).

post
object
required
failed
object[]