Skip to main content Link Menu Expand (external link) Document Search Copy Copied

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" : "276beb4d-1dfa-468b-91d8-8ecfc1840571",
  "created" : "2024-10-24T15:15:16.510955",
  "lastModified" : "2024-10-24T15:15:16.510956",
  "name" : "SIT-generated api key (2024-10-24T16:15:16.420146)",
  "clientId" : "V3hJ1BNwWUald2dp9zGLfg9askUqYcal",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "update apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "delete apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "profile" : {
      "href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
    }
  }
}

Requests


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" : "276beb4d-1dfa-468b-91d8-8ecfc1840571",
      "created" : "2024-10-24T15:15:16.510955",
      "lastModified" : "2024-10-24T15:15:16.510956",
      "name" : "SIT-generated api key (2024-10-24T16:15:16.420146)",
      "clientId" : "V3hJ1BNwWUald2dp9zGLfg9askUqYcal",
      "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
        },
        "update apikey" : {
          "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
        },
        "delete apikey" : {
          "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
        },
        "profile" : {
          "href" : "https://app.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
        }
      }
    }, {
      "id" : "74af9321-0f7c-4610-b36b-dfb5623a4412",
      "created" : "2024-10-24T15:15:14.427405",
      "lastModified" : "2024-10-24T15:15:14.427406",
      "name" : "default",
      "clientId" : "V9PHqnrmeNZno4ErBG0J35s3RWkgpgWs",
      "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
      "accessToken" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJFRkNRamczTlRRMk16QTROalpHT0RjNFFUWkJOemMyTkRGR1FUSkVOVEEyUkRkR1JrSkRPQSJ9.eyJpc3MiOiJodHRwczovL2lkZW50aXR5Lm1hdGF0aWthLmNvbS8iLCJzdWIiOiJWOVBIcW5ybWVOWm5vNEVyQkcwSjM1czNSV2tncGdXc0BjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9hcHAubWF0YXRpa2EuY29tL2FwaSIsImlhdCI6MTcyOTc4MjkxNSwiZXhwIjoxNzI5ODY5MzE1LCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJhenAiOiJWOVBIcW5ybWVOWm5vNEVyQkcwSjM1czNSV2tncGdXcyJ9.kGwkNk0n2kfzHXX3-RoR-eIKSZt_eb_t3Iy9lT2xf117YcbW04LYBEp6O4tZzMpFwORtmRxB6LPqGm8z1rVfbXYPgXDbWED_juqCEF17inVQB8JwinmD09-3osCxmmqudXgZC_rJksn-etbL_lfvvaNXvT_X1mQcxAbcq9cvGynH4uh4It7t2njhIjTZhJjKE_tJaIIQuGxVQdUsAtZoj7eRTL9SfDu-As7yiNDmSDktWPDqEe6-pNplDL2Ncj9TDuivj6F0_lFzDOnpnbXmANiEGjazA2748x3XS8Km69qjuqHc5ufDbLP1M1H_m2anGnVlqxWMe40n8pNRISNrwg",
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/apikeys/74af9321-0f7c-4610-b36b-dfb5623a4412"
        },
        "update apikey" : {
          "href" : "https://app.matatika.com/api/apikeys/74af9321-0f7c-4610-b36b-dfb5623a4412"
        },
        "delete apikey" : {
          "href" : "https://app.matatika.com/api/apikeys/74af9321-0f7c-4610-b36b-dfb5623a4412"
        },
        "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/276beb4d-1dfa-468b-91d8-8ecfc1840571' -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/276beb4d-1dfa-468b-91d8-8ecfc1840571"

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" : "276beb4d-1dfa-468b-91d8-8ecfc1840571",
  "created" : "2024-10-24T15:15:16.510955",
  "lastModified" : "2024-10-24T15:15:16.510956",
  "name" : "SIT-generated api key (2024-10-24T16:15:16.420146)",
  "clientId" : "V3hJ1BNwWUald2dp9zGLfg9askUqYcal",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "update apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "delete apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "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" : "276beb4d-1dfa-468b-91d8-8ecfc1840571",
  "created" : "2024-10-24T15:15:16.34724088",
  "lastModified" : "2024-10-24T15:15:16.34724158",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "create apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    }
  }
}

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-10-24T16:15:16.420146)"
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571' -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-10-24T16:15:16.420146)"
}'

Python (requests)

import requests

url = "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"

data = {
  "name" : "SIT-generated api key (2024-10-24T16:15:16.420146)"
}
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" : "276beb4d-1dfa-468b-91d8-8ecfc1840571",
  "created" : "2024-10-24T15:15:16.510955237",
  "lastModified" : "2024-10-24T15:15:16.510955637",
  "name" : "SIT-generated api key (2024-10-24T16:15:16.420146)",
  "clientId" : "V3hJ1BNwWUald2dp9zGLfg9askUqYcal",
  "clientSecret" : "CKZk_4v1NMFLXXVWVyMSVniJGye6i_HS2lkvT9eORiX3Hurye5cRVkZVPT-zWKXn",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "update apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "delete apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "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-10-24T16:15:16.420146) (updated)"
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571' -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-10-24T16:15:16.420146) (updated)"
}'

Python (requests)

import requests

url = "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"

data = {
  "name" : "SIT-generated api key (2024-10-24T16:15:16.420146) (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" : "276beb4d-1dfa-468b-91d8-8ecfc1840571",
  "created" : "2024-10-24T15:15:16.510955",
  "lastModified" : "2024-10-24T15:15:18.137926611",
  "name" : "SIT-generated api key (2024-10-24T16:15:16.420146) (updated)",
  "clientId" : "V3hJ1BNwWUald2dp9zGLfg9askUqYcal",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "update apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "delete apikey" : {
      "href" : "https://app.matatika.com/api/apikeys/276beb4d-1dfa-468b-91d8-8ecfc1840571"
    },
    "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/276beb4d-1dfa-468b-91d8-8ecfc1840571' -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/276beb4d-1dfa-468b-91d8-8ecfc1840571"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("DELETE", url, headers=headers)

print(response.text.encode('utf8'))

Response

204 No Content

No response body provided.