Docs > Web services

PostCMS provides a RESTful web services API as a way of integrating with external applications (such as code on your live web server).
You can issue API keys that can be used to access the PostCMS web services API, allowing you to post data into your account from other applications.

Base URL for web services

The endpoint for your web services is:
http://acme.postcms.com/cms/api
where acme is your account name.

Content type methods

If you have defined content types on your account, then they are automatically exposed via the web services API.

Suppose you have created a content type named "Tip", with this definition:
new ContentType('Tip', {
title: 'string',
body: 'text'
});
You can create a new tip by posting an XML payload to the REST API like this:
POST /cms/api/tips?method=create
<Tip>
<title>Great new restaurant</title>
<body>A new restaurant just opened in Southwark.</body>
</Tip>
Each content object you create is assigned a unique identifier which is used to address it. For example, the 12th Tip object created will have the address tips/12. Given that address, you can update it like this:
POST /cms/api/tips/12?method=update
<Tip>
<body>A new restaurant just opened in Bermondsey.</body>
</Tip>
Specifying method=update does a non-destructive update. That means that fields that were omitted from the payload ("title" in this case) are left unchanged. To rewrite the entire object, use method=replace.

Can't find what you're looking for?

Let us know and we'll see if we can help.