Claim deployments (temporary accounts)·续
Then send the proof-of-work solution with the required policy fields:
curl "https://api.cloudflare.com/client/v4/provisioning/previews" \
-X POST \
-H "Content-Type: application/json" \
--data '{
"termsOfService": "https://www.cloudflare.com/terms/",
"privacyPolicy": "https://www.cloudflare.com/privacypolicy/",
"acceptTermsOfService": "yes",
"challengeToken": "<CHALLENGE_TOKEN>",
"solution": {
"checkpoints": "<BASE64_CHECKPOINTS>"
}
}'
The response includes temporary credentials and a claim URL:
{
"success": true,
"result": {
"account": {
"id": "<TEMPORARY_ACCOUNT_ID>",
"name": "<TEMPORARY_ACCOUNT_NAME>",
"type": "standard",
"apiToken": "<TEMPORARY_ACCOUNT_API_TOKEN>",
"tokenId": "<TEMPORARY_TOKEN_ID>",
"expiresAt": "<ACCOUNT_EXPIRES_AT>"
},
"claim": {
"token": "<CLAIM_TOKEN>",
"url": "https://dash.cloudflare.com/claim-preview?claimToken=<CLAIM_TOKEN>",
"expiresAt": "<CLAIM_EXPIRES_AT>"
}
},
"errors": [],
"messages": []
}
Before using the response, confirm that success is true. Verify that account.id, account.apiToken, account.expiresAt, claim.url, and claim.expiresAt are present.
Deploy supported resources
Use account.id and account.apiToken with supported Cloudflare API endpoints. Use temporary values only with supported resource operations.
Temporary account tokens do not grant every permanent-account API permission. Unsupported operations return an authorization error.
The following examples upload and deploy a Worker with the Workers Script Upload API, then retrieve the account's workers.dev subdomain.
curl "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/workers/scripts/$SCRIPT_NAME" \
-X PUT \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-F 'metadata={"main_module":"worker.mjs","compatibility_date":"<YYYY-MM-DD>"};type=application/json' \
-F 'worker.mjs=@worker.mjs;type=application/javascript+module'
Call the Get Subdomain endpoint with the temporary credentials:
curl "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/workers/subdomain" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
For a script available on workers.dev, combine result.subdomain with the script name to create the deployment URL: https://<SCRIPT_NAME>.<SUBDOMAIN>.workers.dev.
Use the Cloudflare TypeScript SDK ↗︎ for supported resource operations after provisioning the temporary account:
import Cloudflare from "cloudflare";
export async function deployWorker(
accountId: string,
apiToken: string,
scriptName: string,
compatibilityDate: string,
scriptContent: string,
) {
const client = new Cloudflare({ apiToken });
const workerModule = new File([scriptContent], "worker.mjs", {
type: "application/javascript+module",
});
await client.workers.scripts.update(scriptName, {
account_id: accountId,
metadata: {
main_module: "worker.mjs",
compatibility_date: compatibilityDate,
},
files: [workerModule],
});
const { subdomain } = await client.workers.subdomains.get({
account_id: accountId,
});
return `https://${scriptName}.${subdomain}.workers.dev`;
}
Provide the deployment URL and claim.url to the intended user.
Claim the account
The intended user must complete the claim within 60 minutes. Opening the claim URL before the deadline is not enough.
They open the URL, sign in to Cloudflare or create an account, then complete the dashboard prompts.
If the user does not complete the claim, Cloudflare deletes the account and its resources.
With Wrangler, rerun wrangler deploy --temporary if the temporary credentials or claim URL expire. Wrangler provisions a new account and prints a new claim URL.
For REST integrations, request a new challenge and account if account.expiresAt or claim.expiresAt passes before the claim.
After the claim, the Worker and supported resources remain in the claimed account.
To continue with Wrangler, run wrangler login, then deploy without --temporary. Claiming does not grant the platform permanent access to the account.
For later deployments, connect the claimed account through your normal authenticated flow, such as a Cloudflare OAuth client.
Supported resources
The following table summarizes supported capabilities and limits. Temporary credentials do not grant every operation for these resources.
| Supported product or resource | Supported capability or limit |
|---|---|
| Workers | Deployments on workers.dev |
| Workers Static Assets | Up to 1,000 files, with each asset up to 5 MiB |
| Workers KV | Create, list, rename, and delete namespaces; put, get, list, and delete keys; bulk put, get, and delete |
| D1 | One database, with up to 100 MB per database and 100 MB total |
| Durable Objects | Deploy Workers with Durable Object bindings and migrations |
| Hyperdrive | Up to two database configurations and 10 connections |
| Queues | Up to 10 queues |
| mTLS and CA certificates | wrangler cert upload, list, and delete operations |
Security and limits
Protect temporary values
account.apiTokenauthorizes supported resource operations. Never expose it in browser responses or client-side code.- Treat
claim.urllike a bearer credential. Anyone with the URL can claim ownership of the temporary account. - Store both values only in backend storage or server-side session storage scoped to the intended user. Deliver
claim.urlonly to that user. - Exclude both values from logs, analytics, and support telemetry. Delete stored copies when they are no longer needed and no later than either returned expiration time.
Limits
- Cloudflare requires a proof-of-work check before creating an account. Wrangler handles the check, while REST integrations must submit a solution.
- Cloudflare rate limits temporary account creation. Wait before retrying, or authenticate with a permanent account.
--temporarysupports unauthenticated use only. Existing OAuth, API token, or global API key credentials cause an error.--temporaryis not a global flag. Only commands that support temporary credentials include it.- Temporary account provisioning is available only through the default public API endpoint. It is unavailable through the FedRAMP High API endpoint.
- Cloudflare may reject requests that fail additional abuse-prevention checks.
Related resources
wrangler deploy
Review the full command reference for deploying Workers.
Prompting
Build Workers apps with AI prompts and MCP servers.
Deploy an existing project
Learn how the Wrangler CLI automatically detects and configures projects for Workers.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers/platform/claim-deployments/#page","headline":"Claim deployments (temporary accounts)","description":"Deploy Workers before authentication, then claim the temporary account to keep its deployments and resources.","url":"https://developers.cloudflare.com/workers/platform/claim-deployments/","inLanguage":"en","image":"https://developers.cloudflare.com/workers/platform/claim-deployments/og.png?v=a809402ad4ebb6d2","dateModified":"2026-07-14","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Set up a Deploy to Cloudflare button title: Deploy to Cloudflare buttons image: https://developers.cloudflare.com/workers/platform/deploy-buttons/og.png?v=c5d9ceffb1dd21fb
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.
Docs