POST
/
users
/
{userId}
/
apikeys
curl --request POST \
  --url https://api.sulu.sh/v0/users/{userId}/apikeys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "expiresAt": "2023-11-07T05:31:56Z",
  "mode": "live",
  "organizationIds": [
    "<string>"
  ]
}'
{
  "key": "<string>",
  "principals": [
    {
      "id": "<string>",
      "organizationId": "<string>"
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

userId
string
required

Unique identifier for a user

Body

application/json

Response

201
application/json
API key created successfully

The response is of type object.