Create a project
Create a new project using a global API key.
Projects are the top-level containers in DevPayr. After creating a project, you can manage:
project domains
licenses
injectables
payment enforcement state (
has_paid)
Endpoint
POST /project
Full URL:
https://api.devpayr.dev/api/v1/projectAuthentication
β Required: API Key
Send your API key using:
X-API-KEY: <your_api_key>Important Rules
Only global API keys may create projects
If your API key is scoped to a specific project (project_id is set on the API key), DevPayr will reject the request.
Error (403)
Plan limits are enforced before validation
Project creation is limited by the subscription plan of the API key owner.
If you have reached your planβs maximum allowed projects, DevPayr blocks the request.
Error (403)
Request Body
Send a JSON request body.
Fields
name
string
β
Project name. Max length: 255.
slug
string
β
Optional custom slug. Must be alpha_dash, max 255, and unique across projects. If omitted, DevPayr generates one automatically.
description
string
β
Optional description. Max length: 1000.
default_redirect_url
string (url)
β
Optional redirect URL used by your SDK/app when access is blocked or a license is not valid.
webhook_url
string (url)
β
Optional webhook destination for project events (if enabled for the account).
webhook_secret
string
β
Optional secret used for webhook security/verification (if webhooks are enabled).
logo_url
string (url)
β
Optional logo URL for the project.
meta
object
β
Optional metadata object. Must be a valid JSON object.
has_paid
boolean
β
Optional payment flag for the project. Defaults to false if not provided.
Meta Field Notes
meta must be a JSON object.
β Valid:
Also supported: sending meta as a JSON string β DevPayr will attempt to decode it before validation.
If decoding fails or the value is not an object, validation will fail.
Custom error message
Example Request
Response
Success (201)
DevPayr returns a standard response envelope:
statusβ success indicatormessageβ human-readable success messagedataβ the created project objecterrorsβnullon success
Example Response
Project Object Returned
id
integer
Project ID
name
string
Project name
slug
string
Project slug
description
string | null
Optional description
default_redirect_url
string | null
Optional redirect destination
webhook_url
string | null
Optional webhook destination
logo_url
string | null
Optional logo URL
meta
object
Metadata payload
is_active
boolean
Whether the project is active
has_paid
boolean
Payment enforcement flag
created_at
string
ISO timestamp
updated_at
string
ISO timestamp
Validation Errors (422)
If validation fails, DevPayr returns a 422 response.
Common validation cases:
namemissing or too longslugnotalpha_dashor already takeninvalid URL fields (
default_redirect_url,webhook_url,logo_url)metais not an objecthas_paidis not a boolean
Notable custom validation messages
Slug already taken:
Meta not an object:
The full
422response may include anerrorsobject containing field-level details.
Errors
Missing API Key (401)
Invalid / Expired API Key (403)
Scoped API Key Not Allowed (403)
Plan Limit Reached (403)
Validation Error (422)
Rate Limited (429)
Last updated