Cosmic Blog API Updates: Authentication, Add Buckets and More

API Updates: Authentication, Add Buckets and More

by Tony Spiro on June 1, 2017

Cosmic JS is on a mission to help you build apps faster.  With this goal in mind, we're happy to announce some additions to our API that will help you manage your application content faster and easier, right from the Cosmic JS API.

We’ve added new endpoints to the API which include:
1. User Authentication
2. Add Buckets to your account
3. Add / Edit / Delete Object Types in your Bucket
4. Add Media to a folder in your Bucket
Check out the Docs page for all of the new additions to the API.

Authentication
Have you ever wanted to access your account from the API and create new Buckets from the comfort of your own application?  Well now you can thanks to the new POST /authenticate endpoint.  Simply add your Cosmic JS email and password, get your token, then begin performing account-specific tasks from the API.  Currently this only includes Bucket creation, but we plan to open up more features for account management soon.

POST /authenticate

{
  "email": "john@johndoe.com",
  "password": "CatsAreAwesome"
}

Read more about Authentication

Add Buckets
Use the new POST /buckets endpoint to add your new Bucket to your account.  The only required fields are title and a Header with Authorization: Bearer <token>.
Read more about adding Buckets

Add / Edit / Delete Object Types
Add Object Types with POST /:your-bucket-slug/add-object-type
Edit Object Types with PUT /:your-bucket-slug/edit-object-type
Delete Object Types with DELETE /:your-bucket-slug/:object-type-slug
Read more about Object Types

Add Media to Folders
You can now add Media to your Bucket and specify which folder to place it in.

POST /:your-bucket-slug/media

{
  "media": FILE_DATA,
  "folder": "your-folder-slug"
}

Read more about adding Media

I hope you find these new additions to the API useful for building your applications.  Browse the API docs to see more detail on how to use the new additions to the API.  If you have any questions reach out to us on Twitter and join our Slack community.


Icon provided by Iconfinder.

You may also like


We’re excited to announce the official release of Gatsby Preview for Cosmic JS that enables you to add powerful content preview functionality to your Cosmic JS Gatsby website.

In this installment of the Cosmic JS Developer Spotlight Series, we sat down with Jacob Knaack, a Web Developer and Technical Communicator residing in Seattle, Washington. Jacob is a Front End Developer at restack, a development studio that finely crafts websites and apps. Jacob is also a frequent contributor to the Cosmic Community, having recently built both the Progressive Apollo Blog as well as the Gatsby Documentation Website. Follow Jacob on LinkedIn and GitHub and enjoy the conversation.

Looking to shortlist some headless content management systems? Our comprehensive list will help you narrow down the growing headless CMS landscape.

We released our additional users Add-on a few weeks ago and it has become one of the most popular products. We think customers really like the flexibility it gives their team to upgrade just a portion of their usage plan instead of jumping up to the next plan. With that flexibility in mind, we are happy to offer two more add-ons to help you get the most out of Cosmic while allowing more billing flexibility.

We're excited to announce some big updates to our branding and website design. We have now changed our name to Cosmic. By dropping the JS from our name, we intend to not only be the best CMS for JavaScript developers, but also for developers using any programming language.

In this installment of the Cosmic JS Developer Spotlight Series, we sat down with Raymond Camden, a Senior Software Engineer and Developer Advocate residing in Lafayette, Louisiana. Raymond has extensive experience in the technology space, having enjoyed stints at IBM, Adobe and AuthO prior to becoming a Senior Engineer for Developer Experience at American Express. Follow Raymond on Twitter, GitHub or LinkedIn, and enjoy the Q/A.

Ready to Get Started?

No payment info required.
Start Now   Contact Sales