Skip to main content
POST
/
api
/
auth
/
api-keys
Create a new API key
curl --request POST \
  --url https://my.momanic.com/api/auth/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "expiresInDays": 1825
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "keyPreview": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "lastUsedAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z",
  "revokedAt": "2023-11-07T05:31:56Z",
  "state": "active",
  "apiKey": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required
Required string length: 1 - 64
expiresInDays
integer
Required range: 1 <= x <= 3650

Response

201 - application/json

API key created

id
string<uuid>
name
string
keyPreview
string
createdAt
string<date-time> | null
lastUsedAt
string<date-time> | null
expiresAt
string<date-time> | null
revokedAt
string<date-time> | null
state
enum<string>
Available options:
active,
expired,
revoked
apiKey
string

Returned only at creation time.