API keys
Generate AIOZ Stream API keys
This endpoint is used to programmatically create AIOZ Stream API keys. When generating new keys, specific ttl(time to live) can be implemented.
Make sure to record the API Secret as they will not be accessible again.
The request body when generating a AIOZ Stream API key will look like this:
{
"api_key_name": "api key name", // your api key name.
"ttl": "1100000", // Time in seconds that the token will be active. Max 2147483647
"type": "full_access" // full_access or only_upload
}Notice the api_key_name is required. And type of api key is full_access or
only_upload. With full_access you can do all the actions with the api key.
With only_upload you can only upload video to AIOZ Stream.
For example, this would be a full body for AIOZ Stream api key generation:
{
"status": "success",
"data": {
"api_key": {
"id": "string",
"name": "api key name",
"public_key": "akFOMmtYTVlsWHhwUG02ZXJQemlrVDFnS0pvQ3dLYlI=",
"ttl": "100000000",
"secret": "cVZ3M05uVGdPb1UycXA1NmxIWjA2OWZoUWRacmRiYm94Ykl3",
"truncated_secret": "cVZ...kl3",
"created_at": "2024-09-09T04:15:07.522292865Z",
"updated_at": "2024-09-09T04:15:07.52229292Z",
"expired_at": "2027-11-10T14:01:47.522292965Z",
"type": "full_access"
}
}
}Headers
Body
Response
curl --location 'https://api.aiozstream.network/api/api_keys' \
--header 'Authorization': 'Bearer your_access_token_here' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"api_key_name": "api key name",
"ttl": "100000000",
"type": "full_access"
}'List API keys
This API allows you to retrieve a list of API keys associated with the authenticated user.
Query
Headers
Response
curl --location 'https://api.aiozstream.network/api/api_keys?search=name&limit=5&offset=1&sort_by=created_at&order_by=asc' \
--header 'Authorization: Bearer your_access_token_here' \
--header 'accept: application/json' \Delete API key
This API allows you to delete an API key associated with the authenticated user.
Parameters
Headers
Response
curl --location --request DELETE 'https://api.aiozstream.network/api/api_keys/api_key_id' \
--header 'Authorization: Bearer your_access_token_here' \
--header 'accept: application/json'Update API key
This API allows you to update an API key associated with the authenticated user.
Parameters
Headers
Body
Response
curl --location --request PATCH 'https://api.aiozstream.network/api/api_keys/api_key_id' \
--header 'Authorization: Bearer your_access_token_here' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"api_key_name": "update name"
}'