GrapheneDB Management API

With this HTTP REST API you'll be able to perform and automate common operations on your databases:

  • DB instances: create, delete, empty, restart.
  • Backups: schedule, restore, export, import, manual snapshot.

Following the guidelines below, clients can be developed in virtually any programming language. Tools such as cURL or httpie can be used to debug and develop on top of this API. Additionally, for those users interested in web applications, we have included CORS support.

Versioning

A new version of this API will be released when there are backwards-incompatible changes. All clients are recommended to always stay current, so a upgrade guide will be provided, together with a changelog.

This the version 1.0 of the API, which means that the root path must be set to /v1. All new versions will be announced and the old ones will be kept unaffected for several months so that clients can be migrated. New features can be added to an existing version if there are no breaking changes.

API root

Our only supported endpoint is https://api.graphenedb.com/v1

Live documentation

Our API uses Swagger. It’s a de-facto standard for describing REST-based HTTP APIs that will make your life easier. Please find a live documentation and an embedded client to test our API here:
https://api.graphenedb.com/swagger-ui/

API Reference

This API is organized around REST, which means that:

  • Resources can be accessed in a stateless, predictable manner.
  • Each resource is identified by a URL.
    • Entities are identified by a UUID
      • /databases/822b16bb0c0d4631ae30719cab74c352
    • Collections of entities can be obtained by not specifying a UUID:
      • /databases
    • Nested subresources are used:
      • /databases/822b16bb0c0d4631ae30719cab74c352/restart
      • /databases/822b16bb0c0d4631ae30719cab74c352/backups/latest
  • The entities and collections handled by this API can be obtained using standard HTTP/1.1 methods.
    • POST creates a new entity.
    • GET reads an entity or collection.
    • PUT updates an entity or executes a command on it.
    • DELETE deletes an entity.
  • Each method can return HTTP success or error responses, always following the guidelines of RFC 2616, but with an additional meaning to our API:
    • 200: Immediate, synchronous responses from GET, PUT.
    • 201: New entities created via POST.
    • 202: Costly operations from PUT, POST are asynchronous.
    • 204: Empty content from PUT, DELETE.
    • 400: The client provided a bad request payload (eg. format or schema issues) to a POST, PUT operation.
    • 401: The client is unauthorized.
    • 404: The resource path does not exist in the API.
    • 405: The client used an undefined HTTP method on a resource.
    • 409: There’s another operation in progress on the same resource.
    • 500: there was an error on our side.
    • 501: the operation hasn’t been implemented yet.
    • 502: the public API received an unexpected response from our internal infrastructure.
    • 504: the public API didn’t receive a response from the internal infrastructure.
  • The standard encoding for all requests and responses is JSON
  • The accepted charset for all communications is UTF-8
  • All dates are expressed in compliance with RFC 7231
    • Sun, 06 Nov 1994 08:49:37 GMT

Async operations

Depending on the database characteristics (size, instance type), some actions might take longer than others to complete. If the action is a costly one (eg. create a large instance, restart a db), the API will return a 202 Accepted together with an operation id. For immediate actions, the API returns a 2xx code.

User files

In some actions the user will be required to provide a valid file (eg. import a backup). In these cases, the user must provide an URL to a AWS S3 bucket. The file must be given all the required permissions so that our infrastructure can access it. In most cases, a random UUID and a public bucket will be enough.

Backup support

Some operations are only available starting from Standard plans:

  • Scheduled daily backups
  • Manual backups (snapshots)
    All plans include an export option which will generate a downloadable secure link to S3. The import can be applied by uploading the exported file to a valid S3 bucket (see above).

Payment method

Please make sure you have entered a valid payment method in GrapheneDB’s admin interface. Otherwise, the database creation operations will fail.

Authentication & Security

The only way to access the API is through HTTPS. The API is protected by our wildcard SSL certificate issued by Amazon.
Download the information about the root CAs here.

Authentication is performed via a special header named api_key which must be set to a value provided by the admin web interface.

📘

API KEYS

You can create an API key by going to https://app.graphenedb.com/account/api-clients
-- click on the 'Create new client' button and complete the form.

Response Objects

Error

4xx errors indicate that there is something wrong in the client request. For instance, the state of the resource is incompatible with the requested operation, or maybe the supplied JSON payload doesn’t match the expected schema. 5xx errors point to an unhandled failure in the server. In some cases, the message returned by the server is:

{ "error": "string" }

The value of the string points to the actual cause. For security reasons, 500 errors include only a nonce (UUID) that should be provided to our support team.

Catalogs

Version

Represents a supported Neo4j version.

Request path/databases/versions
versionString (id)Version identifier
descriptionString (text)Version description

Plan

GrapheneDB plans:

  • sandbox
  • developer
  • s1
  • s2
  • p1
  • p2
  • p3
  • p4
  • p5

Regions

The supported EC2 regions (as of API version 1.0) are:

  • us-east-1
  • us-west-1
  • us-west-2
  • eu-west-1
  • eu-west-2
  • eu-west-3
  • ap-northeast-1
  • ap-southeast-1
  • ap-southeast-2

Operation

The same API endpoint can return a sync or async operation, depending on the database size and plan. The “operation” object represents an asynchronous operation.

Resource path/operations/{operationId}
idString (uuid)Operation id
databaseIdString (uuid)Database id
descriptionString (text)Operation description
stoppedBooleanIs the database stopped?
createdAtString (tstamp)UNIX epoch
currentStateString (enum)global operation status:
started
finished
* failed
eventsArrayCollection of events

Operation Event

stateString (enum)Event identifier (human-readable). Examples:
freezing-volume
creating-snapshot
copy-snapshot
...
createdAtInteger (tstamp)UNIX epoch

Database

Resource path/databases/{databaseId}
idString (uuid)Database identifier
nameString (text)Database name
urlString (url)Access the Neo4j REST API through this endpoint
boltURLString (url)Endpoint for Bolt, new Neo4j binary protocol. Available as of Neo4j 3.0
webAdminURLStringNeo4j browser URL. Use Basic Auth with the same credentials as above. This is a REST endpoint.
metricsURLString (url, optional)
createdAtString (timestamp)db creation date, in ISO-8601
versionString (text)Full description of the installed Neo4j version
currentSizeInteger (long)Database size in bytes
pluginsArray (object)Installed extensions
maxSizeInteger (long)Maximum database size in bytes, depending on the plan
planObjectPlan object
awsRegionStringEC2 region identifier
countersObject (optional)Current number of nodes and relationships
clusterObject (optional)Information about the cluster, in case the instance is a member

Plugin object

idString(uuid)Plugin UUID
nameStringPlugin name
enabledBooleanIs the extension enabled?
isManagedBooleanIs it a managed extension?
kindString(enum, optional)Extension type:
storedprocedure
extension
createdAtString(date)ISO-8601 date with creation timestamp

Plan object

typeString(enum)Plan type (see corresponding section)
limitsObjectPlan limits

Limits object

NodesInteger(long)Max no. of nodes in this plan
RelationshipsInteger(long)Max no. of relationships in this plan

Counters object

NodesInteger(long)Current no. of nodes
RelationshipsInteger(long)Current no. of relationships

Cluster object

masterURLString(url)URL of the master node
nodesArray (serverId)Array of nodes

ServerId object

serverIdIntegerNode identifier

Backup

Resource path/databases/{databaseId}/backups/{backupId}
idString(uuid)Backup identifier
stateString(enum)Backup status:
done
working
originString(enum)Backup origin:
scheduled
manual
* automatic
timestampString(date)ISO-8601 timestamp of the backup termination
sizeInteger(long)Backup size in bytes
durationInteger(long)Backup duration in seconds
packageURLString(UrlPath)Path to append to the API root to produce a downloadable link with the package (graph.tar.gz)
downloadableBooleanCan the user download the backup package?

Backup Schedule

Resource path/databases/{databaseId}/backups/schedule
timeString(time)H:MM:SS
timezoneString(enum)Always set to UTC
frequencyString(enum)Always set to “daily”

Backup Package

Resource path/databases/{databaseId}/backups/{backupId}/package
backupUrlString(url)Secure one-time URL pointing to a volatile S3 bucket.

Database Export

Resource path/databases/{databaseId}/export
urlString(url)Secure one-time URL pointing to a volatile S3 bucket.
sizeIntegerExport file size (graphdb.zip)

Request Objects

Database

Resource path/databases
nameStringName of the database
versionString(id)Version identifier, eg. “v236”
awsRegionString(id)EC2 valid region, eg. “eu-west-1”
planString(id)GrapheneDB plan. “cluster” is not accepted

Backup schedule

Resource path/databases/{databaseId}/backups/schedule
timeString(time)H:MM:SS
timezoneString(enum)Always set to UTC
frequencyString(enum)Always set to “daily”

Database Import

Resource path/databases/{databaseId}/import
urlString(url)Link to the S3-stored graphdb.zip. Please give it permissions so our internal infrastructure can access it.