Create a new API user

Creates an API user

POST /identity/apiusers

Request Body

Name Type Required Description

name

string

True

Arbitrary name of the API user, length 1-64

expirationYears

integer

True

Sets the expiration of the API user, possible values are 0 - never expires, 1 - one-year expiration, 2 - two years expiration, 3 - three years expiration

roles

string[]

True

List of Wenenu roles associated with the API user, possible values are 'WENENU_OWNER', 'WENENU_CONTRIBUTOR', 'WENENU_READER', 'WENENU_BILLING_ADMIN', 'WENENU_SERVICE_CONNECTOR_ADMIN', 'WENENU_API_USER_ADMIN', 'WENENU_TEST_AGENT_ADMIN'

Responses

Name Type Description

201 Created

ApiUser

The new API user object

Consumes

  • application/json

Produces

  • application/json

Security

Every request requires a JWT access token for authentication in the Authorisation HTTP header. Please see the API authentication page for details about how to get a JWT token.

Authorization: Bearer {JWT_TOKEN}

Roles

  • Wenenu Owner

  • Wenenu API User Administrator

Sample request

POST https://wenenu.com/identity/apiusers HTTP/1.1
Authorization: Bearer {jwt_token}
Content-type: application/json

Request body:

{
  "name": "API user 1",
  "expirationYears": 1,
  "roles": [
    "WENENU_SERVICE_CONNECTOR_ADMIN",
    "WENENU_TEST_AGENT_ADMIN"
  ]
}

Sample Response

Status code: 201 Created

{
  "id": "1c207ca9-6d7a-4d42-8527-47d4fb9a06c2",
  "name": "API user 1",
  "expiration": "2022-04-26",
  "tenantId": "108365366dc9-88be-4c42-8329-55808630",
  "roles": [
    "WENENU_SERVICE_CONNECTOR_ADMIN",
    "WENENU_TEST_AGENT_ADMIN"
  ],
  "secret": "rHn*****************************",
  "newSecret": "rHnT_(FmXG-UW3B)QrdHKngS3h$8NE!I",
}

Definitions

ApiUser

Name Type Description

id

string

Version 4 UUID of the API user

tenantId

string

Version 4 UUID of the Wenenu tenant of the API user

name

string

Arbitrary name of the API user, length 1-64

expiration

string

Date of the expiration in ISO 8601 format

roles

string[]

List of Wenenu roles associated with the API user

secret

string

Masked secret of the API user, only the first three letters are revealed

newSecret

string

The secret of the API user returned only in the response of an API user creation