Repos API

post
Create a repo

https://pagecdn.com/api/v2/private/repo/create
Request
Response
Form Data Parameters
apikey
required
string
The api key to identify the originator of the request.
privacy
required
string
Privacy of this repo as private or shared.
origin
required
string
Specify the origin of your content as website or github. In case you want to upload your content manually or through AP, specify upload as origin.
repo_slug
optional
string
Specify the slug for repo. If left empty, API will automatically generate a random slug for you.
repo_name
optional
string
Human readable repo name.
namespace
optional
string
The default namespace for private and shared repos is repo. For shared repos, you can optionally specify a different namespace from lib, theme, plugin, data, widget.
origin_url
optional
string
Your website URL. In case you specified github origin, then this needs to be github repo URL.
cache_buster
optional
boolean
1 to enable in-URL cache buster, 0 to disable this feature.
update_css_paths
optional
boolean
Serving files through PageCDN requires change in URLs of resources. If this breaks paths of resources linked from inside CSS files, turn path correction feature on by specifying 1.
import_dir
optional
string
For github only. If you want to import resources from a specific directory only, you can specify directory path. For example: dist or dist/assets.
keywords
optional
string
Comma separated keywords.
200: OK
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": {
"repo": "repo/58a057e3596a259721d1",
"repo_name": "58a057e3596a259721d1",
"cdn_base": "https://pagecdn.io/repo/58a057e3596a259721d1"
}
}

post
Upload a file to repo

https://pagecdn.com/api/v2/private/repo/upload
Request
Response
Form Data Parameters
apikey
required
string
The api key to identify originator of the request.
repo
required
string
The repo where you want to upload file as repo/my-website-repo.
dir
optional
string
If you want to upload file to a path deep down in the repo, you can specify it. For example, if you want to upload file to repo/my-website-repo/assets/static/css/styles.css then you can specify the path as /assets/static/css
file
required
string
The file to be attached.
200: OK

get
List repo files

https://pagecdn.com/api/v2/private/repo/files
Request
Response
Query Parameters
apikey
required
string
The api key to identify originator of the request.
repo
required
string
The repo of which you want to list files, as repo/my-website-repo.
200: OK
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": {
"count": 5282,
"files": [
{
"version": "3.4.0",
"file_hash": "0d864c082f074c2f900ebe5035a21c7d1ed548fb5c212ca477ee9e4a6056e6aa",
"file_url": "https://pagecdn.io/lib/jquery/3.4.0/jquery.js"
},
{
"version": "3.4.0",
"file_hash": "0497a8d2a9bde7db8c0466fae73e347a3258192811ed1108e3e096d5f34ac0e8",
"file_url": "https://pagecdn.io/lib/jquery/3.4.0/jquery.min.js"
},
{
"version": "3.4.0",
"file_hash": "9a295ecf1e656a4ad9bb438ff5bd90585cb57edfd41142ba347d49ab3f215214",
"file_url": "https://pagecdn.io/lib/jquery/3.4.0/jquery.slim.js"
},
...
]
}
}

Sample Requests

https://pagecdn.com/api/v2/private/repo/files?apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&repo=lib/jquery

get
Repo info

https://pagecdn.com/api/v2/private/repo/info
Request
Response
Query Parameters
apikey
required
string
The api key to identify originator of the request.
repo
required
string
The repo of which you want to get info, as repo/my-website-repo.
200: OK
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": {
"repo": "lib/jquery",
"repo_name": "jQuery",
"cdn_base": "https://pagecdn.io/lib/jquery",
"privacy": "public",
"created_on": 1555420054,
"origin": "github",
"origin_url": "https://github.com/jquery/jquery-dist",
"import_dir": "",
"description": "",
"main_files": "jquery.min.js\njquery.slim.min.js",
"server_push": "",
"server_push_trigger": "",
"cache_buster": "0",
"update_css_paths": "0",
"github_webhook_secret": "798603432e84487174a041c1e512e3595c371c4ab8579ec32bcab298b005652a",
"browser_cache_number": "-1",
"browser_cache_period": "seconds",
"edge_cache_number": "-1",
"edge_cache_period": "seconds",
"compression_level": "extreme",
"compression_method": "gzip",
"force_downloads": "0",
"usage": {
"storage": 86106278,
"bandwidth": 0,
"files": 5282
},
"versions": [
"1.0",
"1.0.1",
"1.0.2",
"1.0.3",
"1.0.4",
"1.0a",
"1.1",
"1.1.1",
"1.1.2",
"1.1.3",
"1.1.3.1",
"1.1.3a",
"1.1.4",
"1.10.0",
"1.10.1",
"1.10.2",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.1+1",
"1.12.2",
"1.12.3",
"1.12.4",
"1.1a",
"1.1b",
"1.2",
"1.2.1",
"1.2.2",
"1.2.2b",
"1.2.2b2",
"1.2.3",
"1.2.3a",
"1.2.3b",
"1.2.4",
"1.2.4a",
"1.2.4b",
"1.2.5",
"1.2.6",
"1.3",
"1.3.0",
"1.3.1",
"1.3.2",
"1.3b1",
"1.3b2",
"1.4",
"1.4.0",
"1.4.1",
"1.4.2",
"1.4.3",
"1.4.4",
"1.4a1",
"1.4a2",
"1.5",
"1.5.0",
"1.5.1",
"1.5.2",
"1.5b1",
"1.6",
"1.6.0",
"1.6.1",
"1.6.2",
"1.6.3",
"1.6.4",
"1.6b1",
"1.7",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.2b1",
"1.7b1",
"1.7b2",
"1.8.0",
"1.8.1",
"1.8.2",
"1.8.3",
"1.8.3+1",
"1.8b1",
"1.8b2",
"1.9.0",
"1.9.0b1",
"1.9.1",
"2.0.0",
"2.0.0b1",
"2.0.0b2",
"2.0.1",
"2.0.2",
"2.0.3",
"2.1.0",
"2.1.1",
"2.1.2",
"2.1.3",
"2.1.4",
"2.2.0",
"2.2.1",
"2.2.2",
"2.2.3",
"2.2.4",
"3.0.0",
"3.1.0",
"3.1.1",
"3.2.0",
"3.2.1",
"3.3.0",
"3.3.1",
"3.4.0",
"3.4.1"
]
}
}

Sample Requests

https://pagecdn.com/api/v2/private/repo/info?apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&repo=lib/jquery

get
Delete repo

https://pagecdn.com/api/v2/private/repo/delete
Request
Response
Query Parameters
apikey
required
string
The api key to identify originator of the request.
repo
required
string
The repo that you want to delete, as repo/my-website-repo.
200: OK
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": []
}

Sample Requests

https://pagecdn.com/api/v2/private/repo/delete?apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&repo=lib/jquery

get
Delete repo files

https://pagecdn.com/api/v2/private/repo/delete-files
Request
Response
Query Parameters
apikey
required
string
The api key to identify originator of the request.
repo
required
string
The repo of which you want to delete files, as repo/my-website-repo.
200: OK
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": []
}

Sample Requests

https://pagecdn.com/api/v2/private/repo/delete-files?apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&repo=lib/jquery

get
Purge edge cache

https://pagecdn.com/api/v2/private/repo/purge
Request
Response
Query Parameters
apikey
required
string
The api key to identify originator of the request.
repo
required
string
The repo of which you want to purge edge cache, as repo/my-website-repo.
200: OK
{
"status": "200",
"message": "Ok",
"details": "Success",
"response": []
}

Sample Requests

https://pagecdn.com/api/v2/private/repo/purge?apikey=160a426ff2894252cd7cebbdd6d6b7da8fcd319c65b70468f10b6690c45d02ef&repo=lib/jquery