Create a license
Issue a new license key for a project. This endpoint creates a new license and returns the license key you will share with your customer or SDK user.
Endpoint
POST /project/{project}/licenses
Full URL:
https://api.devpayr.dev/api/v1/project/{project}/licensesAuthentication
β Required: API Key
Send your API key using:
X-API-KEY: <your_api_key>Path Parameters
project
integer
Yes
The ID of the project to issue the license for.
Request Format
Content-Type:
application/jsonAccept:
application/json
Request Body
Required Fields
title
string
β
A human-friendly name for the license (must be unique within the project).
Optional Fields
domain_id
integer | null
No
Attach this license to a specific project domain (domain must already exist on the project).
expires_at
string | null
No
Expiration date/time (must be a future date).
max_domains
integer | null
No
Maximum number of domains allowed for this license.
max_subdomains_per_domain
integer | null
No
Maximum number of subdomains allowed per base domain.
max_usage_per_day
integer | null
No
Maximum daily usage allowed for this license.
allowed_ips
string | null
No
Comma-separated IPs allowed to use this license. Example: "127.0.0.1, 102.90.101.2"
allowed_countries
string | null
No
Comma-separated 2-letter country codes allowed. Example: "NG, US, GB"
is_test_license
boolean
No
Marks the license as a test license.
allow_configs
boolean
No
Allows the license to accept configuration options at runtime
If you donβt provide optional fields, DevPayr will apply safe defaults based on your account configuration.
Example Request
Response
Success (201)
Returns the newly created license. The license key you should use/share is:
β
uuid
Example Response
Validation Rules
title
titlerequired
max length: 255
must be unique within the project
domain_id
domain_idmust reference an existing project domain
if invalid:
expires_at
expires_atmust be a valid date
must be in the future:
Limits
These must be integers and must be 0 or greater:
max_domainsmax_subdomains_per_domainmax_usage_per_day
Errors
Missing API Key (401)
Invalid / Expired API Key (403)
Not allowed / plan restriction (403)
Or (project mismatch / ownership):
Validation failed (422)
Example:
Project Not Found (404)
Rate Limited (429)
Last updated