API Keys
API keys offer an alternate method of authentication to the Matatika API using a client ID and secret. Access using API key credentials is supported by the Matatika CLI and SDK, which allows a user to remain authenticated permanently.
Objects
API Key
Path | Type | Format | Description |
---|---|---|---|
id |
String |
Version 4 UUID | The API key ID |
created |
String |
ISO 8601 timestamp | The instant when the API key was created |
lastModified |
String |
ISO 8601 timestamp | The instant when the API key was last modified |
name |
String |
The API key name | |
clientId |
String |
The API key client ID | |
profileId |
String |
The API key owner profile ID |
{
"id" : "94c6c71f-c994-46ca-aac6-724f42a514fa",
"created" : "2024-12-16T09:52:31.079446",
"lastModified" : "2024-12-16T09:52:31.079446",
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)",
"clientId" : "UVrfEjRD1VJchj5qGzN6fYiiLrYi4a9i",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"update apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"delete apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"profile" : {
"href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Requests
- View all API keys
- View an API key
- Initialise an API key
- Create an API key
- Update an API key
- Delete an API key
View all API keys
GET
/api/apikeys
Returns all API keys owned by the authenticated user profile.
Prerequisites
- The authenticated user must own a Matatika account
- The API key
{apikey-id}
must exist
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/' -i -X GET \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/apikeys/"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
API key collection with HAL links.
{
"_embedded" : {
"apikeys" : [ {
"id" : "94c6c71f-c994-46ca-aac6-724f42a514fa",
"created" : "2024-12-16T09:52:31.079446",
"lastModified" : "2024-12-16T09:52:31.079446",
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)",
"clientId" : "UVrfEjRD1VJchj5qGzN6fYiiLrYi4a9i",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"update apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"delete apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"profile" : {
"href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}, {
"id" : "aae2e712-9382-488b-aa4b-5df161307f8c",
"created" : "2024-12-16T09:52:28.839236",
"lastModified" : "2024-12-16T09:52:28.839236",
"name" : "default",
"clientId" : "2ABko1rxJwkyWwbhy2eDIcTwLuY68EtX",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"accessToken" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJFRkNRamczTlRRMk16QTROalpHT0RjNFFUWkJOemMyTkRGR1FUSkVOVEEyUkRkR1JrSkRPQSJ9.eyJpc3MiOiJodHRwczovL2lkZW50aXR5Lm1hdGF0aWthLmNvbS8iLCJzdWIiOiIyQUJrbzFyeEp3a3lXd2JoeTJlREljVHdMdVk2OEV0WEBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9hcHAubWF0YXRpa2EuY29tL2FwaSIsImlhdCI6MTczNDM0Mjc1MCwiZXhwIjoxNzM0NDI5MTUwLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJhenAiOiIyQUJrbzFyeEp3a3lXd2JoeTJlREljVHdMdVk2OEV0WCJ9.iqju_uNw_V1QOoijklLlb5rU_pTmGhbj_Z0ziWSR7RHRacPwOZzj4f1XGl-1wbGKXjA8pTKzOrZjVGRmgKtByn2qp1ETdw6FjOVOujHaVbAdCeaem9dGJh3OqbPUibmoBPYPsRcpFLqJbkz_UBKIz77AXbr-NgQ_iB8TU5rPnNbbLFt9gK7TpOQi_kA3u5QAq0bMNovl6m-_6J5ufsUDqNCrBsB7VucJsH6OUgDQ3NebMSYZa2yn3hKcK3gf0FJE5x6jrkX7LB4ucAlK364ai1gIi6t7B7odfSiS8CzpF0S-xKqwG6wJoTuaU1IGQFFmdhrqP6DPGIjN63mJ25xL9Q",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/aae2e712-9382-488b-aa4b-5df161307f8c"
},
"update apikey" : {
"href" : "https://app.matatika.com/api/apikeys/aae2e712-9382-488b-aa4b-5df161307f8c"
},
"delete apikey" : {
"href" : "https://app.matatika.com/api/apikeys/aae2e712-9382-488b-aa4b-5df161307f8c"
},
"profile" : {
"href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
View an API key
GET
/api/apikeys/{apikey-id}
Returns the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
- The API key
{apikey-id}
must exist
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa' -i -X GET \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
API key with HAL links.
{
"id" : "94c6c71f-c994-46ca-aac6-724f42a514fa",
"created" : "2024-12-16T09:52:31.079446",
"lastModified" : "2024-12-16T09:52:31.079446",
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)",
"clientId" : "UVrfEjRD1VJchj5qGzN6fYiiLrYi4a9i",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"update apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"delete apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"profile" : {
"href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Initialise an API key
POST
/api/apikeys
Initialises a new API key.
Prerequisites
- The authenticated user must own a Matatika account
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/apikeys/"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("POST", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
API key with HAL links.
{
"id" : "94c6c71f-c994-46ca-aac6-724f42a514fa",
"created" : "2024-12-16T09:52:30.859035761",
"lastModified" : "2024-12-16T09:52:30.859036761",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"create apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
}
}
}
Create an API key
PUT
/api/apikeys/{apikey-id}
Creates the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
Request
Body
API key resource.
{
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)"
}
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa' -i -X PUT \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json' \
-d '{
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)"
}'
Python (requests
)
import requests
url = "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
data = {
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)"
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
201 Created
API key with HAL links.
{
"id" : "94c6c71f-c994-46ca-aac6-724f42a514fa",
"created" : "2024-12-16T09:52:31.079445754",
"lastModified" : "2024-12-16T09:52:31.079446154",
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512)",
"clientId" : "UVrfEjRD1VJchj5qGzN6fYiiLrYi4a9i",
"clientSecret" : "e-liqYnBtjVIv-ytzAVFiffOwGUh-1GQt580_W0QTHi8rzM8ZTQsysgVd1WQGENp",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"update apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"delete apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"profile" : {
"href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Update an API key
PUT
/api/apikeys/{apikey-id}
Updates the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
Request
Body
API key resource.
{
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512) (updated)"
}
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa' -i -X PUT \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json' \
-d '{
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512) (updated)"
}'
Python (requests
)
import requests
url = "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
data = {
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512) (updated)"
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
200 OK
API key with HAL links.
{
"id" : "94c6c71f-c994-46ca-aac6-724f42a514fa",
"created" : "2024-12-16T09:52:31.079446",
"lastModified" : "2024-12-16T09:52:32.808038447",
"name" : "SIT-generated api key (2024-12-16T09:52:30.957512) (updated)",
"clientId" : "UVrfEjRD1VJchj5qGzN6fYiiLrYi4a9i",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"update apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"delete apikey" : {
"href" : "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
},
"profile" : {
"href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Delete an API key
DELETE
/api/apikeys/{apikey-id}
Deletes the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
- The API key
{apikey-id}
must exist
Request
Example Snippets
cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa' -i -X DELETE \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/apikeys/94c6c71f-c994-46ca-aac6-724f42a514fa"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("DELETE", url, headers=headers)
print(response.text.encode('utf8'))
Response
204 No Content
No response body provided.