Try it

Create a file

Additionally, a file can be sent with:

  • multipart/form-data POST request: in this case all property names are the same as the JSON ones (file is an uploaded file)
  • file body request: the file body is sent as the request body, with the appropriate Content-Type. No additional properties can be set along the request data

The following file types only are allowed:

  • jpg
  • png
  • gif
  • pdf
  • mp3

If using a Publishable Api Key, only private files can be created. The files can later on be modified or used using a secret API key.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used)

Request Body schema: application/json
One of
  • FileCreateFromInline
  • FileCreateFromUrl
file
required
string

The file in base64 encoded format.

isPublic
boolean

The File visibility. If public a permalink is provided.

name
string

The file name used for downloading

description
string

The file description

tags
Array of strings

The tags list

Responses

201

File was created

401

Unauthorized access, invalid credentials was used

403

Access forbidden

422

Invalid data was sent

post/files

Live Server

https://api.rebilly.com/v2.1/files

Sandbox Server

https://api-sandbox.rebilly.com/v2.1/files

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "file": "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",
  • "isPublic": false,
  • "name": "logo.png",
  • "description": "My file description",
  • "tags":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "name": "string",
  • "extension": "string",
  • "description": "string",
  • "tags":
    [
    ],
  • "mime": "image/png",
  • "size": 0,
  • "width": 0,
  • "height": 0,
  • "sha1": "string",
  • "createdTime": "2020-08-05T14:26:34Z",
  • "updatedTime": "2020-08-05T14:26:34Z",
  • "isPublic": true,
  • "_links":
    [
    ]
}