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/project

Authentication

βœ… 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

Field
Type
Required
Description

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 indicator

  • message β†’ human-readable success message

  • data β†’ the created project object

  • errors β†’ null on success

Example Response

Project Object Returned

Field
Type
Description

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:

  • name missing or too long

  • slug not alpha_dash or already taken

  • invalid URL fields (default_redirect_url, webhook_url, logo_url)

  • meta is not an object

  • has_paid is not a boolean

Notable custom validation messages

Slug already taken:

Meta not an object:

The full 422 response may include an errors object 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