Create or recover an agent onboarding
const url = 'https://testperch.com/api/public/v1/onboardings';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"workspace_name":"example","project_name":"example","request_secret":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://testperch.com/api/public/v1/onboardings \ --header 'Content-Type: application/json' \ --data '{ "workspace_name": "example", "project_name": "example", "request_secret": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”object
Recovery authority: generate 32 cryptographically random bytes, encode as canonical unpadded base64url, and save privately BEFORE requesting. Reuse exactly with the same names after interruption. Never print, log, or commit this secret.
Example generated
{ "workspace_name": "example", "project_name": "example", "request_secret": "example"}Responses
Section titled “Responses”Atomically create a seven-day workspace with a shared $1 AI allowance, initial project, reporter key, and Read + write project key. Save the sensitive response directly to private storage. Identical requests recover the exact original response without extending expiry. Names are trimmed for retry comparison. Changed names return 409; closed requests return 410 and never create again. Basic creation limits: 3 per source and 30 globally per UTC hour. Recovery does not consume these limits.
Sensitive credential response. Save directly to a private file; do not display. Recovered responses contain exactly the original credentials, names, identifiers and deadline.
object
object
object
Example
{ "project_api_key_mode": "read_write"}Invalid request. Secret values are never echoed.
object
object
object
Example
{ "error": { "code": "invalid_request" }}The request secret was already used with different names.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Onboarding_closed: recovery is permanently unavailable; the request cannot recreate anything.
object
object
object
Example
{ "error": { "code": "invalid_request" }}JSON request body exceeds 4096 bytes.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Credential or workspace rate limit exceeded.
object
object
object
Example
{ "error": { "code": "invalid_request" }}Headers
Section titled “Headers”Seconds before retrying.
Seconds before retrying.
Internal server error. Retry provisioning with the same saved request secret.
object
object
object
Example
{ "error": { "code": "invalid_request" }}