Getting Started with Northstake API

This page will help you get started with Northstake. You'll be up and running in a jiffy!

About This Guide

Welcome to the Northstake Developer Portal Quickstart Guide. This guide is designed to help you get started with the Northstake API ecosystem as swiftly as possible. The Northstake API, built on REST principles, offers a wide range of functionalities, enabling you to programmatically interact with the Northstake platform. Whether you're looking to manage workspaces and users, or you're interested in more complex operations like managing orders or portfolios, the Northstake API has you covered.

Prerequisites

Before diving into the details of the Northstake API, it's essential to ensure that you have API access enabled on your Northstake account. API access is the gateway to integrating your applications with the Northstake ecosystem, providing you the necessary authentication to perform requests.

📘

If you wish to have API access enabled on your Northstake account and it is not already, please reach out to your Northstake account representative


Creating a new API Key

To start utilizing Northstake API, you'll first need to register an API key. An API key serves as your unique identifier and authentication mechanism when making API calls. In order to create an API key with Northstake, you'll need to generate and register an associated public RSA256 key. Both of these are critical for securing your API interactions and ensuring that your requests are authenticated.

Here's a brief overview of how you can register a new API key and RSA256 key:

  1. Navigate to the Northstake portal.

  2. Log in with your credentials.

  3. Access the API section.


  4. Press "Create API Key" to generate a new key and associate a public key with it.

  5. You will be prompted to provide a key name and associated public key RSA256 key.
    Additionally, you will be able to provide a list of IP addresses and CIDR ranges authorized for use of the key.

🚧

Note:

An API key created without a specified IP/CIDR range whitelist will be usable from any source IP. It is your responsibility to adequately scope and define IP whitelists for any keys you may wish to restrict.


Listing Available API keys

The API key menu offers a list of your currently active API keys. Click on any value (key, public key etc) to add the value to your clipboard.


🚧

Be careful - never share your RSA Keypair or private key with anyone!

Generating and Storing Your RSA256 Key Pair

As part of the authentication process, Northstake requires that all API requests be signed using an RSA256 Key pair. This key pair consists of a private key, which you will use to sign your requests, and a public key, which you will register with Northstake to validate the signatures of your requests. It is crucial for securing your API interactions and ensuring that your communications with the Northstake API are encrypted and authenticated.

Key Pair Generation

You are responsible for generating and securely storing your RSA256 key pair. Here are general steps and resources to help you generate an RSA256 key pair:

  1. Generate RSA256 Key Pair: Use OpenSSL or a similar tool to generate an RSA key pair. Ensure that the key size is at least 2048 bits for adequate security.

    openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
    openssl rsa -pubout -in private_key.pem -out public_key.pem
    
  2. Store Private Key Securely: Your private key is used to sign API requests and should be stored securely in a location that your application can access for signing. Ensure this key is never shared or exposed publicly.

  3. Register Public Key with Northstake: You will need to provide your public key to Northstake during the API key registration process. This allows Northstake to verify the signatures of your API requests.

Public key submission formatting

When registering your RSA256 public key with Northstake, it should be submitted as a string in the PEM format. This format is widely used and recognized for encoding the public key. Here's the structure of how your public key should look:

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7vZp5YJFNX25cO9CR1Km
1/sxkh9sG8jDrX+9kVgB5sPDbJIzd2f4YiGp9jZBnsqeQXLI8SiVsqXs7T9zxmp/
bMdD2qg2m1Cq4Ejt4XOO1zY8YPI3UGbBw+TS3xSXn7Y9jVHvwBpJLVX/hcKSl28F
y0cP9P2HdCovZmjkE5GSpPtO+dD2Hk3FvjqBk3RvMwrptJmN6jD4NFDDv+4eCcmH
JEnZT4ryWDGaS/earbIc1QaPSTmziUiYhtLqeezVjxhFi6Cgw5VkDOkT3HHo2DCC
N3nPJvLpU8ADF9C8W74gGNT6LXdLfgUpCdfTa5b5kyjDmIq1MyJ5HQIDAQAB
-----END PUBLIC KEY-----

Please ensure your public key:

  • Starts with -----BEGIN PUBLIC KEY----- and ends with -----END PUBLIC KEY-----.
  • Contains the base64 encoded key body in between the begin and end markers.
  • Does not include a password, as it should be accessible for automated processes without manual intervention.

This format is essential for Northstake to process and validate your API requests properly. If you're generating a new key pair, follow the recommended commands to ensure your keys are in the correct format for use with the Northstake API.

Resources for Key Pair Generation

For more detailed instructions on generating an RSA256 key pair, please refer to the following resources:

Best Practices for Key Management

  • Secure Storage: Always store your private key in a secure location, accessible only to those applications or individuals that require it for signing API requests.
  • No Passwords: Generate your key pair without a password to enable automated processes to use the key without manual intervention.
  • Regular Rotation: Consider periodically rotating your RSA256 key pairs to enhance security. Remember to generate new API keys with Northstake whenever you generate a new key pair.

By following these guidelines and utilizing the provided resources, you can ensure that your integration with the Northstake API is secure and efficient.


What’s Next