Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: fabb1c5c19
Fetching contributors…

Cannot retrieve contributors at this time

167 lines (101 sloc) 5.012 kB
<div class='mp'>
<h1><p><a name="Using_The_API"></a></p>
Using The API</h1>
<p>Nodejitsu provides a web API for users who want to interact with the Nodejitsu platform programatically. This API is built to be RESTful and communicates via JSON.</p>
<li><a href="#Applications" data-bare-link="true">Applications</a></li>
<li><a href="#Snapshots" data-bare-link="true">Snapshots</a></li>
<li><a href="#User" data-bare-link="true">Users</a></li>
<li><a href="#Database" data-bare-link="true">Databases</a></li>
<li><a href="#Marketplace" data-bare-link="true">Marketplace</a></li>
<li><a href="#Logging" data-bare-link="true">Logging</a></li>
<h2 id="Authentication">Authentication</h2>
<p>Most of the calls to the API will require that you authenticate using your Nodejitsu account. If you do not have an account it is possible to create one using the User API, the Jitsu CLI, or just by visiting <a href="" data-bare-link="true"></a>. Currently, we support <a href="">Basic Authentication</a>. If you haven't used Basic Auth before don't fret, it's easy!</p>
<p><strong>Here is an example using the command line utility, <a href="">Curl</a>.</strong></p>
<pre><code> // get all applications for User "Marak"
curl --user Marak:password
<p><a name="Applications"></a></p>
<h2 id="Applications">Applications</h2>
<p>Applications are the core of the Nodejitsu API. Each application represents a set Node.js code plus a package.json which contains meta-data about the application such as it's dependencies, database connections, configuration settings, authors, etc. For more information about the package.json format see: LINKTO: package.json docs</p>
<h4 id="Get-all-applications-for-a-User">Get all applications for a User</h4>
<pre><code> GET /apps/:user-id
<h4 id="Create-a-new-Application">Create a new Application</h4>
<pre><code> POST /apps/:user-id
{ package.json }
<h4 id="Start-an-Application">Start an Application</h4>
<pre><code> POST /apps/:user-id/:app-id/restart
<h4 id="Stop-an-Application">Stop an Application</h4>
<pre><code> POST /apps/:user-id/:app-id/start
<h4 id="Restart-an-Application">Restart an Application</h4>
<pre><code> POST /apps/:user-id/:app-id/stop
<h4 id="Update-an-Application">Update an Application</h4>
<pre><code> PUT /apps/:user-id
{ package.json }
<h4 id="Delete-an-Application">Delete an Application</h4>
<pre><code> DELETE /apps/:user-id/:app-id/remove
<p><a name="Snapshots"></a></p>
<h2 id="Snapshots">Snapshots</h2>
<p>Snapshots are an easy way to capture the current state of your application. Once a Snapshot of your application is created you can roll back and activate that Snapshot at any time.</p>
<h4 id="Make-an-existing-snapshot-the-active-app">Make an existing snapshot the active app</h4>
<pre><code>PUT /apps/:user-id/:app-id/snapshots/:id/active
<h4 id="Activate-Deploy-a-snapshot">Activate / Deploy a snapshot</h4>
<pre><code>POST /apps/:user-id/:snapshots/:id
<h4 id="Show-a-catalog-of-all-Snapshot-for-an-Application">Show a catalog of all Snapshot for an Application</h4>
<pre><code>GET /apps/:user-id/:app-id/snapshots
<h4 id="Show-the-contents-of-a-Snapshot">Show the contents of a Snapshot</h4>
<pre><code>GET /apps/:user-id/:app-id/snapshots/:id
<p><a name="Users"></a></p>
<h2 id="Users">Users</h2>
<h4 id="Signup-a-new-User">Signup a new User</h4>
<pre><code> TODO:
<h4 id="Confirm-a-User-account">Confirm a User account</h4>
<pre><code> TODO:
<h4 id="Update-User">Update User</h4>
<pre><code> TODO:
<p><a name="Databases"></a></p>
<h2 id="Databases">Databases</h2>
<h4 id="Create-a-new-Database">Create a new Database</h4>
<pre><code> POST /databases/:user-id/:id
type: "Couch || Redis || Mongo"
<h4 id="Get-information-about-a-Database">Get information about a Database</h4>
<pre><code>GET /databases/:user-id/:id
<h4 id="Delete-a-Database">Delete a Database</h4>
<pre><code>DELETE /databases/:user-id/:id
<p><a name="Marketplace"></a></p>
<h2 id="Marketplace">Marketplace</h2>
<h4 id="Get-all-Marketplace-Applications">Get all Marketplace Applications</h4>
<pre><code>GET /marketplace
<h4 id="Get-a-specific-Marketplace-Application">Get a specific Marketplace Application</h4>
<pre><code>GET /databases/:user-id/:id
<p><a name="Logging"></a></p>
<h2 id="Logging">Logging</h2>
<h4 id="Get-all-logs-for-a-user">Get all logs for a user</h4>
<pre><code> GET /logs/:user-id/
<h4 id="Get-logs-for-a-specific-application">Get logs for a specific application</h4>
<pre><code> GET /logs/:user-id/:app-id
Jump to Line
Something went wrong with that request. Please try again.