Media
Upload, organize, and manage images, videos, and PDFs in your Oktopost Media Library.
Media assets are images, videos, and PDFs stored in your Oktopost Media Library that can be attached to posts and messages. The Media Library centralizes all visual content shared through the platform, making it easy to reuse assets across multiple posts and campaigns. Use these endpoints to upload new media, retrieve asset details, browse your library, and manage your visual content.
Media assets uploaded to your library can be reused across multiple posts and messages, eliminating the need to re-upload the same image, video, or PDF for different social profiles or campaigns.
Get Media
Get single media object by Id.
Example Request
curl -i https://api.oktopost.com/v2/media/026000000000000Example Result
{
"Result": true,
"Media": {
"Id":"026000000000000",
"Created":"2015-07-22 10:44:21",
"Modified":"2015-07-22 10:44:21",
"AccountId":"001000000000000",
"Status":"valid",
"FolderId":"035000000000001",
"CreatedBy":"00A000000000000",
"ModifiedBy":"00A000000000000",
"Type":"ImageUrl",
"Size":0,
"Resource":"http:\/\/ww1.prweb.com\/prfiles\/2013\/08\/30\/11077903\/India%20Water%20Pumps%20Market.JPG",
"Name":"http:\/\/ww1.prweb.com\/prfiles\/2013\/08\/30\/11077903\/India%20Water%2",
"Description":""
}
}List Media
List account media assets. To list assets within a specific folder, use the folderId parameter. See Folders for managing folders.
Example Request
curl -i https://api.oktopost.com/v2/mediaTo list media in a specific folder:
curl -i https://api.oktopost.com/v2/media?folderId=035000000000001To list only root-level media (not inside any folder):
curl -i https://api.oktopost.com/v2/media?folderId=Example Result
{
"Result":true,
"Items":[
{
"Id": "026000000000000",
"AccountId": "001000000000000",
"Status": "valid",
"FolderId": "035000000000001",
"Created": "2019-09-22 14:58:12",
"Modified": "2019-09-22 14:58:12",
"CreatedBy": "00A000000000000",
"ModifiedBy": "00A000000000000",
"Type": "Image",
"Size": "147068",
"Resource": "https://s3.amazonaws.com/com-oktopost-app-message-pictures/e4cda957-c14d-4914-ae60-86a4043ae055/Londonteamoutofoffice.jpeg",
"Name": "London team out of office.jpeg",
"Description": "",
"MimeType": "image/jpeg",
"VideoId": null,
"VideoPreview": null
},
...
],
"Total":696
}Parameters
| Param | Description |
|---|---|
| q | The file name that you want to search for. |
| type | Image, Video, ImageUrl, or PDF |
| folderId | Filter media by folder. Pass a folder ID to list assets in that folder. Pass an empty value to list only root-level assets (not inside any folder). Omit the parameter entirely to list assets across all folders. |
Create Media
Create a new media asset. Resource must consist of a valid image URL that can be publicly accessed. On success, this endpoint will return a similar response to the GET endpoint.
Parameters
| Field | Required | Description |
|---|---|---|
| resource | Yes | A publicly accessible image URL. |
| folderId | No | Folder to create the asset in. Omit or leave empty to create it at the root. Pass a folder ID to create it in that folder. An unknown folder returns 400. |
Example Request
curl -i https://api.oktopost.com/v2/media -X POST \
-d resource="https://www.oktopost.com/assets/img/oktopost-og.png"To create the asset in a folder:
curl -i https://api.oktopost.com/v2/media -X POST \
-d resource="https://www.oktopost.com/assets/img/oktopost-og.png" \
-d folderId="035000000000001"Update Media
Move a media asset between folders. This endpoint supports folderId only.
Pass a folder ID to move the asset into that folder. Pass an empty folderId to move it to the root. Omit folderId to leave the folder unchanged. On success, the response is the same media object as the GET endpoint, reflecting the folder after the request.
Parameters
| Field | Required | Description |
|---|---|---|
| folderId | No | Destination folder. Pass a folder ID to move the asset into that folder. Pass an empty value to move it to the root. Omit the parameter to leave the folder unchanged. An unknown folder returns 400. |
Example Request
curl -i https://api.oktopost.com/v2/media/026000000000000 -X PUT \
-d folderId="035000000000001"To move the asset to the root:
curl -i https://api.oktopost.com/v2/media/026000000000000 -X PUT \
-d folderId=Delete Media
Delete asset from media library.
Example Request
curl -i https://api.oktopost.com/v2/media/026000000000000 -X DELETE