API keys

Everything you need to know about Briink API keys

How do API keys relate to Briink workspaces?

With an API key you can access and manage all resources of the Briink workspace the API key belongs to. API keys are not shared between workspaces, so each workspace needs its own API key. Multiple API keys per workspace are allowed.

When API keys are created, they get associated to a service member within the workspace. The service member does not occupy a paid workspace seat. The API key is not tied to the user who created it and will remain valid if the creator leaves the workspace.

Step-by-step instructions for making your first API call

1. Get your API key

To create an API key, you can log into the Briink tool with your Briink account email.

Then,

  • Choose the workspace you want to create an API key for
  • Navigate to the "Workspace settings" page from the top left dropdown menu
  • Select the "API keys" page and click on the "+ Create API key" button

  • Choose a name for the API key and click on the "Create API key" button.

  • You will be able to see the newly created API key in a following Pop-Up, from where you can copy it to a safe place. Please note that you can only see the full API key value once after the creation. For security reasons, Briink stores the API keys only in a non-reversible hashed format and a masked format.

  • After a successful API key creation, your new API key should be visible in a list on the API keys page. From here, every workspace member can edit the name of the API key or revoke it in case you do not need it anymore or its security has been compromised.

  • In your workspace settings "Members" page you can now see a new service member called "API". This is the service member the API key uses and it will show up in the Briink UI as the creator of any resources in the workspace that have been created via API.

2. Use the API key in a request

You can send your API key within the request header 'x-api-key' to Briink's API.

The base url for requests is: https://api.platform.briink.com/

You can find the workspace id the API key belongs to in your workspace's API key settings page, on the top left:

Example:

import requests

class BriinkApiService:

    def __init__(self):
        self.url = 'https://api.platform.briink.com/'
        self.payload = {}
        self.headers = {
          'x-api-key': BRIINK_API_KEY
        }
        # Note: use the workspace_id of the workspace your API key belongs to
        self.workspace_id = 'example-workspace-uuid'

    def get_workspace(self):
        response = requests.request(
            'GET',
            f'{self.url}/workspaces/{self.workspace_id}',
            headers=self.headers,
            data=self.payload
        )
        return response.json()
          
workspace = BriinkApiService().get_workspace()

Security best practices

When storing API keys, it is essential to follow security best practices to safeguard your applications and data.

  • Never hard-code API keys directly into your source code or commit them to version control systems like Git. Instead, utilise secure storage solutions such as environment variables or dedicated secret management services to store and access API keys at runtime.
  • Ensure that API keys are not exposed in logs, error messages, or any client-side code. Monitor and audit the usage of your API keys to detect and respond to any suspicious activities promptly.