Overview
Morph API uses API Keys to authenticate requests.
All the endpoints of Morph API require an x-api-key
header with an API Key to authenticate API requests.
Create an API Key
Head to API Keys to learn how to create and use API Keys.
Authenticate requests
Once you have an API Key, you can authenticate your requests by defining the API Key as an x-api-key
header.
x-api-key header
This is how thex-api-key
header with an API Key should be used:
--header "x-api-key: {YOUR_API_KEY}"
Example where the x-api-key
header and API Key are part of a full example of a request to the Query Records endpoint.
curl --X POST "https://{YOUR_TEAM_SLUG}.api.morphdb.io/v0/data-api/record/query" \
--header "Content-Type: application/json" \
--header "x-api-key: {YOUR_API_KEY}" \
--data "{
\"select\":[\"*\"],
\"sort\":[],
\"limit\":5,
\"skip\":0
}
"
The
x-api-key
is a custom HTTP header. It is not part of the standard HTTP headers defined by the HTTP/1.1 specification. However, it is widely used by many APIs as a convention for sending API key, such as AWS API Gateway and others.
Other requirements
All requests must be sent over HTTPS
Authentication errors
Example of authentication error returned by Morph API when sending a request to the Get List of Fields endpoints without the x-api-key
header and API Key.
{
"error": "auth_error",
"subCode": 4,
"message": "API Key is invalid."
}
Head to authentication error for more details about these errors.
Next steps
To learn how to create and use API Keys to authenticate your request to Morph API, head to: