Skip to main content
POST
/
api-keys
Create a new API key
curl --request POST \
  --url https://api.wavix.com/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "label": "Production API Key",
  "is_active": true,
  "is_restriction": true,
  "permitted_ips": [
    "192.168.1.1",
    "10.0.0.1"
  ]
}
'
{
  "id": 123,
  "label": "Production API Key",
  "value": "abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
  "is_active": true,
  "is_restriction": true,
  "permitted_ips": [
    "192.168.1.1",
    "10.0.0.1"
  ],
  "created_at": "2024-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

Bearer token using appid (Authorization: Bearer )

Body

application/json
label
string

User-defined label for the API key

is_active
boolean
default:true

Whether the API key should be active upon creation

Example:

true

is_restriction
boolean
default:false

Whether to enable IP restrictions for this API key. When enabled, only requests from IP addresses listed in permitted_ips will be allowed.

Example:

true

permitted_ips
string[]

List of IP addresses from which this API key can be used. Each IP address must be in valid IPv4 format. Required if is_restriction is true.

Example:
["192.168.1.1", "10.0.0.1"]

Response

The API key was created successfully.

id
integer

Unique identifier of the API key

Example:

123

label
string

User-defined label for the API key

Example:

"Production API Key"

value
string

The API key value used for authentication

Example:

"abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"

is_active
boolean

Indicates if the API key is currently active

Example:

true

is_restriction
boolean

Indicates if IP restrictions are enabled for this API key. When enabled, the API key will only work from the IP addresses listed in permitted_ips.

Example:

true

permitted_ips
string[]

List of IP addresses from which this API key can be used. Empty array means no IP restrictions (if is_restriction is false) or all IPs are restricted (if is_restriction is true).

Example:
["192.168.1.1", "10.0.0.1"]
created_at
string<date-time>

Date and time when the API key was created

Example:

"2024-01-15T10:30:00Z"