API Keys
The API Key object allows you to gain programmatic access to all of Felloh’s functions. Each key is associated with certain access rights and represents a unique entity that a user or system can authenticate with.
For more information on how to create and manage your API keys, check out our guide on API key creation.
API Key Model
Properties
- Name
id- Type
- string
- Description
Unique identifier for the object.
- Name
name- Type
- string
- Description
A human-friendly name for the API keys.
- Name
public_key- Type
- string
- Description
The public key.
- Name
secret_key_last_four- Type
- string
- Description
The last four characters of the secret key.
- Name
created_at- Type
- datetime
- Description
The datetime at which the API key was created within our systems.
- Name
user.id- Type
- string
- Description
The user ID that all actions of the API key will be linked to.
{
"id": "6baa5798-46c7-4701-98a6-c1462f57df0d",
"name": "my_access_key",
"public_key": "22bc9c6eaa2d8aa7ce4a233b0790bc3248fbdab33cb393c7a8ff2b4fd9fcb551",
"secret_key_last_four": "e653",
"created_at": "2022-06-24T09:59:57.891Z",
"user": {
"id": "decc740c-c942-4624-9b5c-b57688a1f356"
}
}
Fetch All
This endpoint retrieves the API keys associated with a specified organization. All API key endpoints require the developers:manage:keys role.
Parameters
- Name
organisationrequired- Type
- string
- Description
The organization ID for which you want to fetch API keys. You can find the organization that you have access to by using the List all organisations method.
- Name
skip- Type
- integer
- Description
Pagination offset. See the pagination section for details.
- Name
take- Type
- integer
- Description
Number of records to return. Defaults to 20, maximum 200.
Returns
An array of API Key Models
Request
import axios from 'axios';
const response = await axios.post(
'https://api.felloh.com/token/keys',
{
organisation: 'X9876'
},
{
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer <YOUR TOKEN HERE>` }
}
);
Response
{
"data": [
{
"id": "6baa5798-46c7-4701-98a6-c1462f57df0d",
"name": "my_access_key",
"public_key": "22bc9c6eaa2d8aa7ce4a233b0790bc3248fbdab33cb393c7a8ff2b4fd9fcb551",
"secret_key_last_four": "e653",
"created_at": "2022-06-24T09:59:57.891Z",
"user": {
"id": "decc740c-c942-4624-9b5c-b57688a1f356"
}
}
],
"errors": [],
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}
Create One
This endpoint allows you to create a new API key for an organization.
Parameters
- Name
organisationrequired- Type
- string
- Description
The organization ID for which you want to create the API key.
- Name
namerequired- Type
- string
- Description
The human-friendly name of the API key.
Returns
- Name
name- Type
- string
- Description
The name that you have given to the API Key
- Name
public_key- Type
- string
- Description
The public key
- Name
secret_key- Type
- string
- Description
The secret key (this should never be used on a frontend and should be securely stored). It is only returned once, at creation.
- Name
user- Type
- object
- Description
The user the key was created by, as an object containing id.
Request
import axios from 'axios';
const response = await axios.post(
'https://api.felloh.com/token/key',
{
organisation: 'X9876',
name: 'Test Key'
},
{
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer <YOUR TOKEN HERE>` }
}
);
Response
{
"data": {
"name": "Test Key",
"public_key": "22bc9c6eaa2d8aa7ce4a233b0790bc3248fbdab33cb393c7a8ff2b4fd9fcb551",
"secret_key": "9f1c0b7a2d4e6f8a1b3c5d7e9f0a2b4c6d8e0f1a3b5c7d9e1f2a4b6c8d0e2f4a6b8c0d1e3f5a7b9c1d3e5f7a9b0c2d4e6f8a1b3c5d7e9f0a2b4c6d8e0f1a3b5c7d9e1",
"user": {
"id": "decc740c-c942-4624-9b5c-b57688a1f356"
}
},
"errors": [],
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}
Delete One
This endpoint allows you to delete an API key for an organization. An unknown key id returns a 404 with the error code api_key.not_found.
Path Parameters
- Name
key_id- Type
- string
- Description
The key ID that you wish to delete.
Returns
An empty object
Request
import axios from 'axios';
const response = await axios.delete(
'https://api.felloh.com/token/key/d5f8e8f5-fa6f-4c00-b943-60d1855afe85',
{
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer <YOUR TOKEN HERE>` }
}
);
Response
{
"data": {},
"errors": [],
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}
