Deploy a function
Changed onCreates and deploys a new function. The handler must be a single ESM module whose default export is an object with an async fetch(request, env) method (Workers-style). Primitive signs each delivery and forwards the Primitive-Signature header to the handler. Verify the raw request body with PRIMITIVE_WEBHOOK_SECRET before parsing JSON; after verification the request body parses to a webhook event whose event field is email.received for normal inbound mail, or a machine-mail type (email.bounced, email.tls_report, email.dmarc_report, email.dmarc_failure) for bounces and reports. Code is bundled before being uploaded; ship a single self-contained file rather than relying on external imports.
Code limits. code is capped at 1 MiB UTF-8. sourceMap (optional) is capped at 5 MiB UTF-8, stored with each deployment attempt, and sent to the runtime so stack traces can resolve to original source files.
Routing. On successful deploy, the function code is live in the runtime, but inbound mail will not reach it until at least one route is bound. Routes are managed from the Primitive dashboard. A deploy_status of deployed means the script is installed, not that the function is receiving mail. The internal runtime URL is not returned by the API and is not a customer-facing integration surface.
Secrets. New functions ship with the managed secrets (PRIMITIVE_WEBHOOK_SECRET, PRIMITIVE_API_KEY, PRIMITIVE_API_BASE_URL) already bound. Add user-set secrets via POST /functions/{id}/secrets; secret writes only land in the running handler on the next redeploy.
Request
- Base URLhttps://api.primitive.dev/v1
- URLhttps://api.primitive.dev/v1/functions
- AuthHTTP bearer
Headers
Optional client-supplied idempotency key. Retrying a request with the same key returns the original result instead of performing the action a second time; if omitted the server derives one from the canonical payload hash. Safe to retry network failures without duplicating side effects.
Request body
Response
Function created and deployed
Changes
- warning
added the new
access_mode_unavailableenum value to the/response property for the response status - warning
added the new
access_mode_unavailableenum value to the/response property for the response status - warning
added the new
access_mode_unavailableenum value to the/response property for the response status - warning
added the new
access_mode_unavailableenum value to the/response property for the response status - warning
added the new
access_mode_unavailableenum value to the/response property for the response status - warning
added the new
access_mode_unavailableenum value to the/response property for the response status - warning
added the new
builtin_roleenum value to the/response property for the response status - warning
added the new
builtin_roleenum value to the/response property for the response status - warning
added the new
builtin_roleenum value to the/response property for the response status - warning
added the new
builtin_roleenum value to the/response property for the response status - warning
added the new
builtin_roleenum value to the/response property for the response status - warning
added the new
builtin_roleenum value to the/response property for the response status - warning
added the new
cleanup_incompleteenum value to the/response property for the response status - warning
added the new
cleanup_incompleteenum value to the/response property for the response status - warning
added the new
cleanup_incompleteenum value to the/response property for the response status - warning
added the new
cleanup_incompleteenum value to the/response property for the response status - warning
added the new
cleanup_incompleteenum value to the/response property for the response status - warning
added the new
cleanup_incompleteenum value to the/response property for the response status - warning
added the new
cli_access_refusedenum value to the/response property for the response status - warning
added the new
cli_access_refusedenum value to the/response property for the response status - warning
added the new
cli_access_refusedenum value to the/response property for the response status - warning
added the new
cli_access_refusedenum value to the/response property for the response status - warning
added the new
cli_access_refusedenum value to the/response property for the response status - warning
added the new
cli_access_refusedenum value to the/response property for the response status - warning
added the new
confirmation_requiredenum value to the/response property for the response status - warning
added the new
confirmation_requiredenum value to the/response property for the response status - warning
added the new
confirmation_requiredenum value to the/response property for the response status - warning
added the new
confirmation_requiredenum value to the/response property for the response status - warning
added the new
confirmation_requiredenum value to the/response property for the response status - warning
added the new
confirmation_requiredenum value to the/response property for the response status - warning
added the new
connection_owner_address_requiredenum value to the/response property for the response status - warning
added the new
connection_owner_address_requiredenum value to the/response property for the response status - warning
added the new
connection_owner_address_requiredenum value to the/response property for the response status - warning
added the new
connection_owner_address_requiredenum value to the/response property for the response status - warning
added the new
connection_owner_address_requiredenum value to the/response property for the response status - warning
added the new
connection_owner_address_requiredenum value to the/response property for the response status - warning
added the new
email_rule_author_onlyenum value to the/response property for the response status - warning
added the new
email_rule_author_onlyenum value to the/response property for the response status - warning
added the new
email_rule_author_onlyenum value to the/response property for the response status - warning
added the new
email_rule_author_onlyenum value to the/response property for the response status - warning
added the new
email_rule_author_onlyenum value to the/response property for the response status - warning
added the new
email_rule_author_onlyenum value to the/response property for the response status - warning
added the new
email_rule_compiler_unavailableenum value to the/response property for the response status - warning
added the new
email_rule_compiler_unavailableenum value to the/response property for the response status - warning
added the new
email_rule_compiler_unavailableenum value to the/response property for the response status - warning
added the new
email_rule_compiler_unavailableenum value to the/response property for the response status - warning
added the new
email_rule_compiler_unavailableenum value to the/response property for the response status - warning
added the new
email_rule_compiler_unavailableenum value to the/response property for the response status - warning
added the new
email_rule_conflictenum value to the/response property for the response status - warning
added the new
email_rule_conflictenum value to the/response property for the response status - warning
added the new
email_rule_conflictenum value to the/response property for the response status - warning
added the new
email_rule_conflictenum value to the/response property for the response status - warning
added the new
email_rule_conflictenum value to the/response property for the response status - warning
added the new
email_rule_conflictenum value to the/response property for the response status - warning
added the new
email_rule_not_compiledenum value to the/response property for the response status - warning
added the new
email_rule_not_compiledenum value to the/response property for the response status - warning
added the new
email_rule_not_compiledenum value to the/response property for the response status - warning
added the new
email_rule_not_compiledenum value to the/response property for the response status - warning
added the new
email_rule_not_compiledenum value to the/response property for the response status - warning
added the new
email_rule_not_compiledenum value to the/response property for the response status - warning
added the new
grant_forbiddenenum value to the/response property for the response status - warning
added the new
grant_forbiddenenum value to the/response property for the response status - warning
added the new
grant_forbiddenenum value to the/response property for the response status - warning
added the new
grant_forbiddenenum value to the/response property for the response status - warning
added the new
grant_forbiddenenum value to the/response property for the response status - warning
added the new
grant_forbiddenenum value to the/response property for the response status - warning
added the new
keep_refusedenum value to the/response property for the response status - warning
added the new
keep_refusedenum value to the/response property for the response status - warning
added the new
keep_refusedenum value to the/response property for the response status - warning
added the new
keep_refusedenum value to the/response property for the response status - warning
added the new
keep_refusedenum value to the/response property for the response status - warning
added the new
keep_refusedenum value to the/response property for the response status - warning
added the new
last_ownerenum value to the/response property for the response status - warning
added the new
last_ownerenum value to the/response property for the response status - warning
added the new
last_ownerenum value to the/response property for the response status - warning
added the new
last_ownerenum value to the/response property for the response status - warning
added the new
last_ownerenum value to the/response property for the response status - warning
added the new
last_ownerenum value to the/response property for the response status - warning
added the new
mailbox_not_claimableenum value to the/response property for the response status - warning
added the new
mailbox_not_claimableenum value to the/response property for the response status - warning
added the new
mailbox_not_claimableenum value to the/response property for the response status - warning
added the new
mailbox_not_claimableenum value to the/response property for the response status - warning
added the new
mailbox_not_claimableenum value to the/response property for the response status - warning
added the new
mailbox_not_claimableenum value to the/response property for the response status - warning
added the new
mailbox_shared_with_othersenum value to the/response property for the response status - warning
added the new
mailbox_shared_with_othersenum value to the/response property for the response status - warning
added the new
mailbox_shared_with_othersenum value to the/response property for the response status - warning
added the new
mailbox_shared_with_othersenum value to the/response property for the response status - warning
added the new
mailbox_shared_with_othersenum value to the/response property for the response status - warning
added the new
mailbox_shared_with_othersenum value to the/response property for the response status - warning
added the new
member_address_reservedenum value to the/response property for the response status - warning
added the new
member_address_reservedenum value to the/response property for the response status - warning
added the new
member_address_reservedenum value to the/response property for the response status - warning
added the new
member_address_reservedenum value to the/response property for the response status - warning
added the new
member_address_reservedenum value to the/response property for the response status - warning
added the new
member_address_reservedenum value to the/response property for the response status - warning
added the new
plan_requiredenum value to the/response property for the response status - warning
added the new
plan_requiredenum value to the/response property for the response status - warning
added the new
plan_requiredenum value to the/response property for the response status - warning
added the new
plan_requiredenum value to the/response property for the response status - warning
added the new
plan_requiredenum value to the/response property for the response status - warning
added the new
plan_requiredenum value to the/response property for the response status - warning
added the new
redeploy_failedenum value to the/response property for the response status - warning
added the new
redeploy_failedenum value to the/response property for the response status - warning
added the new
redeploy_failedenum value to the/response property for the response status - warning
added the new
redeploy_failedenum value to the/response property for the response status - warning
added the new
redeploy_failedenum value to the/response property for the response status - warning
added the new
redeploy_failedenum value to the/response property for the response status - warning
added the new
removal_failedenum value to the/response property for the response status - warning
added the new
removal_failedenum value to the/response property for the response status - warning
added the new
removal_failedenum value to the/response property for the response status - warning
added the new
removal_failedenum value to the/response property for the response status - warning
added the new
removal_failedenum value to the/response property for the response status - warning
added the new
removal_failedenum value to the/response property for the response status - warning
added the new
removal_timeoutenum value to the/response property for the response status - warning
added the new
removal_timeoutenum value to the/response property for the response status - warning
added the new
removal_timeoutenum value to the/response property for the response status - warning
added the new
removal_timeoutenum value to the/response property for the response status - warning
added the new
removal_timeoutenum value to the/response property for the response status - warning
added the new
removal_timeoutenum value to the/response property for the response status - warning
added the new
role_assignedenum value to the/response property for the response status - warning
added the new
role_assignedenum value to the/response property for the response status - warning
added the new
role_assignedenum value to the/response property for the response status - warning
added the new
role_assignedenum value to the/response property for the response status - warning
added the new
role_assignedenum value to the/response property for the response status - warning
added the new
role_assignedenum value to the/response property for the response status - warning
added the new
role_assignment_unavailableenum value to the/response property for the response status - warning
added the new
role_assignment_unavailableenum value to the/response property for the response status - warning
added the new
role_assignment_unavailableenum value to the/response property for the response status - warning
added the new
role_assignment_unavailableenum value to the/response property for the response status - warning
added the new
role_assignment_unavailableenum value to the/response property for the response status - warning
added the new
role_assignment_unavailableenum value to the/response property for the response status - warning
added the new
role_key_takenenum value to the/response property for the response status - warning
added the new
role_key_takenenum value to the/response property for the response status - warning
added the new
role_key_takenenum value to the/response property for the response status - warning
added the new
role_key_takenenum value to the/response property for the response status - warning
added the new
role_key_takenenum value to the/response property for the response status - warning
added the new
role_key_takenenum value to the/response property for the response status - warning
added the new
rotation_in_progressenum value to the/response property for the response status - warning
added the new
rotation_in_progressenum value to the/response property for the response status - warning
added the new
rotation_in_progressenum value to the/response property for the response status - warning
added the new
rotation_in_progressenum value to the/response property for the response status - warning
added the new
rotation_in_progressenum value to the/response property for the response status - warning
added the new
rotation_in_progressenum value to the/response property for the response status - warning
added the new
rotation_incompleteenum value to the/response property for the response status - warning
added the new
rotation_incompleteenum value to the/response property for the response status - warning
added the new
rotation_incompleteenum value to the/response property for the response status - warning
added the new
rotation_incompleteenum value to the/response property for the response status - warning
added the new
rotation_incompleteenum value to the/response property for the response status - warning
added the new
rotation_incompleteenum value to the/response property for the response status - warning
added the new
step_up_invalidenum value to the/response property for the response status - warning
added the new
step_up_invalidenum value to the/response property for the response status - warning
added the new
step_up_invalidenum value to the/response property for the response status - warning
added the new
step_up_invalidenum value to the/response property for the response status - warning
added the new
step_up_invalidenum value to the/response property for the response status - warning
added the new
step_up_invalidenum value to the/response property for the response status - warning
added the new
step_up_not_acceptedenum value to the/response property for the response status - warning
added the new
step_up_not_acceptedenum value to the/response property for the response status - warning
added the new
step_up_not_acceptedenum value to the/response property for the response status - warning
added the new
step_up_not_acceptedenum value to the/response property for the response status - warning
added the new
step_up_not_acceptedenum value to the/response property for the response status - warning
added the new
step_up_not_acceptedenum value to the/response property for the response status - warning
added the new
step_up_refusedenum value to the/response property for the response status - warning
added the new
step_up_refusedenum value to the/response property for the response status - warning
added the new
step_up_refusedenum value to the/response property for the response status - warning
added the new
step_up_refusedenum value to the/response property for the response status - warning
added the new
step_up_refusedenum value to the/response property for the response status - warning
added the new
step_up_refusedenum value to the/response property for the response status - warning
added the new
step_up_requiredenum value to the/response property for the response status - warning
added the new
step_up_requiredenum value to the/response property for the response status - warning
added the new
step_up_requiredenum value to the/response property for the response status - warning
added the new
step_up_requiredenum value to the/response property for the response status - warning
added the new
step_up_requiredenum value to the/response property for the response status - warning
added the new
step_up_requiredenum value to the/response property for the response status - warning
added the new
template_roleenum value to the/response property for the response status - warning
added the new
template_roleenum value to the/response property for the response status - warning
added the new
template_roleenum value to the/response property for the response status - warning
added the new
template_roleenum value to the/response property for the response status - warning
added the new
template_roleenum value to the/response property for the response status - warning
added the new
template_roleenum value to the/response property for the response status - warning
added the new
upstream_unavailableenum value to the/response property for the response status - warning
added the new
upstream_unavailableenum value to the/response property for the response status - warning
added the new
upstream_unavailableenum value to the/response property for the response status - warning
added the new
upstream_unavailableenum value to the/response property for the response status - warning
added the new
upstream_unavailableenum value to the/response property for the response status - warning
added the new
upstream_unavailableenum value to the/response property for the response status
This list may be incomplete.
- warning
- warning
added the new
agent_changedenum value to the/response property for the response status - warning
added the new
agent_changedenum value to the/response property for the response status - warning
added the new
agent_changedenum value to the/response property for the response status - warning
added the new
agent_changedenum value to the/response property for the response status - warning
added the new
agent_changedenum value to the/response property for the response status - warning
added the new
agent_changedenum value to the/response property for the response status - warning
added the new
agent_limitenum value to the/response property for the response status - warning
added the new
agent_limitenum value to the/response property for the response status - warning
added the new
agent_limitenum value to the/response property for the response status - warning
added the new
agent_limitenum value to the/response property for the response status - warning
added the new
agent_limitenum value to the/response property for the response status - warning
added the new
agent_limitenum value to the/response property for the response status - warning
added the new
already_memberenum value to the/response property for the response status - warning
added the new
already_memberenum value to the/response property for the response status - warning
added the new
already_memberenum value to the/response property for the response status - warning
added the new
already_memberenum value to the/response property for the response status - warning
added the new
already_memberenum value to the/response property for the response status - warning
added the new
already_memberenum value to the/response property for the response status - warning
added the new
directory_limitenum value to the/response property for the response status - warning
added the new
directory_limitenum value to the/response property for the response status - warning
added the new
directory_limitenum value to the/response property for the response status - warning
added the new
directory_limitenum value to the/response property for the response status - warning
added the new
directory_limitenum value to the/response property for the response status - warning
added the new
directory_limitenum value to the/response property for the response status - warning
added the new
invitation_acceptedenum value to the/response property for the response status - warning
added the new
invitation_acceptedenum value to the/response property for the response status - warning
added the new
invitation_acceptedenum value to the/response property for the response status - warning
added the new
invitation_acceptedenum value to the/response property for the response status - warning
added the new
invitation_acceptedenum value to the/response property for the response status - warning
added the new
invitation_acceptedenum value to the/response property for the response status - warning
added the new
invitation_changedenum value to the/response property for the response status - warning
added the new
invitation_changedenum value to the/response property for the response status - warning
added the new
invitation_changedenum value to the/response property for the response status - warning
added the new
invitation_changedenum value to the/response property for the response status - warning
added the new
invitation_changedenum value to the/response property for the response status - warning
added the new
invitation_changedenum value to the/response property for the response status - warning
added the new
invitation_pendingenum value to the/response property for the response status - warning
added the new
invitation_pendingenum value to the/response property for the response status - warning
added the new
invitation_pendingenum value to the/response property for the response status - warning
added the new
invitation_pendingenum value to the/response property for the response status - warning
added the new
invitation_pendingenum value to the/response property for the response status - warning
added the new
invitation_pendingenum value to the/response property for the response status - warning
added the new
invitation_sendingenum value to the/response property for the response status - warning
added the new
invitation_sendingenum value to the/response property for the response status - warning
added the new
invitation_sendingenum value to the/response property for the response status - warning
added the new
invitation_sendingenum value to the/response property for the response status - warning
added the new
invitation_sendingenum value to the/response property for the response status - warning
added the new
invitation_sendingenum value to the/response property for the response status - warning
added the new
invitation_unconfirmedenum value to the/response property for the response status - warning
added the new
invitation_unconfirmedenum value to the/response property for the response status - warning
added the new
invitation_unconfirmedenum value to the/response property for the response status - warning
added the new
invitation_unconfirmedenum value to the/response property for the response status - warning
added the new
invitation_unconfirmedenum value to the/response property for the response status - warning
added the new
invitation_unconfirmedenum value to the/response property for the response status - warning
added the new
invitations_pendingenum value to the/response property for the response status - warning
added the new
invitations_pendingenum value to the/response property for the response status - warning
added the new
invitations_pendingenum value to the/response property for the response status - warning
added the new
invitations_pendingenum value to the/response property for the response status - warning
added the new
invitations_pendingenum value to the/response property for the response status - warning
added the new
invitations_pendingenum value to the/response property for the response status - warning
added the new
member_changedenum value to the/response property for the response status - warning
added the new
member_changedenum value to the/response property for the response status - warning
added the new
member_changedenum value to the/response property for the response status - warning
added the new
member_changedenum value to the/response property for the response status - warning
added the new
member_changedenum value to the/response property for the response status - warning
added the new
member_changedenum value to the/response property for the response status - warning
added the new
project_changedenum value to the/response property for the response status - warning
added the new
project_changedenum value to the/response property for the response status - warning
added the new
project_changedenum value to the/response property for the response status - warning
added the new
project_changedenum value to the/response property for the response status - warning
added the new
project_changedenum value to the/response property for the response status - warning
added the new
project_changedenum value to the/response property for the response status - warning
added the new
recipient_changedenum value to the/response property for the response status - warning
added the new
recipient_changedenum value to the/response property for the response status - warning
added the new
recipient_changedenum value to the/response property for the response status - warning
added the new
recipient_changedenum value to the/response property for the response status - warning
added the new
recipient_changedenum value to the/response property for the response status - warning
added the new
recipient_changedenum value to the/response property for the response status
- warning