NOTE: These documents refer to an outdated version of Siteleaf, and are provided for archival purposes. For help with the latest version of the Siteleaf API see http://learn.siteleaf.com/api/.
Siteleaf uses Basic Auth of the user's API key and secret to authenticate each request. To retrieve a user's API key and secret, use the POST /v1/auth
endpoint, passing the user's email and password authenticated with Basic Auth.
curl -X GET -u api_key:api_secret https://api.siteleaf.com/<api_endpoint>
Authenticates user and returns user API keys
curl -X POST -u email:password https://api.siteleaf.com/v1/auth.json
{
"api_key": "e4f5b6acae2c39079c07e35d90d87b1c",
"api_secret": "106afa1abf96767774bbcc4dd766d419"
}
Pings the server.
{
"ping": "pong"
}
Returns the current user.
{
"id": "51af47a8ef75ac5e8c000001",
"email": "[email protected]",
"firstname": "Barack",
"lastname": "Obama",
"fullname": "Barack Obama",
"created_at": "2015-06-24T10:08:20.741-04:00",
"updated_at": "2015-06-24T10:08:20.741-04:00"
}
Returns array of users associated with your sites and the sites you belong to.
[
{
"id": "51af47a8ef75ac5e8c000001",
"email": "[email protected]",
"firstname": "Barack",
"lastname": "Obama",
"fullname": "Barack Obama",
"created_at": "2015-06-24T10:08:20.746-04:00",
"updated_at": "2015-06-24T10:08:20.746-04:00"
}
]
Returns an array of sites that the authenticated user belongs to.
- domain (optional) — Site domain
- include (optional) — Array of entities to include (
user
,pages
,assets
)
[
{
"id": "51af47c1ef75acd940000002",
"title": "My Site",
"domain": "mysite.com",
"cname": "abcdefghijklmnopqrst-abcdefghijklmnopqrstuvwxyz123456.a1.abc.rackcdn.com",
"timezone": "Eastern Time (US & Canada)",
"created_at": "2015-06-24T10:08:20.748-04:00",
"updated_at": "2015-06-24T10:08:20.748-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"meta": [
]
}
]
Creates a site belonging to the authenticated user.
- title — Site title
- domain — Site domain
- timezone (optional) — Site timezone
- meta (optional) — Array of Site metadata
{
"id": "51af47c1ef75acd940000002",
"title": "My Site",
"domain": "mysite.com",
"cname": "abcdefghijklmnopqrst-abcdefghijklmnopqrstuvwxyz123456.a1.abc.rackcdn.com",
"timezone": "Eastern Time (US & Canada)",
"created_at": "2015-06-24T10:08:20.746-04:00",
"updated_at": "2015-06-24T10:08:20.746-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"meta": [
]
}
Returns the given site.
- include (optional) — Array of entities to include (
user
,pages
,assets
)
{
"id": "51af47c1ef75acd940000002",
"title": "My Site",
"domain": "mysite.com",
"cname": "abcdefghijklmnopqrst-abcdefghijklmnopqrstuvwxyz123456.a1.abc.rackcdn.com",
"timezone": "Eastern Time (US & Canada)",
"created_at": "2015-06-24T10:08:20.746-04:00",
"updated_at": "2015-06-24T10:08:20.746-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"meta": [
]
}
Updates the given site.
- title (optional) — Site title
- domain (optional) — Site domain
- timezone (optional) — Site timezone
- meta (optional) — Array of Site metadata
- hosting (optional) — Site hosting (
siteleaf
,ftp
,s3
,cloudfiles
,github
) - ftp_settings (optional) — Site FTP settings (see hosting settings)
- s3_settings (optional) — Site S3 settings (see hosting settings)
- cloudfiles_settings (optional) — Site Cloudfiles settings (see hosting settings)
- github_settings (optional) — Site GitHub settings (see hosting settings)
- user_id (optional) — Site owner ID (must have role)
{
"id": "51af47c1ef75acd940000002",
"title": "My Site",
"domain": "mysite.com",
"cname": "abcdefghijklmnopqrst-abcdefghijklmnopqrstuvwxyz123456.a1.abc.rackcdn.com",
"timezone": "Eastern Time (US & Canada)",
"created_at": "2015-06-24T10:08:20.746-04:00",
"updated_at": "2015-06-24T10:08:20.746-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"meta": [
]
}
Deletes the given site.
Publishes the site in the background and returns a job id. Check it's status at GET /v1/jobs/:job_id
{
"job_id": "abcdef0123456789abcdef01"
}
Returns an array of all pages for the given site.
- include (optional) — Array of entities to include (
user
,site
,parent
,pages
,posts
,assets
)
[
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.751-04:00",
"updated_at": "2015-06-24T10:08:20.751-04:00",
"published_at": "2015-06-24T10:08:20.751-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
]
Creates a page on the given site.
- title — Page title
- body (optional) — Page body
- custom_slug (optional) — Page custom slug
- published_at (optional) — Page published date
- visibility (optional) — Page visibility (
draft
,hidden
,visible
) - user_id (optional) — Page author ID
- parent_id (optional) — Page parent ID
- meta (optional) — Array of Page metadata
- asset_ids (optional) — Array of existing Asset IDs
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.749-04:00",
"updated_at": "2015-06-24T10:08:20.749-04:00",
"published_at": "2015-06-24T10:08:20.749-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
Repositions pages on the given site.
- ids — Nested JSON array of Page IDs and their children
curl -u API_KEY:API_SECRET \
-X PUT \
-d 'ids=[{"id":"51a38..."},{"id":"51a15...","children":[{"id":"51a39..."},{"id":"51a40..."}]}]' \
https://api.siteleaf.com/v1/sites/51a158a8ef75ac1ada000001/pages
[
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.751-04:00",
"updated_at": "2015-06-24T10:08:20.751-04:00",
"published_at": "2015-06-24T10:08:20.751-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
]
Returns an array of all posts for the given site.
- include (optional) — Array of entities to include (
user
,site
,parent
,assets
)
[
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.754-04:00",
"updated_at": "2015-06-24T10:08:20.754-04:00",
"published_at": "2015-06-24T10:08:20.754-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
]
Returns an array of all assets for the given site.
[
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.841-04:00",
"updated_at": "2015-06-24T10:08:20.841-04:00",
"meta": [
]
}
]
Creates an asset on the given site.
- file (optional) — Asset file
- url (optional) — Asset remote URL
- meta (optional) — Array of Asset metadata
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}
Returns an array of users for the given site.
[
{
"id": "51af47a8ef75ac5e8c000001",
"email": "[email protected]",
"firstname": "Barack",
"lastname": "Obama",
"fullname": "Barack Obama",
"created_at": "2015-06-24T10:08:20.746-04:00",
"updated_at": "2015-06-24T10:08:20.746-04:00"
}
]
Returns an array of Pages created by the authenticated user.
- include (optional) — Array of entities to include (
user
,site
,parent
,pages
,posts
,assets
)
[
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.751-04:00",
"updated_at": "2015-06-24T10:08:20.751-04:00",
"published_at": "2015-06-24T10:08:20.751-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
]
Returns the given page.
- include (optional) — Array of entities to include (
user
,site
,parent
,pages
,posts
,assets
)
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.749-04:00",
"updated_at": "2015-06-24T10:08:20.749-04:00",
"published_at": "2015-06-24T10:08:20.749-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
Updates the given page.
- title (optional) — Page title
- body (optional) — Page body
- custom_slug (optional) — Page slug
- published_at (optional) — Page published date
- visibility (optional) — Page visibility (
draft
,hidden
,visible
) - user_id (optional) — Page author ID
- parent_id (optional) — Page parent ID
- meta (optional) — Array of Page Metadata (see Metadata)
- position (optional) — Position of page
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.749-04:00",
"updated_at": "2015-06-24T10:08:20.749-04:00",
"published_at": "2015-06-24T10:08:20.749-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
Deletes the given page.
Returns an array of posts on the given page.
- offset (optional) — Number of Posts to offset
- count (optional) — Number of Posts to return
- include (optional) — Array of entities to include (
user
,site
,parent
,assets
)
[
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.754-04:00",
"updated_at": "2015-06-24T10:08:20.754-04:00",
"published_at": "2015-06-24T10:08:20.754-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
]
Creates a post on the given page.
- title — Post title
- body (optional) — Post body
- custom_slug (optional) — Post custom slug
- published_at (optional) — Post published date
- visibility (optional) — Post visibility
- user_id (optional) — Post author ID
- meta (optional) — Array of Taxonomy
- taxonomy (optional) — Array of Metadata
- asset_ids (optional) — Array of Asset IDs
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.752-04:00",
"updated_at": "2015-06-24T10:08:20.752-04:00",
"published_at": "2015-06-24T10:08:20.753-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
Returns an array of assets on the given page.
[
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.841-04:00",
"updated_at": "2015-06-24T10:08:20.841-04:00",
"meta": [
]
}
]
Creates an asset on the given page.
- file (optional) — Asset file
- url (optional) — Asset remote URL
- meta (optional) — Array of Asset metadata
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}
Repositions assets on the given page.
- ids — Array of Asset IDs
[
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.841-04:00",
"updated_at": "2015-06-24T10:08:20.841-04:00",
"meta": [
]
}
]
Creates metadata on the given page.
- key — Metadata key
- value — Metadata value
{
"id": "51a39a57ef75ac7634000011",
"key": "color",
"value": "blue"
}
Returns an array of posts created by the authenticated user.
- include (optional) — Array of entities to include (
user
,site
,parent
,assets
)
[
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.754-04:00",
"updated_at": "2015-06-24T10:08:20.754-04:00",
"published_at": "2015-06-24T10:08:20.754-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
]
Returns the given post.
- include (optional) — Array of entities to include (
user
,site
,parent
,assets
)
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.752-04:00",
"updated_at": "2015-06-24T10:08:20.752-04:00",
"published_at": "2015-06-24T10:08:20.753-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
Updates the given post.
- title (optional) — Post title
- body (optional) — Post body
- custom_slug (optional) — Post custom slug
- published_at (optional) — Post published date
- visibility (optional) — Post visibility (
draft
,hidden
,visible
) - parent_id (optional) — Post parent ID
- user_id (optional) — Post author ID
- meta (optional) — Array of Metadata
- taxonomy (optional) — Array of Taxonomy
{
"id": "51a39a57ef75ac7634000006",
"title": "My Content",
"slug": "my-content",
"url": "/pages/my-content",
"body": "This is *my* content",
"visibility": "draft",
"created_at": "2015-06-24T10:08:20.752-04:00",
"updated_at": "2015-06-24T10:08:20.752-04:00",
"published_at": "2015-06-24T10:08:20.753-04:00",
"user_id": "51af47a8ef75ac5e8c000001",
"site_id": "51af47c1ef75acd940000002",
"parent_id": "51a39a57ef75ac7634000005",
"meta": [
]
}
Deletes the given post.
Creates taxonomy on the given post.
- key — Taxonomy key
- values — Array of values
{
"id": "51a39a57ef75ac7634000007",
"key": "Tags",
"slug": "tags",
"values": [
{
"value": "Announcement",
"slug": "announcement",
"url": "/blog/tags/announcement"
}
]
}
Returns an array of assets on the given post.
[
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.841-04:00",
"updated_at": "2015-06-24T10:08:20.841-04:00",
"meta": [
]
}
]
Creates an asset on the given post.
- file (optional) — Asset file
- url (optional) — Asset remote URL
- meta (optional) — Array of Asset metadata
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}
Repositions assets on the given post.
- ids — Array of Asset IDs
[
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.841-04:00",
"updated_at": "2015-06-24T10:08:20.841-04:00",
"meta": [
]
}
]
Returns the given taxonomy.
{
"id": "51a39a57ef75ac7634000007",
"key": "Tags",
"slug": "tags",
"values": [
{
"value": "Announcement",
"slug": "announcement",
"url": "/blog/tags/announcement"
}
]
}
Updates the given taxonomy.
- key (optional) — Taxonomy key
- values (optional) — Array of values
{
"id": "51a39a57ef75ac7634000007",
"key": "Tags",
"slug": "tags",
"values": [
{
"value": "Announcement",
"slug": "announcement",
"url": "/blog/tags/announcement"
}
]
}
Deletes the given taxonomy.
Returns the given asset.
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}
Updates the given asset.
- filename (optional) — Asset filename
- meta (optional) — Array of Metadata
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}
Deletes the given asset.
Restores the given deleted asset.
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}
Returns an array of all theme assets for the given site.
[
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.841-04:00",
"updated_at": "2015-06-24T10:08:20.841-04:00",
"meta": [
]
}
]
Creates a theme asset on the given site.
- file — Theme asset file
- filename (optional) — Theme asset filename
- replace (optional) — Should file replace theme?
{
"id": "51a39a57ef75ac7634000009",
"filename": "my-file.gif",
"url": "/assets/my-file.gif",
"permalink": "http://mysite.com/assets/my-file.gif",
"file": {
"url": null,
"thumbnail": {
"url": null
}
},
"content_type": "image/gif",
"filesize": 23856,
"checksum": "9187a6775bdce8f1f2143accea89ba6c",
"created_at": "2015-06-24T10:08:20.756-04:00",
"updated_at": "2015-06-24T10:08:20.756-04:00",
"meta": [
]
}