LogoLogo
WebsiteLoginStatus
API Reference
API Reference
  • Introduction
  • Introduction to GraphQL
    • What is GraphQL?
      • GraphQL Schema
      • Example Using GraphQL
    • Authentication
    • Queries
      • Example Query
    • Mutations
      • Example Mutation
    • Variables
    • Fields
  • Develop With inabit API
    • Getting Started
      • Authentication
      • inabit Postman Collection
    • Organizations
      • Organization Info
      • Organization ID
      • Organization Users
      • Organization Contacts
      • Organization Transactions
    • Wallets
      • Wallets Info
      • Create inabit Wallet
      • Edit Wallet Name
      • Generate Deposit Address
      • Fetch Deposit Address
      • Save Address to Whitelist
      • Archive / Unarchive Wallet
      • Disconnect Exchange Wallet
    • Contacts
      • Contact Info
      • Create New Contact
      • Update Contact
    • Transactions
      • Transaction Info
      • Create Transfer Request
      • Create Off Ramp Request
      • Create On Ramp Request
      • Create Exchange Swap
      • Create inabit Wallet Swap
      • Edit Transaction Note
    • Utilities
      • Fetch Financial Asset
      • Fetch Blockchains
  • Remote Approver App
    • Setup and Configuration
    • API Wallets Generation
    • Automate Signing Transactions
    • Webhooks
      • Notification Types
  • WHAT WE SUPPORT
    • Assets & Tokens
    • Blockchains
    • Exchanges
      • Binance
      • Kucoin
      • Kraken
  • Changelog
Powered by GitBook
On this page
  • Accessing inabit API
  • How to create an API Admin?
  • Headers
  • Retrieving Login Token
  • Retrieving Access Token
  • Refreshing Existing Login Token

Was this helpful?

Export as PDF
  1. Develop With inabit API
  2. Getting Started

Authentication

How to retrieve a JWT access token to perform queries and mutations in our GraphQL API

PreviousGetting StartedNextinabit Postman Collection

Was this helpful?

Accessing inabit API

In order to access our API capabilities and authenticate queries and mutations, you must create an API Admin.

Note - You can also decide to create an API Viewer. Doing so you will only allow you to receive API capabilities of a Viewer.

About API User Roles

Feel free to visit our user roles explanation page in the documentation to learn more about the API roles in the inabit platform, as well as the rest of the roles existing in inabit.

How to create an API Admin?

  • Contact inabit's support at to retrieve a JWT access token for you with admin permissions.

  • The token has access to all relevant mutations and queries in our schema.

Import to remember: Access tokens are valid for 15 hours once they're created. if you're using an existing token that might've been expired, you'll be unauthorized to call queries and mutations and will need to retrieve a new token again.

Headers

These are the headers you insert when you authenticate to our GraphQL API root endpoint. You will always have to pass an authorization Bearer (token) for access to our queries mutations and webhooks (subscriptions) service.

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Retrieving Login Token

Once you've contacted inabit's support and we've created the necessary API users per your request, we'll go ahead and create an API login token for your account.

The token will be shared with you/your team across a secured channel with inabit.

This login token serves as the bearer/authorization token to call for an access token to our GraphQL API schema that you will use to authorize queries and mutations.

Login tokens are valid for 30 days and should be refreshed by your end ahead of time before expiration.

Retrieving Access Token

Once you managed to retrieve a login token, you will use it to query an access token that for security reasons, will be valid for 15 minutes - to use in your queries and mutations of the API.

Access tokens are valid for 15 minutes and should be refreshed by your end ahead of time before expiration.

How To Query an Access Token

query Query {
  getApiUserAccessToken
}

Response:

{
  "data": {
    "getApiUserAccessToken": "ey......"
  }
}

Refreshing Existing Login Token

Before reaching the 30 day expiration time of your API user's login token, you'll need to use the following query to refresh/update the existing token.

You will then use the new login token given in the response in order to generate new access tokens and the previous token will be expired.

Refresh Login Token Query

query Query {
  refreshApiUserLoginToken
}

In the variables/body of this query, you will need to insert the current existing login token as the authorization/bearer for the query.

Response:

{
  "data": {
    "refreshApiUserLoginToken": "ey......"
  }
}
support@inabit.com