API key
Allows you to acquire API keys for users via an authenticated endpoint.
Retrieve an API key for a specific user. This endpoint needs to be called with an API key with sufficient permissions for the requested user API key (e.g. admin of the organization).
Request
Endpoint
POST /v1/users/{uuid}/apikeys
Path Parameters
Name | Type | Description |
---|---|---|
uuid required | uuid | Unique identifier for the user |
JSON Body Parameters
Name | Type | Description |
---|---|---|
description required | string | Description of the API key. Example: MDM user provisioning key |
expiresAt optional | ISO 8601 datetime , null | Expiration time for the api key in full ISO 8601 datetime format (e.g., 2024-06-24T15:00:00.000Z. If null is passed, the API key will never expire. |
Response
HTTP status code
201
Body
{
"status": "ok",
"meta": {
"type": "item",
"url": "http:\/\/api.luscii.com\/v1\/users\/{uuid}\/apikeys",
"version": "2.0"
},
"error": [],
"pagination": [],
"data": {
"apiKey": "{api_key}",
"expiration": "2024-01-01T00:00:00Z",
"description": "{description}"
},
"_links": []
}
Example
POST /v1/users/13962fbc-bd11-4b17-a515-de2aa92c6364/apikeys HTTP/1.1
Authorization: Bearer <api-key>
Host: api.luscii.com
Content-Type: application/json
Content-Length: 34
{"description":"Test description"}
HTTP/1.1 201 Created
Date: Mon, 08 Apr 2024 14:53:29 GMT
Content-Type: application/json
{"status":"ok","meta":{"type":"item","url":"http:\/\/api.luscii.com\/v1\/users\/apikeys"
,"version":"2.0"},"error":[],"pagination":[],"data":{"apiKey":"<api_key>","expiration":"
2024-07-07T12:34:56Z","description":"<description>"},"_links":[]}
Updated about 1 month ago