Postly
  1. Files
Postly
  • Overview
  • Workspaces
    • Fetch workspaces
      GET
  • Social Accounts
    • Fetch social accounts
      GET
  • Files
    • Upload a file
      POST
    • Fetch files
      GET
    • Delete a file
      DELETE
  • Posts
    • Create a post
      POST
    • Update a post
      PUT
    • Fetch a post
      GET
    • Fetch posts
      GET
    • Delete a post
      DELETE
  1. Files

Upload a file

POST
/{workspaceId}/files
Uploads a binary file and associates it with the specified workspace.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.postly.ai/v2/683594f9d6bb51f6b3000000/files' \
--header 'X-File-Size: 29994' \
--header 'X-API-KEY;' \
--form 'file=@""'
Response Response Example
200 - FileUploadSuccess
{
    "code": 200,
    "message": "File uploaded successfully",
    "data": {
        "url": "https://files.postly.ai/a.png",
        "type": "image/png"
    }
}

Request

Authorization
API Key
Add parameter in header
X-API-KEY
Example:
X-API-KEY: ********************
or
Path Params
workspaceId
string 
required
24-character hexadecimal identifier for the workspace
Example:
683594f9d6bb51f6b3000000
Header Params
X-File-Size
string 
required
Size of the file in bytes
Example:
29994
Body Params multipart/form-data
file
file 
required
The file to upload

Responses

🟢200FileUploadSucces
application/json
Body
code
string 
required
200
message
string 
required
File uploaded successfully
data
object (FileData) 
required
url
string 
required
Public URL of the media file
type
string 
required
MIME type of the media (e.g., image/png, video/mp4)
🟠400BadRequestResponse
🟠401UnAuthorizedResponse
Modified at 2025-05-29 22:19:53
Previous
Fetch social accounts
Next
Fetch files
Built with