Create an injectable
Create a new injectable under a project.
An injectable is a unit of payload DevPayr can later deliver to your SDK/runtime (for example: a script snippet, config JSON, or a file-based payload), based on your project rules.
Endpoint
POST /project/{project}/injectables
Full URL:
https://api.devpayr.dev/api/v1/project/{project}/injectablesAuthentication
β Required: API Key
X-API-KEY: <your_api_key>Content Type
This endpoint accepts multipart/form-data because you may optionally upload a file.
If
type = fileβ send a fileOtherwise β send content as text
Path Parameters
project
integer
Yes
The ID of the project to attach the injectable to.
Request Fields
Required fields (always)
type
string
Yes
The injectable type. See allowed values below.
mode
string
Yes
How the injectable should be applied. See allowed values below.
target_path
string
Yes
The destination path this injectable targets.
secret
string
Yes
A secret used to protect the injectable payload. Must be at least 8 characters.
only_if_paid
boolean
Yes
If true, the injectable should only apply when the project is marked as paid.
is_active
boolean
Yes
Whether this injectable is enabled.
Optional fields
title
string
No
Human-friendly name.
slug
string
No
Unique identifier within the project. If omitted, DevPayr generates one.
validate_endpoint
string (url)
No
Optional URL your SDK/runtime may call to check whether to apply the injectable.
Payload fields (choose one)
content
string
Yes
Required unless type = file
file
file (binary)
Yes
Required if type = file (max 5MB)
Allowed values
type allowed values
type allowed valuesfile, snippet, html, script, component, config, json, markdown, css, include, sdk_module, docs, template
mode allowed values
mode allowed valuesinject, write, replace, symlink, append, prepend, mount, inline_render, stream
Example Requests
Validation Rules
fileis required only whentype = file(max size 5MB).contentis required whentype != file.secretmust be at least 8 characters.slugmust be unique within the project.
Common Errors
Unauthorized / wrong project access (403)
Validation failed (422)
Example cases:
missing
contentfor non-file injectablesmissing
filefor file injectablesinvalid
typeormodefile too large
duplicate slug in the same project
Typical response:
Rate limited (429)
Last updated