API Basics

Modernbanc API is located at api.modernbanc.com/v1/.

It offers simplicity of REST while offerring benefits you'd expect from GraphQL:

  • All get multiple objects endpoints support pagination and filters
  • For all get endpoints you can include only the fields you want.
  • You can ensure one operation never runs twice (important for payments!) by using idempotency keys.

Generating an API key

  • In Modernbanc, navigate to the settings menu by opening up the main navigation dropdown and clicking settings, or by pressing G then S
  • In the settings dropdown, click API keys, or get there by pressing G then A
  • Click create in the top right corner to open the API key creation modal
  • Name your key, select the key's role, and when it expires.
  • Click create, now you can access the Moderbanc API

Note: To see the API reference press K on any documentation page for an easily searchable popup.

Headers

For all workspace-related endpoints please attach x-workspace header with identifier field of your workspace.

For objects that support environments (have environment_id in them) also make sure to attach environment identifier in x-environment header.

For example to list accounts in test environment you'd send a request like below:

curl --request GET \
  --url 'https://api.modernbanc.com/v1/accounts'
  -H 'Authorization: ApiKey YOUR_API_KEY'
  -H "x-workspace: acme"
  -H "x-environment: test"