Submit a task to a project's committee; `wait` blocks until final
const url = 'https://testnet-rpc.necter.network/v1/projects/example/tasks?wait=0&accept=final';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"function":"example","input":"example","input_b64":"example","gas_limit":1,"idempotency_key":"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://testnet-rpc.necter.network/v1/projects/example/tasks?wait=0&accept=final' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "function": "example", "input": "example", "input_b64": "example", "gas_limit": 1, "idempotency_key": "example" }'Allowed with an API key of the project’s developer (tasks:submit), or anonymously when the project has scheduling.public_tasks = true (rate-limited per IP).
Authorizations
Section titled “Authorizations”- apiKey
- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Seconds to wait for final (or committee_agreed with accept=agreed)
Request Bodyrequired
Section titled “Request Bodyrequired”object
One of consensus.work.functions
String (byte-for-byte) or JSON value (canonical JSON, no floats); ≤ 1 MiB
Alternative to input for binary input
Default and max: consensus.work.max_gas_limit
Same key within 24 h returns the same task
Example generated
{ "function": "example", "input": "example", "input_b64": "example", "gas_limit": 1, "idempotency_key": "example"}Responses
Section titled “Responses”Final (or agreed) within wait
object
Hub id; equals round_id once scheduled
UTF-8 output (HBC outputs are UTF-8)
object
Example
{ "status": "queued"}Accepted, not final yet
object
Hub id; equals round_id once scheduled
UTF-8 output (HBC outputs are UTF-8)
object
Example
{ "status": "queued"}Malformed request (bad_request, invalid_field)
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}Missing/invalid credentials (unauthorized, session_expired, bad_signature)
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}Authenticated but not allowed (forbidden, not_owner, not_enrolled, not_verified, scope_missing)
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}not_found
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}conflict, duplicate, already_exists, invalid_state
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}too_large
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}rate_limited
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}Headers
Section titled “Headers”unavailable, no_validators, faucet_empty
object
Stable machine code
object
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}