Public Web Endpoints
Expose a function as a public HTTPS URL for webhooks and third-party callers.
By default a function is invoked with a project API key, which keeps it private to your project. A public web endpoint opts a function into a URL that anyone on the internet can call without a project key — the right shape for webhooks (GitHub, Stripe, and the like), browser callers, and third-party integrations that can't hold your API key. You enable it per function, and can optionally protect it with a per-function bearer token so only callers who know the token can invoke it.
Enabling a public endpoint
Turn on the public endpoint with set_public. When you enable it with a token requirement, Daytona mints a bearer token and returns it once — store it, because it isn't retrievable again. Without a token requirement, the endpoint is open to anyone who knows the URL.
The response reports the public url, whether it requires_token, and the token (present only when you enabled the token requirement). To disable the endpoint again, call with enabled: false.
Calling the public URL
A public endpoint is invoked at POST https://api.rl.trydaytona.com/fn/:project/:name — with no project API key. If the endpoint requires a token, the caller passes it as a bearer token. The request body is forwarded to the handler as POST /, and the handler's response comes back, exactly like a keyed invoke.
If the endpoint has no token requirement, omit the Authorization header entirely. A wrong or missing token when one is required is rejected, and a function that isn't public returns 404 on the public host — its existence is never revealed there.
Security
A public endpoint exposes your function to the entire internet, so treat it accordingly. Require a token for anything that isn't meant to be world-callable, and rotate it by disabling and re-enabling the endpoint. Keep the handler defensive regardless: validate and authenticate payloads (for webhooks, verify the provider's signature), and don't trust the request body. Public invocations run through the same managed instances, timeouts, and scaling as keyed invocations.
For the full request and response shapes, see the Functions API reference.