Authentication
To use Morph's API, an API key must be included in the header of the request; the API key can be obtained from the Morph dashboard and ensures secure access.
How to obtain an API key
- from the Morph screen home page, press the 'Secrets' tab to display the following page.
- Next, click the 'Create Secret' button, enter an appropriate Secret name and Source IP, and confirm with the 'Create' button. If the Source IP is left blank, all IPs will be allowed; if you wish to limit the Source IP, enter a comma-separated list.
- if you no longer need the API key you created, you can delete it using the 'Delete' button.
- the API key will be completely deleted when the 'Delete' button is pressed from the delete confirmation modal that appears. This operation cannot be undone. Please note that once deleted, the key cannot be recovered.
API URL
The URL for the API is in the following format.
BaseURL: https://beta-api.morphdb.io/v0/rest/[Your_DatabaseID]/
How to check the database ID ([Your_DatabaseID]
):
Check your browser's URL bar on the top page of the Morph screen: the URL is followed by the string UUID (opens in a new tab). That is your database ID.
Note that when querying a specific table in the database schema, the URL of the API is in the following format:
URL: https://beta-api.morphdb.io/v0/rest/[Your_DatabaseID]/[Your_Table_Slug]
How to check the table slug ([Your_Table_Slug]
):
The database icon in the side menu on the left-hand side of the top page of the Morph screen is the database, and the table slug is displayed as the table name.
In the example below, sample_table
is the table slug. To send an API request for sample_table
, set [Your_Table_Slug]
to sample_table
.
Example
Here is an example of accessing the API using the cURL command:
The above [Your_DatabaseID]
, [Your_Table_Slug]
, [Your_API_Key]
should be obtained and replaced in the following way as they vary depending on your environment.