Nodejitsu provides a web API for developers who want to interact with the Nodejitsu platform programatically. This API is built to be RESTful and communicates via JSON. The API is the most low-level way of interacting with the Nodejitsu platform. For most deployment scenarios you should use our command line tool, jitsu, or login directly at http://nodejitsu.com
The documentation here should be an accurate representation of our current API, but you can always look directly at our API wrappers in jitsu
to see a working example of an application built against Nodejitsu's REST API.
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 http://nodejitsu.com. Currently, we support Basic Authentication. If you haven't used Basic Auth before don't fret, it's easy!
Here is an example using the command line utility, Curl.
// get all applications for User "Marak"
curl --user Marak:password http://nodejitsu.com/apps/marak
If you are trying to use our API directly and are having issues with Basic Auth, please feel free to email support@nodejitsu.com
Applications are the core of the Nodejitsu API. Each application represents a set of 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: package.json
GET /apps/:user-id
POST /apps/:user-id
{ package.json }
POST /apps/:user-id/:app-id/start
POST /apps/:user-id/:app-id/stop
POST /apps/:user-id/:app-id/restart
PUT /apps/:user-id
{ package.json }
DELETE /apps/:user-id/:app-id/remove
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.
PUT /apps/:user-id/:app-id/snapshots/:id/active
POST /apps/:user-id/:snapshots/:id
GET /apps/:user-id/:app-id/snapshots
GET /apps/:user-id/:app-id/snapshots/:id
Email address is the only required field.
POST /users/:user-id
{
email: "youremail@theinternet.com"
}
All User accounts must be confirmed. When a new User is created, a confirmation email will be sent to the email address associated with that user. In this email there will be an invite code. This code must be sent to the API to confirm the account.
POST /users/:user-id
{
inviteCode: "SecretCode"
}
PUT /users/:user-id
{
password: "new_password"
}
Databases are an integral part of most applications. The Nodejitsu API allows you to dynamically create new hosted database instances for your applications. Cloud database hosting is provided by: CouchOne, Redis2Go and MongoHQ.
POST /databases/:user-id/:database-id
{
type: "Couch || Redis || Mongo"
}
GET /databases/:user-id/:database-id
DELETE /databases/:user-id/:database-id
Logging is a very important feature in any professional grade Node.js application. Nodejitsu provides integrated logging solutions for your applications. Your logs are always saved and ready to be retrieved. TODO: add better description on logging
GET /logs/:user-id/
GET /logs/:user-id/:app-id
The Marketplace is an online store where you can browse ready to deploy Node.js Applications. The Marketplace is a great place to start if you are new to Node.js development or want to share your existing Node.js Application with the world.
GET /marketplace
GET /databases/:user-id/:id