API-Key API
This page provides routes for managing api-keys. The following routes are available:
GET/api-key/user/:userIdRetrieve a list of API keys for a specific userGET/api-key/:apiKeyIdRetrieve a specific API key by IDGET/api-key/myRetrieve a list of API keys for the authenticated userPOST/api-keyCreate a new API keyDELETE/api-key/:apiKeyIdDelete a specific API key by ID
Retrieve API Keys By User ID
This endpoint retrieves API keys for a specific user.
GET https://nft-platform.azurewebsites.net/api/v1/api-keys/user/:userId
INFO
Authentication: Requires token for authentication.
Permissions: Requires USER or OWNER role with api_key_management and read permissions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | Yes | The ID of the user to retrieve API keys for |
Example
{}[
{
"_id": "67aaf3d7ac6656e91a4a9845",
"createdBy": "67a98689bc4810c0e57b07d7",
"expiresAt": "2025-03-08T00:00:00.000Z",
"key": <secret key>,
"orgId": "674ecdcc923de3913822c5fe",
"scopes": ["read"],
"createdAt": "2025-02-11T06:53:11.624Z",
"updatedAt": "2025-02-11T06:53:11.624Z",
"__v": 0,
"apiKey": <secret key>,
"id": "67aaf3d7ac6656e91a4a9845"
}
]HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve API Key by ID
This endpoint retrieves a specific API key by ID.
GET https://nft-platform.azurewebsites.net/api/v1/api-keys/:apiKeyId
INFO
Authentication: Requires token for authentication.
Permissions: Requires OWNER role with api_key_management and read permissions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKeyId | string | Yes | The ID of the api-key to retrieve |
Example
{}{
"_id": "673433b805edbee750b37795",
"createdBy": "671b8bad65b5bb889dd83c84",
"key": <secret key>,
"orgId": "671a3c8db86d5a1d46dff7ee",
"scopes": ["read"],
"createdAt": "2024-11-13T05:06:00.217Z",
"updatedAt": "2024-11-13T05:06:00.217Z",
"__v": 0,
"apiKey": <secret key>,
"id": "673433b805edbee750b37795"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve User API Keys
This endpoint retrieves API keys for the authenticated user.
GET https://nft-platform.azurewebsites.net/api/v1/api-keys/my
INFO
Authentication: Requires token for authentication.
Permissions: Requires USER role with api_key_management and read permissions.
Example
{}[
{
"_id": "673433b805edbee750b37795",
"createdBy": "671b8bad65b5bb889dd83c84",
"key": <secret key>,
"orgId": "671a3c8db86d5a1d46dff7ee",
"scopes": ["read"],
"createdAt": "2024-11-13T05:06:00.217Z",
"updatedAt": "2024-11-13T05:06:00.217Z",
"__v": 0,
"apiKey": <secret key>,
"id": "673433b805edbee750b37795"
}
]HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Create API Key
This endpoint creates a new API key.
POST https://nft-platform.azurewebsites.net/api/v1/api-keys
INFO
Authentication: Requires token for authentication.
Permissions: Requires USER or OWNER role with api_key_management and create permissions.
Parameters
None
Example
{
"expiresAT": "2025-01-01T00:00:00.000Z"
}{
"createdBy": "671b8bad65b5bb889dd83c84",
"key": <secret key>,
"orgId": "671a3c8db86d5a1d46dff7ee",
"scopes": ["read"],
"_id": "673433b805edbee750b37795",
"createdAt": "2024-11-13T05:06:00.217Z",
"updatedAt": "2024-11-13T05:06:00.217Z",
"__v": 0,
"apiKey": <secret key>,
"id": "673433b805edbee750b37795"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Delete API Key
This endpoint deletes a specific API key.
DELETE https://nft-platform.azurewebsites.net/api/v1/api-keys/:apiKeyId
INFO
Authentication: Requires token for authentication.
Permissions: Requires USER or OWNER role with api_key_management and delete permissions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKeyId | string | Yes | The ID of the api key to delete |
Example
{}{
"message": "Api key deleted successfully",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With a success message. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |