Cosmic JS REST API Learn how to make requests to the Cosmic JS REST API to add, edit and remove content.

REST API

Connect to your Cosmic JS Bucket through RESTful requests to the Cosmic JS API.

Optional Parameters

All JSON responses can be formatted to be pretty for easy reading by adding the pretty=true query parameter to the request URL. There are optional parameters available for pagination where indicated (limit and skip). There is also a sort order parameter sort. And if you've added a read access key to your Bucket, you will need to add the read_key query parameter to your request. For POST, PUT and DELETE methods, if you set a write access key to your Bucket you will need to include the write_key to your Body request.

Metafields and Metadata

Metafields extend your Object data. From the API response, the Metafields parameter provides you with additional form field values including title, key and type and is provided in an array format. The Metadata parameter returns a key / value response and is the recommended way to get Metafield values from your Object. To hide Metafields, add the parameter hide_metafields=true to the endpoint URL. All of the following example responses below show results from having hide_metafields=true. Hidden Metafields will be the default behavior in a future API release.

API Base URL

All API requests begin from the host URL:

https://api.cosmicjs.com

Available Endpoints

POST /v1/authenticate

POST /v1/buckets

GET /v1/:bucket-slug

GET /v1/:bucket-slug/objects

GET /v1/:bucket-slug/object-types

GET /v1/:bucket-slug/object-type/:type-slug

GET /v1/:bucket-slug/object-type/:type-slug/search

GET /v1/:bucket-slug/objects-by-slug

GET /v1/:bucket-slug/object/:object-slug

GET /v1/:bucket-slug/object-by-id/:object-id

GET /v1/:bucket-slug/media

POST /v1/:bucket-slug/add-object

POST /v1/:bucket-slug/object-types

POST /v1/:bucket-slug/media

PUT /v1/:bucket-slug/edit-object/:object-slug

PUT /v1/:bucket-slug/edit-object/:object-type-slug

DELETE /v1/:bucket-slug/objects/:object-slug

DELETE /v1/:bucket-slug/object-types/:object-type-slug

DELETE /v1/:bucket-slug/media/:media_id

POST /v1/authenticate

Send your email and password to receive your access token. Your access token will be used to add Buckets to your account as well as other account-related access. You do not need to use the token to edit your Bucket. Your Bucket has its own read and write keys for restricted access.

Example

POST https://api.cosmicjs.com/v1/authenticate
Body
{
  "email": "john@johndoe.com",
  "password": "CatsAreAwesome"
}
Body
{
  "success": true,
  "message": "Token created successfully.",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImpvaG5Aam9obmRvZS5jb20iLCJwYXNzd29yZCI6IkNhdHNBcmVBd2Vzb21lIn0.7lKqRLP6NkXSkDZ3dsfbp1V1S79nBsTr6IQ0ipSxKJA"
}

POST /v1/buckets

Use your access token in the request header (Authorization: Bearer <token>) to add new Buckets to your account. title is the only required field but you can also specify the slug as well as read_key and write_key.

Example

POST https://api.cosmicjs.com/v1/buckets
// Header
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImpvaG5Aam9obmRvZS5jb20iLCJwYXNzd29yZCI6IkNhdHNBcmVBd2Vzb21lIn0.7lKqRLP6NkXSkDZ3dsfbp1V1S79nBsTr6IQ0ipSxKJA"

// Body
{
  "title": "My API-First Blog",
  "slug": "my-api-first-blog",
  "read_key": "my-read-key",
  "write_key": "my-write-key"
}
Body
{
  "bucket": {
    "title": "My API-First Blog",
    "slug": "my-api-first-blog",
    "user_id": "56d66b2f903a79b904000001",
    "created_at": "2017-05-29T22:44:29.633Z",
    "modified_at": "2017-05-29T22:44:29.633Z",
    "modified_by": "56d66b2f903a79b904000001",
    "api_access": {
      "read_key": "my-read-key",
      "write_key": "my-write-key"
    },
    "_id": "592ca44d28740f3379000001"
  }
}

GET /v1/:bucket-slug

Returns all of your Bucket's content: Bucket properties, Objects and Media.

Example

GET https://api.cosmicjs.com/v1/wedding-site
Body
{
  "bucket": {
    "_id": "55b3d557df0fb1df7600004b",
    "slug": "wedding-site",
    "title": "Wedding Site",
    "object_types": [
      {
        "title": "Groomsmen",
        "slug": "groomsmen",
        "singular": "Groomsman",
        "metafields": [
          {
            "value": "",
            "key": "image",
            "title": "Image",
            "type": "file",
            "children": false
          },
          {
            "value": "",
            "key": "official-title",
            "title": "Official Title",
            "type": "text",
            "children": false
          }
        ]
      },
      {
        "title": "Bridesmaids",
        "slug": "bridesmaids",
        "singular": "Bridesmaid",
        "metafields": [
          {
            "value": "",
            "key": "",
            "title": "Image",
            "type": "file",
            "children": false
          },
          {
            "value": "",
            "key": "",
            "title": "Official Title",
            "type": "text",
            "children": false
          }
        ]
      },
      {
        "title": "Sections",
        "slug": "sections",
        "singular": "Section",
        "metafields": []
      }
    ],
    "links": [
      {
        "title": "GitHub Repo",
        "link": "https://github.com/cosmicjs/cosmicapp-wedding-site"
      },
      {
        "title": "Preview",
        "link": "http://wedding-site.cosmicapp.co/"
      }
    ],
    "objects": [
      {
        "_id": "55b3da7740d7a3791b000002",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "main-menu",
        "title": "Main Menu",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.809Z",
        "metadata": {
          "our-story": "Our Story",
          "accomodations": "Accomodations",
          "registry": "Registry"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000003",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "global",
        "title": "Global",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.812Z",
        "metadata": {
          "site-title": "Carol and Jack Wedding Website",
          "menu-title": "Carol & Jack",
          "description": "This is the wedding website for the Jack and Carol Wedding on November 22, 2014 in Dallas, TX.",
          "author": "Tony Spiro",
          "footer-text": "Cosmic JS &copy; 2015"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000004",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "lacey-sternhart",
        "title": "Lacey Sternhart",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.813Z",
        "modified": "2015-07-25T18:56:20.019Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg"
          },
          "official-title": "Matron of Honor"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000005",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "elizabeth-desandro",
        "title": "Elizabeth Desandro",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.816Z",
        "modified": "2015-07-25T18:57:08.443Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg"
          },
          "official-title": "Bridesmaid"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000006",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "sandra-spurlock",
        "title": "Sandra Spurlock",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.817Z",
        "modified": "2015-07-25T18:57:58.809Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg"
          },
          "official-title": "Maid of Honor"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000007",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "rachel-sanders",
        "title": "Rachel Sanders",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.818Z",
        "modified": "2015-07-25T18:58:57.146Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg"
          },
          "official-title": "Bridesmaid"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000008",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "britney-mcgee",
        "title": "Britney McGee",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.819Z",
        "modified": "2015-07-25T19:00:34.572Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg"
          },
          "official-title": "Bridesmaid"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000009",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "chad-henly",
        "title": "Chad Henly",
        "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.820Z",
        "modified": "2015-07-25T18:51:44.249Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg"
          },
          "official-title": "Best Man"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000a",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "eric-harland",
        "title": "Eric Harland",
        "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.821Z",
        "modified": "2015-07-25T18:52:35.032Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000b",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "site-top",
        "title": "Site Top",
        "content": "<p>This is our wedding website</p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.822Z",
        "modified": "2015-09-19T15:53:11.859Z",
        "metadata": {
          "icon": "heart",
          "date": "3.22.16",
          "hero": {
            "url": "http://localhost:3000/uploads/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg"
          }
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000c",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "lance-bergstrom",
        "title": "Lance Bergstrom",
        "content": "<p><br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.823Z",
        "modified": "2015-07-25T18:53:26.148Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000d",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "our-story",
        "title": "Our Story",
        "content": "<div><br></div><div><br></div><div><img class=\"\" data-type=\"image/jpeg\" data-title=\"download.jpeg\" src=\"https://cosmicjs.com/uploads/06f48200-06db-11e5-9c02-cbf541cfdd2f-engaged%20couples.jpg\" style=\"line-height: 1.42857143; float: left;\"></div><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span style=\"font-style: italic;\">\"When I saw you I fell in love, and you smiled because you knew.\" - William Shakespeare</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>The story of Carol and Jack began in their college town of Denton, Texas in late November 2007. Carol was studying journalism and Jack had recently graduated with a degree in music. They met in downtown Denton and the next day Jack asked Carol on their first date.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>When Jack picked Carol up for their movie date, he noticed they were both reading the same book: On the Road by Jack Kerouac. Their first few years of dating were filled with much traveling. Carol took a reporting job in East Texas and Jack joined a touring country band. Between their busy schedules and personal journeys, they always found each other at the end of the day. This went on for some time.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>Flash forward to the winter of 2012 when Carol took a reporting job in upstate New York. Jack could tell that the record-setting harsh winter of that year was too cold for the native Texas girl. He booked a flight to Albany, NY to visit her and surprised her with a ski trip in Vermont as a Valentine's gift.</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>A year later, Carol was back in Dallas and Jack had another surprise for her on Valentine's Day. That morning before sunrise after getting ready to help Carol's parents deliver Valentine's flowers from their shop, Jack asked Carol to marry him. Together their journey continues ...</span></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.824Z",
        "metadata": null
      },
      {
        "_id": "55b3da7740d7a3791b00000e",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "chris-pepperbrook",
        "title": "Chris Pepperbrook",
        "content": "<p><br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.824Z",
        "modified": "2015-07-25T18:54:27.054Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000f",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "our-big-day",
        "title": "Our Big Day",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.825Z",
        "metadata": {
          "grooms-party-title": "The <br>Groom's <br>Party",
          "brides-party-title": "The <br>Bride's <br>Party",
          "accommodations-title": "Accommodations",
          "venue-title": "The Venue",
          "hotel-image": {
            "url": "http://localhost:3000/uploads/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg",
            "imgix_url": "https://cosmicjs.imgix.net/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg"
          },
          "accomodations": "<p>We have a room block at the historic&nbsp;<a href=\"http://warwickhotels.com/dallas/\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Warwick Melrose Hotel&nbsp;</a>in Dallas. A preferred rate is available Thursday, Nov. 20, Friday, Nov. 21 and Saturday, Nov. 22. The rate is $129 per night with room options of a king size bed or two double beds. To receive this rate call 214-521-5151 or 1-800-521-7172 before November 6 and identify the group as Carol-Jack room block.</p>",
          "venue-image": {
            "url": "http://localhost:3000/uploads/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg",
            "imgix_url": "https://cosmicjs.imgix.net/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg"
          },
          "the-venue": "<p>Carol and Jack will marry in the garden of <a href=\"http://www.themaplemanorhotel.com/Home.php\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor </a>in Dallas at 4:30 p.m. Saturday, November 22, 2014. Follow the link below for more information about the ceremony location.&nbsp;</p><p><a href=\"https://www.google.com/maps/preview?ie=UTF-8&amp;fb=1&amp;gl=us&amp;q=Maple+Manor&amp;cid=6335981833807757145&amp;ei=iJ2bU6WVOYnn8AGO_YCoDA&amp;ved=0CKABEPwSMAo\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor, Dallas, TX</a><span style=\"text-decoration: underline;\"><br></span><span style=\"line-height: 1.428571429;\"></span></p><p><span style=\"line-height: 1.428571429;\">The wedding reception will be held next door at&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">2620 Maple Avenue&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">Dallas, TX 75201.</span></p>"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000010",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "charles-stewart",
        "title": "Charles Stewart",
        "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.851Z",
        "modified": "2015-07-25T18:55:18.984Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000011",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "registry",
        "title": "Registry",
        "content": "<p>Carol and Jack are registered at Pottery Barn, Macy's and Crate and Barrel.</p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.851Z",
        "metadata": {
          "pottery-barn": "http://www.potterybarn.com",
          "macys": "http://www.macys.com",
          "crate-and-barrel": "http://www.crateandbarrel.com/"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000012",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "map",
        "title": "Map",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.853Z",
        "metadata": {
          "venue-address": "Maple Manor 2616 Maple Avenue Dallas, TX 75201"
        }
      }
    ],
    "media": [
      {
        "_id": "55b3da7840d7a3791b000013",
        "name": "069afa10-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive.jpg",
        "size": 81617,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.082Z",
        "folder": null,
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069afa10-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069afa10-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b000014",
        "name": "069b2120-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "amy.jpg",
        "size": 21843,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.225Z",
        "folder": "bridesmaids",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b2120-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b2120-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b000015",
        "name": "069b2121-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "ash.jpg",
        "size": 21236,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.248Z",
        "folder": "bridesmaids",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b2121-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b2121-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b000016",
        "name": "069b4830-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "emily.jpg",
        "size": 24550,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.299Z",
        "folder": "bridesmaids",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b4830-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b4830-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b000017",
        "name": "069b4831-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "mandy.jpg",
        "size": 21558,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.394Z",
        "folder": "bridesmaids",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b4831-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b4831-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b000019",
        "name": "069b4832-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "jill.jpg",
        "size": 24448,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.465Z",
        "folder": "bridesmaids",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b4832-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b4832-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b00001a",
        "name": "069b6f40-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor.jpg",
        "size": 61416,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.551Z",
        "folder": null,
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b6f40-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b6f40-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b00001b",
        "name": "069b6f41-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "colin.jpg",
        "size": 22297,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.634Z",
        "folder": "groomsmen",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b6f41-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b6f41-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b00001c",
        "name": "069b6f42-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "rocky.jpg",
        "size": 19186,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:39.798Z",
        "folder": "groomsmen",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b6f42-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b6f42-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7840d7a3791b00001d",
        "name": "069b6f43-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "selden.jpg",
        "size": 26217,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:40.655Z",
        "folder": "groomsmen",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b6f43-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b6f43-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7940d7a3791b00001e",
        "name": "069b6f44-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "dave.jpg",
        "size": 21110,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:40.814Z",
        "folder": "groomsmen",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b6f44-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b6f44-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7940d7a3791b00001f",
        "name": "069b9650-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "mke.jpg",
        "size": 30353,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-02T01:40:40.903Z",
        "folder": "groomsmen",
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b9650-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b9650-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7940d7a3791b000020",
        "name": "069b9652-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "engaged couples.jpg",
        "size": 219619,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-05-30T14:49:09.528Z",
        "folder": null,
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b9652-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b9652-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "55b3da7940d7a3791b000021",
        "name": "069b9651-32fe-11e5-9f75-cb9b4016a019.jpg",
        "original_name": "iStock_000010563305Medium.jpg",
        "size": 481005,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-01-04T04:41:47.169Z",
        "folder": null,
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/069b9651-32fe-11e5-9f75-cb9b4016a019.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/069b9651-32fe-11e5-9f75-cb9b4016a019.jpg"
      },
      {
        "_id": "561b22cac070af3512000024",
        "name": "af9279a0-708d-11e5-9c06-3fa77abead52-wedding.jpg",
        "original_name": "wedding.jpg",
        "size": 19429,
        "type": "image/jpeg",
        "bucket": "55b3d557df0fb1df7600004b",
        "created": "2015-10-12T03:02:34.299Z",
        "folder": null,
        "location": "https://cosmicjs.com/uploads",
        "url": "https://cosmicjs.com/uploads/af9279a0-708d-11e5-9c06-3fa77abead52-wedding.jpg",
        "imgix_url": "https://cosmicjs.imgix.net/af9279a0-708d-11e5-9c06-3fa77abead52-wedding.jpg"
      }
    ],
    "media_folders": [
      {
        "title": "Groomsmen",
        "slug": "groomsmen",
        "order": 1
      },
      {
        "title": "Bridesmaids",
        "slug": "bridesmaids",
        "order": 2
      }
    ]
  }
}
GET /v1/:bucket-slug/objects

Returns an array of all of your Bucket's Objects.

Optional Query Parameters

limit=number
skip=number
sort=created_at,-created_at,modified_at,-modified_at,random
GET https://api.cosmicjs.com/v1/wedding-site/objects
Body
{
  "objects": [
    {
      "_id": "55b3da7740d7a3791b000002",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "main-menu",
      "title": "Main Menu",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.809Z",
      "metadata": {
        "our-story": "Our Story",
        "accomodations": "Accomodations",
        "registry": "Registry"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000003",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "global",
      "title": "Global",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.812Z",
      "metadata": {
        "site-title": "Carol and Jack Wedding Website",
        "menu-title": "Carol & Jack",
        "description": "This is the wedding website for the Jack and Carol Wedding on November 22, 2014 in Dallas, TX.",
        "author": "Tony Spiro",
        "footer-text": "Cosmic JS &copy; 2015"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000004",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "lacey-sternhart",
      "title": "Lacey Sternhart",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.813Z",
      "modified": "2015-07-25T18:56:20.019Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg"
        },
        "official-title": "Matron of Honor"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000005",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "elizabeth-desandro",
      "title": "Elizabeth Desandro",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.816Z",
      "modified": "2015-07-25T18:57:08.443Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg"
        },
        "official-title": "Bridesmaid"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000006",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "sandra-spurlock",
      "title": "Sandra Spurlock",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.817Z",
      "modified": "2015-07-25T18:57:58.809Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg"
        },
        "official-title": "Maid of Honor"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000007",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "rachel-sanders",
      "title": "Rachel Sanders",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.818Z",
      "modified": "2015-07-25T18:58:57.146Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg"
        },
        "official-title": "Bridesmaid"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000008",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "britney-mcgee",
      "title": "Britney McGee",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.819Z",
      "modified": "2015-07-25T19:00:34.572Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg"
        },
        "official-title": "Bridesmaid"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000009",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chad-henly",
      "title": "Chad Henly",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.820Z",
      "modified": "2015-07-25T18:51:44.249Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg"
        },
        "official-title": "Best Man"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000a",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "eric-harland",
      "title": "Eric Harland",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.821Z",
      "modified": "2015-07-25T18:52:35.032Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000b",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "site-top",
      "title": "Site Top",
      "content": "<p>This is our wedding website</p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.822Z",
      "modified": "2015-09-19T15:53:11.859Z",
      "metadata": {
        "icon": "heart",
        "date": "3.22.16",
        "hero": {
          "url": "http://localhost:3000/uploads/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg"
        }
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000c",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "lance-bergstrom",
      "title": "Lance Bergstrom",
      "content": "<p><br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.823Z",
      "modified": "2015-07-25T18:53:26.148Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000d",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "our-story",
      "title": "Our Story",
      "content": "<div><br></div><div><br></div><div><img class=\"\" data-type=\"image/jpeg\" data-title=\"download.jpeg\" src=\"https://cosmicjs.com/uploads/06f48200-06db-11e5-9c02-cbf541cfdd2f-engaged%20couples.jpg\" style=\"line-height: 1.42857143; float: left;\"></div><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span style=\"font-style: italic;\">\"When I saw you I fell in love, and you smiled because you knew.\" - William Shakespeare</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>The story of Carol and Jack began in their college town of Denton, Texas in late November 2007. Carol was studying journalism and Jack had recently graduated with a degree in music. They met in downtown Denton and the next day Jack asked Carol on their first date.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>When Jack picked Carol up for their movie date, he noticed they were both reading the same book: On the Road by Jack Kerouac. Their first few years of dating were filled with much traveling. Carol took a reporting job in East Texas and Jack joined a touring country band. Between their busy schedules and personal journeys, they always found each other at the end of the day. This went on for some time.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>Flash forward to the winter of 2012 when Carol took a reporting job in upstate New York. Jack could tell that the record-setting harsh winter of that year was too cold for the native Texas girl. He booked a flight to Albany, NY to visit her and surprised her with a ski trip in Vermont as a Valentine's gift.</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>A year later, Carol was back in Dallas and Jack had another surprise for her on Valentine's Day. That morning before sunrise after getting ready to help Carol's parents deliver Valentine's flowers from their shop, Jack asked Carol to marry him. Together their journey continues ...</span></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.824Z",
      "metadata": null
    },
    {
      "_id": "55b3da7740d7a3791b00000e",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chris-pepperbrook",
      "title": "Chris Pepperbrook",
      "content": "<p><br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.824Z",
      "modified": "2015-07-25T18:54:27.054Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000f",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "our-big-day",
      "title": "Our Big Day",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.825Z",
      "metadata": {
        "grooms-party-title": "The <br>Groom's <br>Party",
        "brides-party-title": "The <br>Bride's <br>Party",
        "accommodations-title": "Accommodations",
        "venue-title": "The Venue",
        "hotel-image": {
          "url": "http://localhost:3000/uploads/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg",
          "imgix_url": "https://cosmicjs.imgix.net/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg"
        },
        "accomodations": "<p>We have a room block at the historic&nbsp;<a href=\"http://warwickhotels.com/dallas/\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Warwick Melrose Hotel&nbsp;</a>in Dallas. A preferred rate is available Thursday, Nov. 20, Friday, Nov. 21 and Saturday, Nov. 22. The rate is $129 per night with room options of a king size bed or two double beds. To receive this rate call 214-521-5151 or 1-800-521-7172 before November 6 and identify the group as Carol-Jack room block.</p>",
        "venue-image": {
          "url": "http://localhost:3000/uploads/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg",
          "imgix_url": "https://cosmicjs.imgix.net/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg"
        },
        "the-venue": "<p>Carol and Jack will marry in the garden of <a href=\"http://www.themaplemanorhotel.com/Home.php\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor </a>in Dallas at 4:30 p.m. Saturday, November 22, 2014. Follow the link below for more information about the ceremony location.&nbsp;</p><p><a href=\"https://www.google.com/maps/preview?ie=UTF-8&amp;fb=1&amp;gl=us&amp;q=Maple+Manor&amp;cid=6335981833807757145&amp;ei=iJ2bU6WVOYnn8AGO_YCoDA&amp;ved=0CKABEPwSMAo\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor, Dallas, TX</a><span style=\"text-decoration: underline;\"><br></span><span style=\"line-height: 1.428571429;\"></span></p><p><span style=\"line-height: 1.428571429;\">The wedding reception will be held next door at&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">2620 Maple Avenue&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">Dallas, TX 75201.</span></p>"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000010",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "charles-stewart",
      "title": "Charles Stewart",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.851Z",
      "modified": "2015-07-25T18:55:18.984Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000011",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "registry",
      "title": "Registry",
      "content": "<p>Carol and Jack are registered at Pottery Barn, Macy's and Crate and Barrel.</p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.851Z",
      "metadata": {
        "pottery-barn": "http://www.potterybarn.com",
        "macys": "http://www.macys.com",
        "crate-and-barrel": "http://www.crateandbarrel.com/"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000012",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "map",
      "title": "Map",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.853Z",
      "metadata": {
        "venue-address": "Maple Manor 2616 Maple Avenue Dallas, TX 75201"
      }
    }
  ]
}

GET /v1/:bucket-slug/object-types

Returns all of your Bucket's Object Types key-valued by slug.

GET https://api.cosmicjs.com/v1/wedding-site/object-types
Body
{
  "object_types": {
    "sections": [
      {
        "_id": "55b3da7740d7a3791b000002",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "main-menu",
        "title": "Main Menu",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.809Z",
        "metadata": {
          "our-story": "Our Story",
          "accomodations": "Accomodations",
          "registry": "Registry"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000003",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "global",
        "title": "Global",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.812Z",
        "metadata": {
          "site-title": "Carol and Jack Wedding Website",
          "menu-title": "Carol & Jack",
          "description": "This is the wedding website for the Jack and Carol Wedding on November 22, 2014 in Dallas, TX.",
          "author": "Tony Spiro",
          "footer-text": "Cosmic JS &copy; 2015"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000b",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "site-top",
        "title": "Site Top",
        "content": "<p>This is our wedding website</p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.822Z",
        "modified": "2015-09-19T15:53:11.859Z",
        "metadata": {
          "icon": "heart",
          "date": "3.22.16",
          "hero": {
            "url": "http://localhost:3000/uploads/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg"
          }
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000d",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "our-story",
        "title": "Our Story",
        "content": "<div><br></div><div><br></div><div><img class=\"\" data-type=\"image/jpeg\" data-title=\"download.jpeg\" src=\"https://cosmicjs.com/uploads/06f48200-06db-11e5-9c02-cbf541cfdd2f-engaged%20couples.jpg\" style=\"line-height: 1.42857143; float: left;\"></div><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span style=\"font-style: italic;\">\"When I saw you I fell in love, and you smiled because you knew.\" - William Shakespeare</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>The story of Carol and Jack began in their college town of Denton, Texas in late November 2007. Carol was studying journalism and Jack had recently graduated with a degree in music. They met in downtown Denton and the next day Jack asked Carol on their first date.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>When Jack picked Carol up for their movie date, he noticed they were both reading the same book: On the Road by Jack Kerouac. Their first few years of dating were filled with much traveling. Carol took a reporting job in East Texas and Jack joined a touring country band. Between their busy schedules and personal journeys, they always found each other at the end of the day. This went on for some time.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>Flash forward to the winter of 2012 when Carol took a reporting job in upstate New York. Jack could tell that the record-setting harsh winter of that year was too cold for the native Texas girl. He booked a flight to Albany, NY to visit her and surprised her with a ski trip in Vermont as a Valentine's gift.</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>A year later, Carol was back in Dallas and Jack had another surprise for her on Valentine's Day. That morning before sunrise after getting ready to help Carol's parents deliver Valentine's flowers from their shop, Jack asked Carol to marry him. Together their journey continues ...</span></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.824Z",
        "metadata": null
      },
      {
        "_id": "55b3da7740d7a3791b00000f",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "our-big-day",
        "title": "Our Big Day",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.825Z",
        "metadata": {
          "grooms-party-title": "The <br>Groom's <br>Party",
          "brides-party-title": "The <br>Bride's <br>Party",
          "accommodations-title": "Accommodations",
          "venue-title": "The Venue",
          "hotel-image": {
            "url": "http://localhost:3000/uploads/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg",
            "imgix_url": "https://cosmicjs.imgix.net/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg"
          },
          "accomodations": "<p>We have a room block at the historic&nbsp;<a href=\"http://warwickhotels.com/dallas/\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Warwick Melrose Hotel&nbsp;</a>in Dallas. A preferred rate is available Thursday, Nov. 20, Friday, Nov. 21 and Saturday, Nov. 22. The rate is $129 per night with room options of a king size bed or two double beds. To receive this rate call 214-521-5151 or 1-800-521-7172 before November 6 and identify the group as Carol-Jack room block.</p>",
          "venue-image": {
            "url": "http://localhost:3000/uploads/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg",
            "imgix_url": "https://cosmicjs.imgix.net/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg"
          },
          "the-venue": "<p>Carol and Jack will marry in the garden of <a href=\"http://www.themaplemanorhotel.com/Home.php\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor </a>in Dallas at 4:30 p.m. Saturday, November 22, 2014. Follow the link below for more information about the ceremony location.&nbsp;</p><p><a href=\"https://www.google.com/maps/preview?ie=UTF-8&amp;fb=1&amp;gl=us&amp;q=Maple+Manor&amp;cid=6335981833807757145&amp;ei=iJ2bU6WVOYnn8AGO_YCoDA&amp;ved=0CKABEPwSMAo\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor, Dallas, TX</a><span style=\"text-decoration: underline;\"><br></span><span style=\"line-height: 1.428571429;\"></span></p><p><span style=\"line-height: 1.428571429;\">The wedding reception will be held next door at&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">2620 Maple Avenue&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">Dallas, TX 75201.</span></p>"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000011",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "registry",
        "title": "Registry",
        "content": "<p>Carol and Jack are registered at Pottery Barn, Macy's and Crate and Barrel.</p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.851Z",
        "metadata": {
          "pottery-barn": "http://www.potterybarn.com",
          "macys": "http://www.macys.com",
          "crate-and-barrel": "http://www.crateandbarrel.com/"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000012",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "map",
        "title": "Map",
        "content": "<p><br></p>",
        "type_slug": "sections",
        "created": "2015-07-25T18:50:31.853Z",
        "metadata": {
          "venue-address": "Maple Manor 2616 Maple Avenue Dallas, TX 75201"
        }
      }
    ],
    "bridesmaids": [
      {
        "_id": "55b3da7740d7a3791b000004",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "lacey-sternhart",
        "title": "Lacey Sternhart",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.813Z",
        "modified": "2015-07-25T18:56:20.019Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg"
          },
          "official-title": "Matron of Honor"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000005",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "elizabeth-desandro",
        "title": "Elizabeth Desandro",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.816Z",
        "modified": "2015-07-25T18:57:08.443Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg"
          },
          "official-title": "Bridesmaid"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000006",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "sandra-spurlock",
        "title": "Sandra Spurlock",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.817Z",
        "modified": "2015-07-25T18:57:58.809Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg"
          },
          "official-title": "Maid of Honor"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000007",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "rachel-sanders",
        "title": "Rachel Sanders",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.818Z",
        "modified": "2015-07-25T18:58:57.146Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg"
          },
          "official-title": "Bridesmaid"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000008",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "britney-mcgee",
        "title": "Britney McGee",
        "content": "<p><br></p>",
        "type_slug": "bridesmaids",
        "created": "2015-07-25T18:50:31.819Z",
        "modified": "2015-07-25T19:00:34.572Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg"
          },
          "official-title": "Bridesmaid"
        }
      }
    ],
    "groomsmen": [
      {
        "_id": "55b3da7740d7a3791b000009",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "chad-henly",
        "title": "Chad Henly",
        "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.820Z",
        "modified": "2015-07-25T18:51:44.249Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg"
          },
          "official-title": "Best Man"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000a",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "eric-harland",
        "title": "Eric Harland",
        "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.821Z",
        "modified": "2015-07-25T18:52:35.032Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000c",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "lance-bergstrom",
        "title": "Lance Bergstrom",
        "content": "<p><br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.823Z",
        "modified": "2015-07-25T18:53:26.148Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b00000e",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "chris-pepperbrook",
        "title": "Chris Pepperbrook",
        "content": "<p><br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.824Z",
        "modified": "2015-07-25T18:54:27.054Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg"
          },
          "official-title": "Groomsman"
        }
      },
      {
        "_id": "55b3da7740d7a3791b000010",
        "bucket": "55b3d557df0fb1df7600004b",
        "slug": "charles-stewart",
        "title": "Charles Stewart",
        "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
        "type_slug": "groomsmen",
        "created": "2015-07-25T18:50:31.851Z",
        "modified": "2015-07-25T18:55:18.984Z",
        "metadata": {
          "image": {
            "url": "http://localhost:3000/uploads/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg",
            "imgix_url": "https://cosmicjs.imgix.net/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg"
          },
          "official-title": "Groomsman"
        }
      }
    ]
  }
}

GET /v1/:bucket-slug/object-type/:type-slug

Returns an array of the Objects in the provided Object Type.

Optional Query Parameters

limit=number
skip=number
sort=created_at,-created_at,modified_at,-modified_at,random
GET https://api.cosmicjs.com/v1/wedding-site/object-type/groomsmen
Body
{
  "objects": [
    {
      "_id": "55b3da7740d7a3791b000009",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chad-henly",
      "title": "Chad Henly",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.820Z",
      "modified": "2015-07-25T18:51:44.249Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg"
        },
        "official-title": "Best Man"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000a",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "eric-harland",
      "title": "Eric Harland",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.821Z",
      "modified": "2015-07-25T18:52:35.032Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000c",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "lance-bergstrom",
      "title": "Lance Bergstrom",
      "content": "<p><br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.823Z",
      "modified": "2015-07-25T18:53:26.148Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b00000e",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chris-pepperbrook",
      "title": "Chris Pepperbrook",
      "content": "<p><br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.824Z",
      "modified": "2015-07-25T18:54:27.054Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    {
      "_id": "55b3da7740d7a3791b000010",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "charles-stewart",
      "title": "Charles Stewart",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.851Z",
      "modified": "2015-07-25T18:55:18.984Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg"
        },
        "official-title": "Groomsman"
      }
    }
  ],
  "total": 5
}

GET /v1/:bucket-slug/object-type/:type-slug/search

Returns an array of the Objects in the provided Object Type and that satisfy the Metafield key and value combination.

Required Query Parameters

Explicit search for exact value

metafield_key=string
metafield_value=string

String search for value occurance in string

metafield_key=string
metafield_value_has=string

To search by an object Metafield like to search for products in a category, you can use metafield_object_slug instead of metafield_value.

metafield_key=string
metafield_object_slug=string

Optional Query Parameters

limit=number
skip=number
sort=created_at,-created_at,modified_at,-modified_at,random
GET https://api.cosmicjs.com/v1/wedding-site/object-type/groomsmen/search?metafield_key=official-title&metafield_value=Best%Man
Body
{
  "objects": [
    {
      "_id": "55b3da7740d7a3791b000009",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chad-henly",
      "title": "Chad Henly",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.820Z",
      "user_id": "55767c3ffbcf5cbb13000001",
      "order": 7,
      "modified": "2015-07-25T18:51:44.249Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg"
        },
        "official-title": "Best Man"
      }
    }
  ],
  "total": 1
}

GET /v1/:bucket-slug/objects-by-slug

Returns Objects key-valued by their slugs.

GET https://api.cosmicjs.com/v1/wedding-site/objects-by-slug
Body
{
  "objects": {
    "main-menu": {
      "_id": "55b3da7740d7a3791b000002",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "main-menu",
      "title": "Main Menu",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.809Z",
      "metadata": {
        "our-story": "Our Story",
        "accomodations": "Accomodations",
        "registry": "Registry"
      }
    },
    "global": {
      "_id": "55b3da7740d7a3791b000003",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "global",
      "title": "Global",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.812Z",
      "metadata": {
        "site-title": "Carol and Jack Wedding Website",
        "menu-title": "Carol & Jack",
        "description": "This is the wedding website for the Jack and Carol Wedding on November 22, 2014 in Dallas, TX.",
        "author": "Tony Spiro",
        "footer-text": "Cosmic JS &copy; 2015"
      }
    },
    "lacey-sternhart": {
      "_id": "55b3da7740d7a3791b000004",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "lacey-sternhart",
      "title": "Lacey Sternhart",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.813Z",
      "modified": "2015-07-25T18:56:20.019Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/0d5563bf-8819-4626-cecf-072831af4c78-1420162839231-ash.jpg"
        },
        "official-title": "Matron of Honor"
      }
    },
    "elizabeth-desandro": {
      "_id": "55b3da7740d7a3791b000005",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "elizabeth-desandro",
      "title": "Elizabeth Desandro",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.816Z",
      "modified": "2015-07-25T18:57:08.443Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/a0e20f56-6b62-13a7-99d8-3b6a972406bf-1420162839265-emily.jpg"
        },
        "official-title": "Bridesmaid"
      }
    },
    "sandra-spurlock": {
      "_id": "55b3da7740d7a3791b000006",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "sandra-spurlock",
      "title": "Sandra Spurlock",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.817Z",
      "modified": "2015-07-25T18:57:58.809Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/da07eb8f-5b4f-f4dd-8438-d6bc8ce3073a-1420162839435-jill.jpg"
        },
        "official-title": "Maid of Honor"
      }
    },
    "rachel-sanders": {
      "_id": "55b3da7740d7a3791b000007",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "rachel-sanders",
      "title": "Rachel Sanders",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.818Z",
      "modified": "2015-07-25T18:58:57.146Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/11f4b883-f92d-46a7-e63b-16eee6b65539-1420162839377-mandy.jpg"
        },
        "official-title": "Bridesmaid"
      }
    },
    "britney-mcgee": {
      "_id": "55b3da7740d7a3791b000008",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "britney-mcgee",
      "title": "Britney McGee",
      "content": "<p><br></p>",
      "type_slug": "bridesmaids",
      "created": "2015-07-25T18:50:31.819Z",
      "modified": "2015-07-25T19:00:34.572Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/fc59e607-a630-8b68-58be-152e526e77ed-1420162839190-amy.jpg"
        },
        "official-title": "Bridesmaid"
      }
    },
    "chad-henly": {
      "_id": "55b3da7740d7a3791b000009",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chad-henly",
      "title": "Chad Henly",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.820Z",
      "modified": "2015-07-25T18:51:44.249Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/3181a814-93d9-ad8f-74ce-1eeb64023b61-1420162840289-mke.jpg"
        },
        "official-title": "Best Man"
      }
    },
    "eric-harland": {
      "_id": "55b3da7740d7a3791b00000a",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "eric-harland",
      "title": "Eric Harland",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.821Z",
      "modified": "2015-07-25T18:52:35.032Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/a499fdab-10b5-5168-9ef1-8981c8e93da4-1420162840650-dave.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    "site-top": {
      "_id": "55b3da7740d7a3791b00000b",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "site-top",
      "title": "Site Top",
      "content": "<p>This is our wedding website</p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.822Z",
      "modified": "2015-09-19T15:53:11.859Z",
      "metadata": {
        "icon": "heart",
        "date": "3.22.16",
        "hero": {
          "url": "http://localhost:3000/uploads/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/b4fa8c50-b38e-4da4-3899-08772230db7d-1420346505497-iStock_000010563305Medium.jpg"
        }
      }
    },
    "lance-bergstrom": {
      "_id": "55b3da7740d7a3791b00000c",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "lance-bergstrom",
      "title": "Lance Bergstrom",
      "content": "<p><br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.823Z",
      "modified": "2015-07-25T18:53:26.148Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/4c6a5b21-e335-237f-2731-a455d361ddd1-1420162839613-colin.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    "our-story": {
      "_id": "55b3da7740d7a3791b00000d",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "our-story",
      "title": "Our Story",
      "content": "<div><br></div><div><br></div><div><img class=\"\" data-type=\"image/jpeg\" data-title=\"download.jpeg\" src=\"https://cosmicjs.com/uploads/06f48200-06db-11e5-9c02-cbf541cfdd2f-engaged%20couples.jpg\" style=\"line-height: 1.42857143; float: left;\"></div><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span style=\"font-style: italic;\">\"When I saw you I fell in love, and you smiled because you knew.\" - William Shakespeare</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>The story of Carol and Jack began in their college town of Denton, Texas in late November 2007. Carol was studying journalism and Jack had recently graduated with a degree in music. They met in downtown Denton and the next day Jack asked Carol on their first date.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>When Jack picked Carol up for their movie date, he noticed they were both reading the same book: On the Road by Jack Kerouac. Their first few years of dating were filled with much traveling. Carol took a reporting job in East Texas and Jack joined a touring country band. Between their busy schedules and personal journeys, they always found each other at the end of the day. This went on for some time.&nbsp;</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>Flash forward to the winter of 2012 when Carol took a reporting job in upstate New York. Jack could tell that the record-setting harsh winter of that year was too cold for the native Texas girl. He booked a flight to Albany, NY to visit her and surprised her with a ski trip in Vermont as a Valentine's gift.</span></p><p style=\"margin-bottom: 1.1em; padding: 0px; border: 0px;\"><span>A year later, Carol was back in Dallas and Jack had another surprise for her on Valentine's Day. That morning before sunrise after getting ready to help Carol's parents deliver Valentine's flowers from their shop, Jack asked Carol to marry him. Together their journey continues ...</span></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.824Z",
      "metadata": null
    },
    "chris-pepperbrook": {
      "_id": "55b3da7740d7a3791b00000e",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "chris-pepperbrook",
      "title": "Chris Pepperbrook",
      "content": "<p><br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.824Z",
      "modified": "2015-07-25T18:54:27.054Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/4de73b91-2c3a-009d-ead7-836b520b9cbd-1420346266945.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    "our-big-day": {
      "_id": "55b3da7740d7a3791b00000f",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "our-big-day",
      "title": "Our Big Day",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.825Z",
      "metadata": {
        "grooms-party-title": "The <br>Groom's <br>Party",
        "brides-party-title": "The <br>Bride's <br>Party",
        "accommodations-title": "Accommodations",
        "venue-title": "The Venue",
        "hotel-image": {
          "url": "http://localhost:3000/uploads/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg",
          "imgix_url": "https://cosmicjs.imgix.net/24569457-86e0-8b04-f138-6d00d359935d-1420162838686-54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive (1).jpg"
        },
        "accomodations": "<p>We have a room block at the historic&nbsp;<a href=\"http://warwickhotels.com/dallas/\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Warwick Melrose Hotel&nbsp;</a>in Dallas. A preferred rate is available Thursday, Nov. 20, Friday, Nov. 21 and Saturday, Nov. 22. The rate is $129 per night with room options of a king size bed or two double beds. To receive this rate call 214-521-5151 or 1-800-521-7172 before November 6 and identify the group as Carol-Jack room block.</p>",
        "venue-image": {
          "url": "http://localhost:3000/uploads/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg",
          "imgix_url": "https://cosmicjs.imgix.net/bfb5c8f6-fe89-ef1d-f66b-8e388f54d76d-1420162839102-60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor (1).jpg"
        },
        "the-venue": "<p>Carol and Jack will marry in the garden of <a href=\"http://www.themaplemanorhotel.com/Home.php\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor </a>in Dallas at 4:30 p.m. Saturday, November 22, 2014. Follow the link below for more information about the ceremony location.&nbsp;</p><p><a href=\"https://www.google.com/maps/preview?ie=UTF-8&amp;fb=1&amp;gl=us&amp;q=Maple+Manor&amp;cid=6335981833807757145&amp;ei=iJ2bU6WVOYnn8AGO_YCoDA&amp;ved=0CKABEPwSMAo\" target=\"_blank\" style=\"color: rgb(42, 100, 150); text-decoration: underline; outline: 0px;\">Maple Manor, Dallas, TX</a><span style=\"text-decoration: underline;\"><br></span><span style=\"line-height: 1.428571429;\"></span></p><p><span style=\"line-height: 1.428571429;\">The wedding reception will be held next door at&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">2620 Maple Avenue&nbsp;</span><span style=\"line-height: 18.5714302062988px;\">Dallas, TX 75201.</span></p>"
      }
    },
    "charles-stewart": {
      "_id": "55b3da7740d7a3791b000010",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "charles-stewart",
      "title": "Charles Stewart",
      "content": "<p>&nbsp;&nbsp;&nbsp;&nbsp;<br></p>",
      "type_slug": "groomsmen",
      "created": "2015-07-25T18:50:31.851Z",
      "modified": "2015-07-25T18:55:18.984Z",
      "metadata": {
        "image": {
          "url": "http://localhost:3000/uploads/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg",
          "imgix_url": "https://cosmicjs.imgix.net/46b70939-19ef-30f9-b66d-b26d0c408428-1420162839787-rocky.jpg"
        },
        "official-title": "Groomsman"
      }
    },
    "registry": {
      "_id": "55b3da7740d7a3791b000011",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "registry",
      "title": "Registry",
      "content": "<p>Carol and Jack are registered at Pottery Barn, Macy's and Crate and Barrel.</p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.851Z",
      "metadata": {
        "pottery-barn": "http://www.potterybarn.com",
        "macys": "http://www.macys.com",
        "crate-and-barrel": "http://www.crateandbarrel.com/"
      }
    },
    "map": {
      "_id": "55b3da7740d7a3791b000012",
      "bucket": "55b3d557df0fb1df7600004b",
      "slug": "map",
      "title": "Map",
      "content": "<p><br></p>",
      "type_slug": "sections",
      "created": "2015-07-25T18:50:31.853Z",
      "metadata": {
        "venue-address": "Maple Manor 2616 Maple Avenue Dallas, TX 75201"
      }
    }
  }
}

GET /v1/:bucket-slug/object/:object-slug

Returns the Object by its slug.

GET https://api.cosmicjs.com/v1/wedding-site/object/registry
Body
{
  "object": {
    "_id": "55b3da7740d7a3791b000011",
    "bucket": "55b3d557df0fb1df7600004b",
    "slug": "registry",
    "title": "Registry",
    "content": "<p>Carol and Jack are registered at Pottery Barn, Macy's and Crate and Barrel.</p>",
    "type_slug": "sections",
    "created": "2015-07-25T18:50:31.851Z",
    "metadata": {
      "pottery-barn": "http://www.potterybarn.com",
      "macys": "http://www.macys.com",
      "crate-and-barrel": "http://www.crateandbarrel.com/"
    }
  }
}

GET /v1/:bucket-slug/object-by-id/:object-id

Returns the Object by its id. This is the recommended way to get an Object that has a slug that may change.

GET https://api.cosmicjs.com/v1/wedding-site/object-by-id/55b3da7740d7a3791b000011
Body
{
  "object": {
    "_id": "55b3da7740d7a3791b000011",
    "bucket": "55b3d557df0fb1df7600004b",
    "slug": "registry",
    "title": "Registry",
    "content": "<p>Carol and Jack are registered at Pottery Barn, Macy's and Crate and Barrel.</p>",
    "type_slug": "sections",
    "created": "2015-07-25T18:50:31.851Z",
    "metadata": {
      "pottery-barn": "http://www.potterybarn.com",
      "macys": "http://www.macys.com",
      "crate-and-barrel": "http://www.crateandbarrel.com/"
    }
  }
}

GET /v1/:bucket-slug/media

Returns an array of Media files in the requested Bucket.

Optional Query Parameters

limit=number
skip=number
sort=created,-created,random
GET https://api.cosmicjs.com/v1/wedding-site/media
Body
{
  "media": [
    {
      "_id": "561b22cac070af3512000024",
      "name": "af9279a0-708d-11e5-9c06-3fa77abead52-wedding.jpg",
      "original_name": "wedding.jpg",
      "size": 19429,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-10-12T03:02:34.299Z",
      "folder": null,
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/af9279a0-708d-11e5-9c06-3fa77abead52-wedding.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/af9279a0-708d-11e5-9c06-3fa77abead52-wedding.jpg"
    },
    {
      "_id": "55b3da7940d7a3791b000020",
      "name": "069b9652-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "engaged couples.jpg",
      "size": 219619,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-05-30T14:49:09.528Z",
      "folder": null,
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b9652-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b9652-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7940d7a3791b000021",
      "name": "069b9651-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "iStock_000010563305Medium.jpg",
      "size": 481005,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-04T04:41:47.169Z",
      "folder": null,
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b9651-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b9651-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7940d7a3791b00001f",
      "name": "069b9650-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "mke.jpg",
      "size": 30353,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:40.903Z",
      "folder": "groomsmen",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b9650-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b9650-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7940d7a3791b00001e",
      "name": "069b6f44-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "dave.jpg",
      "size": 21110,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:40.814Z",
      "folder": "groomsmen",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b6f44-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b6f44-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b00001d",
      "name": "069b6f43-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "selden.jpg",
      "size": 26217,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:40.655Z",
      "folder": "groomsmen",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b6f43-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b6f43-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b00001c",
      "name": "069b6f42-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "rocky.jpg",
      "size": 19186,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.798Z",
      "folder": "groomsmen",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b6f42-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b6f42-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b00001b",
      "name": "069b6f41-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "colin.jpg",
      "size": 22297,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.634Z",
      "folder": "groomsmen",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b6f41-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b6f41-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b00001a",
      "name": "069b6f40-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "60b4bfa2-1382-d18e-ea91-512b32cb8509-1403666296390-MapleManor.jpg",
      "size": 61416,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.551Z",
      "folder": null,
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b6f40-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b6f40-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b000019",
      "name": "069b4832-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "jill.jpg",
      "size": 24448,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.465Z",
      "folder": "bridesmaids",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b4832-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b4832-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b000017",
      "name": "069b4831-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "mandy.jpg",
      "size": 21558,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.394Z",
      "folder": "bridesmaids",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b4831-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b4831-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b000016",
      "name": "069b4830-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "emily.jpg",
      "size": 24550,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.299Z",
      "folder": "bridesmaids",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b4830-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b4830-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b000015",
      "name": "069b2121-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "ash.jpg",
      "size": 21236,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.248Z",
      "folder": "bridesmaids",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b2121-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b2121-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b000014",
      "name": "069b2120-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "amy.jpg",
      "size": 21843,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.225Z",
      "folder": "bridesmaids",
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069b2120-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069b2120-32fe-11e5-9f75-cb9b4016a019.jpg"
    },
    {
      "_id": "55b3da7840d7a3791b000013",
      "name": "069afa10-32fe-11e5-9f75-cb9b4016a019.jpg",
      "original_name": "54a5ef3c-7da5-0800-075a-20bb3411d9f9-1408143965868-Compressed_front_drive.jpg",
      "size": 81617,
      "type": "image/jpeg",
      "bucket": "55b3d557df0fb1df7600004b",
      "created": "2015-01-02T01:40:39.082Z",
      "folder": null,
      "location": "https://cosmicjs.com/uploads",
      "url": "https://cosmicjs.com/uploads/069afa10-32fe-11e5-9f75-cb9b4016a019.jpg",
      "imgix_url": "https://cosmicjs.imgix.net/069afa10-32fe-11e5-9f75-cb9b4016a019.jpg"
    }
  ]
}

POST /v1/:bucket-slug/add-object

Add a new Object to your Bucket.

Required post values include type_slug and title. You can add Metafields (and children of metafields). If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

POST https://api.cosmicjs.com/v1/:bucket-slug/add-object
Body
{
  "title": "Cosmic JS Example",
  "type_slug": "examples",
  "content": "Learning the Cosmic JS API is really fun and so easy",
  "metafields": [
    {
      "key": "Headline",
      "type": "text",
      "value": "Learn Cosmic JS!"
    },
    {
      "key": "Author",
      "type": "text",
      "value": "Quasar Jones"
    }
  ]
}
Body
{
  "object": {
    "slug": "cosmic-js-example",
    "title": "Cosmic JS Example",
    "content": "Learning the Cosmic JS API is really fun and so easy",
    "metafields": [
      {
        "key": "headline",
        "type": "text",
        "value": "Learn Cosmic JS!",
        "title": "Headline"
      },
      {
        "key": "author",
        "type": "text",
        "value": "Quasar Jones",
        "title": "Author"
      }
    ],
    "bucket": "568c5bbefd0dce302c000001",
    "type_slug": "examples",
    "created": "2016-01-06T00:28:39.982Z",
    "_id": "568c5fb72f0c5d532d000001"
  }
}

POST /v1/:bucket-slug/add-object-type

Add a new Object Type to your Bucket.

title is the only required field. You can add Metafields which will be available as default Metafields for each new Object in this Object Type. If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

POST https://api.cosmicjs.com/v1/:bucket-slug/add-object-type
Body
{
  "title": "Pages",
  "singular": "Page",
  "slug": "pages",
  "metafields": [
    {
      "type": "text",
      "title": "Headline",
      "key": "headline",
      "required": true
    },
    {
      "type": "file",
      "title": "Hero",
      "key": "hero",
      "required": true
    }
  ]
}
Body
{
  "object_type": {
    "slug": "pages",
    "title": "Pages",
    "singular": "Page",
    "metafields": [
      {
        "type": "text",
        "title": "Headline",
        "key": "headline",
        "required": true
      },
      {
        "type": "file",
        "title": "Hero",
        "key": "hero",
        "required": true
      }
    ],
    "created_at": "2017-05-30T02:06:35.373Z",
    "metadata": null
  }
}

POST /v1/:bucket-slug/media

Add a new Media file to your Bucket.

Required post values include media which is the name of your media sent. If a write key is enabled on the requested bucket, the variable write_key will need to be present in the Body. You can also add an optional folder param to add the Media to a specific folder.

POST https://api.cosmicjs.com/v1/:bucket-slug/media
Body
{
  "media": "your-media-multipart-form-data",
  "folder": "your-folder-slug"
}
Body
{
  "media": {
    "name": "c20391e0-b8a4-11e6-8836-fbdfd6956b31-bird.jpg",
    "original_name": "bird.jpg",
    "size": 457307,
    "type": "image/jpeg",
    "bucket": "5839c67f0d3201c114000004",
    "created": "2016-12-02T15:34:05.054Z",
    "location": "https://cosmicjs.com/uploads",
    "url": "https://cosmicjs.com/uploads/c20391e0-b8a4-11e6-8836-fbdfd6956b31-bird.jpg",
    "imgix_url": "https://cosmicjs.imgix.net/c20391e0-b8a4-11e6-8836-fbdfd6956b31-bird.jpg"
  }
}

PUT /v1/:bucket-slug/edit-object

Edit an Object in your Bucket.

The slug is the only required value and is used to find the Object for editing. You can edit the title, content and Metafields. If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

PUT https://api.cosmicjs.com/v1/:bucket-slug/edit-object
Body
{
  "slug": "cosmic-js-example",
  "title": "New Title Edit",
  "content": "This is some rad test content...",
  "metafields": [
    {
      "title": "Headline",
      "key": "headline",
      "value": "Something Big is Coming",
      "type": "text"
    },
    {
      "title": "Subheadline",
      "key": "subheadline",
      "value": "I bet you want to know what it is...",
      "type": "text"
    }
  ]
}
Body
{
  "object": {
    "_id": "568c5fb72f0c5d532d000001",
    "slug": "cosmic-js-example",
    "title": "New Title Edit",
    "content": "This is some rad test content...",
    "metafields": [
      {
        "title": "Headline",
        "key": "headline",
        "value": "Something Big is Coming",
        "type": "text"
      },
      {
        "title": "Subheadline",
        "key": "subheadline",
        "value": "I bet you want to know what it is...",
        "type": "text"
      }
    ],
    "bucket": "568c5bbefd0dce302c000001",
    "type_slug": "examples",
    "created": "2016-01-06T00:28:39.982Z",
    "user_id": null,
    "order": null
  }
}

PUT /v1/:bucket-slug/edit-object-type

Edit an existing Object Type to your Bucket.

slug is the only required field. You can edit Metafields which will be available as default Metafields for each new Object in this Object Type. If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

PUT https://api.cosmicjs.com/v1/:bucket-slug/edit-object-type
Body
{
  "slug": "pages",
  "metafields": [
    {
      "type": "text",
      "title": "Headline",
      "key": "headline",
      "required": true
    },
    {
      "type": "file",
      "title": "Hero",
      "key": "hero",
      "required": true
    },
    {
      "type": "text",
      "title": "Tagline",
      "key": "tagline",
      "required": true
    }
  ]
}
Body
{
  "object_type": {
    "slug": "pages",
    "title": "Pages",
    "singular": "Page",
    "metafields": [
      {
        "type": "text",
        "title": "Headline",
        "key": "headline",
        "required": true
      },
      {
        "type": "file",
        "title": "Hero",
        "key": "hero",
        "required": true
      },
      {
        "type": "text",
        "title": "Tagline",
        "key": "tagline",
        "required": true
      }
    ],
    "modified_at": "2017-05-30T02:10:35.373Z",
    "created_at": "2017-05-30T02:06:35.373Z",
    "metadata": null
  }
}

DELETE /v1/:bucket-slug/objects/:object-slug

Delete an Object from your Bucket.

If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

DELETE https://api.cosmicjs.com/v1/:bucket-slug/objects/:object-slug
Body (Optional)
{
  "write_key": "your-key-added-in-bucket-settings"
}
Body
{
  "status": "200",
  "message": "Object deleted"
}

DELETE /v1/:bucket-slug/object-types/:object-type-slug

Delete an Object Type from your Bucket.

If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

DELETE https://api.cosmicjs.com/v1/:bucket-slug/object-types/:object-type-slug
Body (Optional)
{
  "write_key": "your-key-added-in-bucket-settings"
}
Body
{
  "status": "200",
  "message": "Object Type deleted."
}

DELETE /v1/:bucket-slug/media/:media_id

Delete Media from your Bucket.

If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

DELETE https://api.cosmicjs.com/v1/:bucket-slug/media/:media_id
Body (Optional)
{
  "write_key": "your-key-added-in-bucket-settings"
}
Body
{
  "status": "200",
  "message": "Media deleted."
}

POST /v1/:bucket-slug/extensions

Add a new Extension to your Bucket.

Required post values include zip which is the name of your media sent. This must be a zip file with the required Extension information. If a write key is enabled on the requested bucket, the variable write_key will need to be present in the Body.

POST https://api.cosmicjs.com/v1/:bucket-slug/extensions
Body
{
  "zip": "your-media-multipart-form-data"
}
Body
{
  "extension": {
    "id": "c62defe0-5f93-11e7-8054-873245f0e98d",
    "title": "Amazon Product Search",
    "image_url": "https://cosmicjs.com/uploads/f1f1bd40-5dcd-11e7-b529-51f126a4b6ee-shopping-cart.jpg",
    "url": "http://localhost:3000/extensions/c62defe0-5f93-11e7-8054-873245f0e98d/dist",
    "zip_url": "http://localhost:3000/extensions/c62defe0-5f93-11e7-8054-873245f0e98d/src/build.zip",
    "installed_at": "2017-07-03T02:03:14.825Z",
    "installed_by": null,
    "font_awesome_class": "fa-shopping-basket"
  }
}

DELETE /v1/:bucket-slug/extensions/:extension_id

Delete an Extension from your Bucket.

If a write key is enabled on the requested Bucket, the variable write_key will need to be present in the Body.

DELETE https://api.cosmicjs.com/v1/:bucket-slug/extensions/:extension_id
Body (Optional)
{
  "write_key": "your-key-added-in-bucket-settings"
}
Body
{
  "status": "200",
  "message": "Extension deleted."
}