Upload
Get, list, and create media upload requests, and validate uploaded videos.
Get Upload
Retrieve a single upload by ID.
GET /v2/upload/:uploadId
Parameters
Prop
Type
Example Request
curl -X GET "https://api.oktopost.com/v2/upload/0up000000000001" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Upload": {
"Id": "0up000000000001",
"Created": "2020-06-25 06:49:51",
"Modified": "2020-06-25 06:51:20",
"CreatedBy": "00A000000000001",
"Status": "complete",
"Name": "MyVideo.mp4",
"MimeType": "video/mp4",
"TotalSize": 17839845,
"Downloaded": 17839845,
"Source": "https://example_download...",
"LastError": null,
"Attempts": 0,
"MediaId": "026000000000001"
}
}List Upload
Retrieve the account's uploads.
GET /v2/upload
Parameters
Prop
Type
See Pagination for shared behavior.
Example Request
curl -X GET "https://api.oktopost.com/v2/upload" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Items": [
{
"Id": "0up000000000001",
"Created": "2020-06-25 06:49:51",
"Modified": "2020-06-25 06:51:20",
"CreatedBy": "00A000000000001",
"Status": "complete",
"Name": "MyVideo.mp4",
"MimeType": "video/mp4",
"TotalSize": 17839845,
"Downloaded": 17839845,
"Source": "https://example_download...",
"LastError": null,
"Attempts": 0,
"MediaId": "026000000000001"
},
...
],
"Total": 696
}Create Upload
Create an upload request that downloads a file from a public URL.
POST /v2/upload
A completed PDF upload produces a Media asset with Type of PDF.
The maximum allowed file size for uploads is 8 GiB, with a 32 GiB upload limit within a sliding 24-hour window.
This endpoint only validates file size and MIME type and does not check your file against the social network's specifications. To check a video, use Validate Video Upload.
If the mimeType or name fields are not sent and cannot be determined from the source, the request fails.
Parameters
Prop
Type
Example Request
To upload a video:
curl -X POST "https://api.oktopost.com/v2/upload" \
-u ACCOUNT_ID:API_KEY \
-d source="https://example_download..." \
-d mimeType="video/mp4" \
-d name="MyFile.mp4"To upload a PDF:
curl -X POST "https://api.oktopost.com/v2/upload" \
-u ACCOUNT_ID:API_KEY \
-d source="https://example.com/file.pdf" \
-d mimeType="application/pdf" \
-d name="MyFile.pdf"Example Response
{
"Result": true,
"Upload": {
"Id": "0up000000000001",
"Created": "2020-06-25 06:49:51",
"Modified": "2020-06-25 06:51:20",
"CreatedBy": "00A000000000001",
"Status": "complete",
"Name": "MyVideo.mp4",
"MimeType": "video/mp4",
"TotalSize": 17839845,
"Downloaded": 17839845,
"Source": "https://example_download...",
"LastError": null,
"Attempts": 0,
"MediaId": "026000000000001"
}
}Chunked Uploads
If your file is larger than 10 MiB, Oktopost tries to download it in chunks. If one of the chunked requests fails, the system retries the download up to 5 times before failing the entire request.
To check whether your request has been processed, use the Get Upload endpoint. While the upload is in progress, Status is pending and MediaId is null.
{
"Result": true,
"Upload": {
"Id": "0up000000000001",
"Created": "2020-06-25 06:49:51",
"Modified": "2020-06-25 06:51:20",
"CreatedBy": "00A000000000001",
"Status": "pending",
"Name": "MyVideo.mp4",
"MimeType": "video/mp4",
"TotalSize": 17839845,
"Downloaded": 10000000,
"Source": "https://example_download...",
"LastError": null,
"Attempts": 0,
"MediaId": null
}
}Once the upload is complete, Status is complete, and you can use MediaId to reference the Media endpoint.
{
"Result": true,
"Upload": {
"Id": "0up000000000001",
"Created": "2020-06-25 06:49:51",
"Modified": "2020-06-25 06:51:20",
"CreatedBy": "00A000000000001",
"Status": "complete",
"Name": "MyVideo.mp4",
"MimeType": "video/mp4",
"TotalSize": 17839845,
"Downloaded": 17839845,
"Source": "https://example_download...",
"LastError": null,
"Attempts": 0,
"MediaId": "026000000000001"
}
}If the upload fails, Status is failed and LastError contains the error message.
{
"Result": true,
"Upload": {
"Id": "0up000000000001",
"Created": "2020-06-25 06:49:51",
"Modified": "2020-06-25 06:51:20",
"CreatedBy": "00A000000000001",
"Status": "failed",
"Name": "MyVideo.mp4",
"MimeType": "video/mp4",
"TotalSize": 17839845,
"Downloaded": 5000000,
"Source": "https://example_download...",
"LastError": "Could not download file, error 500",
"Attempts": 5,
"MediaId": null
}
}Validate Video Upload
Check an uploaded video against each social network's video requirements.
GET /v2/video-validate/:mediaId
Parameters
Prop
Type
Example Request
curl -X GET "https://api.oktopost.com/v2/video-validate/026000000000001" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Validations": {
"Facebook": {
"isValid": true,
"errors": []
},
"LinkedIn": {
"isValid": true,
"errors": []
},
"Twitter": {
"isValid": true,
"errors": []
},
"Instagram": {
"isValid": true,
"errors": []
},
"InstagramStory": {
"isValid": true,
"errors": []
},
"Youtube": {
"isValid": true,
"errors": []
},
"TikTok": {
"isValid": true,
"errors": []
},
"Threads": {
"isValid": true,
"errors": []
},
"Bluesky": {
"isValid": true,
"errors": []
}
}
}