Generate/Update User's API Key

Generate the first API key of a specific user or update it.

โš ๏ธ

When updating an API key, the previous one is revoked.

Step 1. Fetch users' ID

URL

Required rights: admin, accountManage or usersManage

To retrieve all the users of your NFT Management Platform and their information, use /users.

GET - https://{{nmpUrl}}/users

๐Ÿ’ก

The user's userId will allow you to generate or update the API key.

Return Payload

Your users' information is returned.

[
    {
        "_id": "605c9a833ad5c229e7267bd",
        "profile": "admin",
        "email": "[email protected]",
        "userId": "QMQP2yTFcQaszbyUdGV4mJcKP",
        "deleted": false,
        "__v": 0,
        "auth0Id": "email|611a2dcad1ce9f9dc8",
        "apiKey": "...",
        "id": "605c9a833ad5c229e7267bd"
    },
    {
        "_id": "612f6a6bc9b767880ccd46",
        "email": "[email protected]",
        "profile": "admin",
        "userId": "email|612f6a6bd1ce9f9dc8",
        "auth0Id": "email|612f6a6bd1ce9f9dc8",
        "deleted": true,
        "__v": 0,
        "id": "612f6a6bc9b767880ccd46"
    },
    {
        "_id": "61375e88f103e0904b517",
        "email": "[email protected]",
        "profile": "admin",
        "userId": "423ce7d5-eb30-4b04-9d73-d4b4aed",
        "auth0Id": "email|61375e88d1ce9f9dc881",
        "deleted": true,
        "__v": 0,
        "id": "61375e88f103e0904b517"
    }
]

Step 2. Generate or update API key

URL

Required rights: admin, accountManage or usersManage

To generate or update a user's API key, use the /users/:userID/apiKey.

POST - https://{{nmpUrl}}/users/:userID/apiKey
InputMandatoryTypeDescription
userIDโœ…StringIdentification of the NMP user's account.

Return Payload

Statut CodeSuccessDescription
200trueThe API Key is returned.
{
    "apiKey": "4fb34d26-e20f-47c8-9757-ab7ca68f3..."
}

Errors

Statut CodeSuccessDescription
401falseUnauthorized: You may not have the required permissions.
500falseYour userID may be wrong or does not exist.
{
    "message": "Unauthorized"
}
{
    "message": "User not found"
}