REST reference
Base URL: the address of the API you run (default http://localhost:8787). The machine-readable contract is at /openapi.json (OpenAPI 3.1). The endpoint list below is generated from the same route table the server uses, and a test fails if they ever differ.
Conventions#
- Read-only. Only
GET(andHEAD,OPTIONS). Any other method on an existing endpoint returns405 METHOD_NOT_ALLOWED; on a path that is not an endpoint (for examplePOST /v1/jobs) the answer is404 NOT_FOUND. Writes go through the SDK. - Envelope. Success:
{ "success": true, "data": ... }. Failure:{ "success": false, "error": { "code", "message", "retryable", "field"? } }. ?consistency=on contract reads:latest(default) includes state that is not final yet;finalreads finalized state only. The response headerX-Allocyn-Consistencytells you which was used.- Unknown query parameters are rejected with
400, so a typo does not silently change what you get. - Headers.
X-Request-Idon every response,X-RateLimit-LimitandX-RateLimit-Remaining, andRetry-Afteron429. - CORS. Browser calls are allowed only from the origins listed in
CORS_ORIGINS. - Caching. Reads of contract data carry an
ETag; send it back inIf-None-Matchand an unchanged answer is a304with no body. They areCache-Control: no-cache, so clients revalidate. The exception is an answer that can never change again (aVERIFIEDjob, a job whose deliveries are used up, an evaluated receipt) read with?consistency=final: it ispublic, max-age=300, and the server answers it from memory (X-Allocyn-Cache: hit) for an hour. Reads withlatestare never cached for long, because they may include state that is not final./v1/metaand/v1/limitsmay be cached for 60 s, and the badge for 60 s.
HTTP status codes#
| Status | error.code |
Meaning |
|---|---|---|
| 400 | INVALID_ARGUMENT |
A path or query value is malformed. error.field names it. |
| 404 | JOB_NOT_FOUND, RECEIPT_NOT_FOUND, NOT_FOUND |
The id (or the route) does not exist. |
| 405 | METHOD_NOT_ALLOWED |
Not a GET. |
| 429 | RATE_LIMITED |
Wait Retry-After seconds. |
| 502 | UPSTREAM_UNAVAILABLE, CONTRACT_NOT_FOUND, DATA_INTEGRITY |
The network or contract did not answer, or answered with data the API refuses to pass on. |
| 503 | UPSTREAM_UNAVAILABLE, COPY_UNAVAILABLE |
UPSTREAM_UNAVAILABLE: only from /v1/health?deep=true. COPY_UNAVAILABLE: /v1/stats on a server with no database copy configured (not retryable). |
| 504 | UPSTREAM_TIMEOUT |
The network took longer than REQUEST_TIMEOUT_MS. |
| 500 | INTERNAL |
Unexpected. The message is generic on purpose; details stay in the server log. |
Endpoints#
The “Try it” forms send a real request from your browser to the base URL above. They only work while that API is running and allows this page's origin in CORS_ORIGINS (the docs served by the API itself are same-origin).
Example responses below were produced by running the real server code against the in-memory test double of the contract when these docs were built. They show the exact shapes; the values are not from the network.
System#
GET/v1/healthLiveness
Liveness. Says the API process is up. Add ?deep=true to also read the contract once (job-1) and report whether the network answers. A deep check that fails returns 503. With a database copy configured, a deep check also reports how old the copy is and how the last indexer run went (copy); a copy that is stale or unreachable never turns the check into a 503, because the contract is the source of truth.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
deep | query | string: true, false | `true` also reads the contract once. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Health } |
| 400 | Invalid parameter. |
| 429 | Rate limit exceeded. See Retry-After. |
| 503 | The network did not answer, or the optional database copy is not configured. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/health'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"status": "ok",
"time": "2026-11-26T06:00:59.598Z",
"checks": {}
}
}Try it
GET/v1/metaNetwork, contract and API facts
Network, contract and API facts. Which network and contract this API reads, the contract profile it was built for, and the read consistency in use. No network call.
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Meta } |
| 429 | Rate limit exceeded. See Retry-After. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/meta'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"name": "Allocyn",
"sdkVersion": "0.3.0",
"network": {
"name": "studionet",
"label": "Studionet",
"chainId": 61999,
"rpcUrl": "https://studio.genlayer.com/api",
"explorerUrl": "https://explorer-studio.genlayer.com",
"sdkAlias": "studionet"
},
"contractAddress": "0x5729a3b514654Ec5966A1DCa8e5088ef7A70bBDA",
"contractProfile": {
"name": "smart-agreement-rev2",
"sourceSha256": "58fd38776f25d54f22a9d1560f78b348215ac13d3a863d4f7be00609b9355f57",
"limitsSource": "audited-source"
},
"readConsistency": "latest",
"canWrite": false,
"actor": null,
"api": {
"version": "v1"
}
}
}Try it
GET/v1/limitsInput limits
Input limits. The limits the contract reports right now (get_limits()), next to the copy this API was built for. matchesPinned: false means the contract changed and this API needs an update. client holds the stricter limits applied by this deployment's SDK. Answers are cached for 60 s.
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Limits } |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/limits'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"source": "contract",
"contract": {
"minCriteria": 1,
"maxCriteria": 20,
"maxTitleLength": 200,
"maxDescriptionLength": 5000,
"maxCriterionLength": 1000,
"maxUrlLength": 2048,
"maxContentBytes": 250000,
"minEvidenceExcerptLength": 8,
"maxEvidenceExcerptLength": 300,
"maxDeliveriesPerJob": 2
},
"pinned": {
"minCriteria": 1,
"maxCriteria": 20,
"maxTitleLength": 200,
"maxDescriptionLength": 5000,
"maxCriterionLength": 1000,
"maxUrlLength": 2048,
"maxContentBytes": 250000,
"minEvidenceExcerptLength": 8,
"maxEvidenceExcerptLength": 300,
"maxDeliveriesPerJob": 2
},
"matchesPinned": true,
"differences": [],
"schemaVersion": 1,
"client": {
"maxCriteria": 5,
"maxTitleLength": 200,
"maxDescriptionLength": 5000,
"maxCriterionLength": 1000,
"maxUrlLength": 2048
},
"contractSourceSha256": "58fd38776f25d54f22a9d1560f78b348215ac13d3a863d4f7be00609b9355f57"
}
}Try it
Jobs#
GET/v1/jobsList jobs
List jobs. Jobs from newest to oldest, with an optional filter by status, client or worker. The contract has no list view, so this reads job ids one by one, at most 100 per request, and filters what it reads: a page can hold fewer than limit jobs while nextCursor is not null. Pass nextCursor as before to continue exactly where the scan stopped. With source=copy (or auto) the list is read from the optional database copy instead: one indexed query, pages are full, but the data is final-only and as old as syncedAt. The default stays contract, which is live.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
limit | query | integer | How many jobs to return, 1 to 50 (default 20). |
before | query | string^job-[1-9][0-9]{0,8}$ | Cursor: only jobs older than this id. Use the `nextCursor` of the previous page. |
status | query | string: OPEN, IN_PROGRESS, VERIFIED, NEEDS_REVISION, INCONCLUSIVE | Only jobs in this status. |
client | query | string^0x[0-9a-fA-F]{40}$ | Only jobs created by this address. |
q | query | string | Search the title and description (words, in any language; every word must appear). Needs the database copy, so `source` defaults to `copy` when this is set. |
updatedSince | query | string | Only jobs whose content changed at or after this time (date and time with a zone). A job that was only re-read does not count. Needs the database copy, so `source` defaults to `copy` when this is set. |
source | query | string: contract, copy, auto | Where the list is read from: `contract` (default, live, slower), `copy` (the database copy: one indexed query, final data as of `syncedAt`) or `auto` (the copy when it is configured and reachable, else the contract). |
worker | query | string^0x[0-9a-fA-F]{40}$ | Only jobs accepted by this address. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": JobList } |
| 400 | Invalid parameter. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 503 | The network did not answer, or the optional database copy is not configured. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"items": [
{
"id": "job-1",
"title": "Logo files",
"status": "VERIFIED",
"client": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"deliveryCount": 1
}
],
"nextCursor": null,
"latest": "job-1",
"scanned": 1,
"source": "contract",
"syncedAt": null,
"notes": []
}
}Try it
GET/v1/statsCounts and statistics
Counts and statistics. How many jobs there are in each status, and how many deliveries got each verdict, optionally for one client or one worker. The contract has no count view, so these numbers come from an optional database copy that an indexer fills from final reads. The answer says when the copy was last refreshed (syncedAt). It answers 503 COPY_UNAVAILABLE on a server that has no copy configured.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
client | query | string^0x[0-9a-fA-F]{40}$ | Count only the jobs created by this address. Deliveries are then not counted. |
worker | query | string^0x[0-9a-fA-F]{40}$ | Count only the jobs accepted by this address, and the deliveries made by it. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Stats } |
| 400 | Invalid parameter. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 503 | The network did not answer, or the optional database copy is not configured. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/stats'Example response (simulated contract, status 503)
{
"success": false,
"error": {
"code": "COPY_UNAVAILABLE",
"message": "This server has no database copy configured, so it cannot give statistics.",
"retryable": false
}
}Try it
GET/v1/eventsFeed of job events
Feed of job events. What changed in the jobs, oldest first: a job was created or accepted, a delivery came in or got its verdict, a status moved. Cursor based: pass the cursor of one answer as after in the next, and add wait (up to 25 s) to hold the request until something new arrives. Events are stored, so a client that was away can catch up. Read from the optional database copy, so detectedAt is when the indexer saw the change, not when it happened on the network. Nothing is pushed and there are no webhooks. 503 COPY_UNAVAILABLE on a server with no copy.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
after | query | integer | Cursor: only events with a higher id. Use the `cursor` of the previous answer. Leave it out to get the newest events. |
limit | query | integer | How many events to return, 1 to 100 (default 50). |
job | query | string^job-[1-9][0-9]{0,8}$ | Only events of this job. |
type | query | string: job_created, job_accepted, delivery_submitted, delivery_evaluated, status_changed | Only this kind of event. |
worker | query | string^0x[0-9a-fA-F]{40}$ | Only events of jobs accepted by this address. |
client | query | string^0x[0-9a-fA-F]{40}$ | Only events of jobs created by this address. |
wait | query | integer | Seconds to wait for a new event when there is none yet, 0 to 25 (default 0). The server may wait less: it always answers before `REQUEST_TIMEOUT_MS`. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": EventFeed } |
| 400 | Invalid parameter. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 503 | The network did not answer, or the optional database copy is not configured. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/events'Example response (simulated contract, status 503)
{
"success": false,
"error": {
"code": "COPY_UNAVAILABLE",
"message": "This server has no database copy configured, so it has no event feed.",
"retryable": false
}
}Try it
GET/v1/addresses/{address}What the copy holds about an address
What the copy holds about an address. For one wallet address: how many jobs it created (as client) and accepted (as worker) in each status, how many deliveries it made and the verdicts they got, and its five newest jobs on each side. Counts only: no score, no ranking and no guarantee. Read from the optional database copy, so it is as old as syncedAt. 503 COPY_UNAVAILABLE on a server with no copy. Answers are cached for 30 seconds.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
address | path | string^0x[0-9a-fA-F]{40}$ | A wallet address: 0x followed by 40 hex characters, in any letter case. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": AddressRecord } |
| 400 | Invalid parameter. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 503 | The network did not answer, or the optional database copy is not configured. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/addresses/{address}'Example response (simulated contract, status 503)
{
"success": false,
"error": {
"code": "COPY_UNAVAILABLE",
"message": "This server has no database copy configured, so it has no address records.",
"retryable": false
}
}Try it
GET/v1/jobs/{jobId}Read a job
Read a job. The job's terms, parties, status and receipt ids, read from the contract. integrity reports whether the hashes recompute from the returned terms.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Job } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"id": "job-1",
"title": "Logo files",
"description": "The studio logo as vector files.",
"criteria": [
{
"id": "C1",
"text": "Delivered as SVG"
},
{
"id": "C2",
"text": "Includes a usage guide"
}
],
"client": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"status": "VERIFIED",
"deliveryCount": 1,
"receiptIds": [
"rcpt-1"
],
"termsHash": "802d42cc47cc3596b1052722b9348053d82aad919ec8e46fd09e8845b978927b",
"agreementHash": "093d2859eb18ca4c467183f2dcfa407ae9591b5c28c0e6a46b04f0faed17a891",
"integrity": {
"termsHashMatches": true,
"agreementHashMatches": true
}
}
}Try it
GET/v1/jobs/{jobId}/proofProof pack of a job
Proof pack of a job. A portable proof pack, safe to save and send as a file (format: "allocyn.proof", version 1). It holds: the contract it lives in, its terms, parties, status and every delivery with the per-criterion verdicts, plus a SHA-256 digest of those facts and the steps to check them against the contract yourself. The digest is not a signature. final: true means the job cannot change any more. Anyone can check a saved pack without trusting this API: verifyProofPack() in @allocyn/sdk or allocyn verify proof.json --chain re-read the contract and compare. The contract stores no transaction hashes, so the pack has none.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Proof } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1/proof'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"format": "allocyn.proof",
"formatVersion": 1,
"jobId": "job-1",
"status": "VERIFIED",
"final": true,
"consistency": "latest",
"readAt": "2026-11-26T06:00:59.653Z",
"network": {
"name": "studionet",
"chainId": 61999
},
"contractUrl": "https://explorer-studio.genlayer.com/address/0x5729a3b514654Ec5966A1DCa8e5088ef7A70bBDA",
"facts": {
"contract": {
"address": "0x5729a3b514654Ec5966A1DCa8e5088ef7A70bBDA",
"chainId": 61999,
"sourceSha256": "58fd38776f25d54f22a9d1560f78b348215ac13d3a863d4f7be00609b9355f57"
},
"job": {
"id": "job-1",
"title": "Logo files",
"description": "The studio logo as vector files.",
"criteria": [
{
"id": "C1",
"text": "Delivered as SVG"
},
{
"id": "C2",
"text": "Includes a usage guide"
}
],
"client": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"status": "VERIFIED",
"deliveryCount": 1,
"termsHash": "802d42cc47cc3596b1052722b9348053d82aad919ec8e46fd09e8845b978927b",
"agreementHash": "093d2859eb18ca4c467183f2dcfa407ae9591b5c28c0e6a46b04f0faed17a891"
},
"deliveries": [
{
"deliveryIndex": 1,
"receiptId": "rcpt-1",
"url": "https://example.org/logo-package",
"status": "EVALUATED",
"overallStatus": "VERIFIED",
"evidenceHash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"evidenceSize": 1234,
"results": [
{
"criterionId": "C1",
"status": "MET",
"reasonCode": "MEETS_CRITERION"
},
{
"criterionId": "C2",
"status": "MET",
"reasonCode": "MEETS_CRITERION"
}
]
}
]
},
"digest": {
"algorithm": "sha256",
"value": "af4a1ea99813f9ae687649aa162c045ab8f58853e94e2093dc7fdb7d41637acf",
"covers": "facts"
},
"integrity": {
"termsHashMatches": true,
"agreementHashMatches": true
},
"verify": [
"Read job job-1 from the contract at 0x5729a3b514654Ec5966A1DCa8e5088ef7A70bBDA on Studionet yourself, with your own GenLayer client or the explorer, and compare it with \"facts.job\".",
"Read each receipt the same way and compare it with the matching entry in \"facts.deliveries\".",
"Recompute the digest: SHA-256 of the UTF-8 JSON of \"facts\" with object keys sorted at every level.",
"Or save this file and run `allocyn verify proof.json --chain`, or `verifyProofPack()` from @allocyn/sdk: they do all of this for you."
],
"notes": [
"The digest helps notice that a copy of this proof was altered. It is not a signature, and it proves nothing about the contract: only reading the contract does.",
"VERIFIED means validators judged a public page against the written criteria. It is not a payment, an escrow or a guarantee of quality.",
"A job that is not final can still change.",
"The contract does not store transaction hashes, so this pack has none. `contractUrl` opens the contract on the explorer."
]
}
}Try it
GET/v1/jobs/{jobId}/badge.svgStatus badge (SVG)
Status badge (SVG). A small SVG badge with the job's status, for a README or a portfolio: . It says what the contract says right now and nothing more. A missing or invalid job still answers with a badge, with the matching status code.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: an image/svg+xml image |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1/badge.svg'Example response (simulated contract, status 200)
<svg xmlns="http://www.w3.org/2000/svg" width="167" height="20" viewBox="0 0 167 20" role="img" aria-label="allocyn job-1: verified"><title>Allocyn job-1: verified (final). Validators judged a public page against written criteria; this is not a payment or a guarantee of quality.</title><rect width="100" height="20" rx="3" fill="#1d2523"/><rect x="100" width="67" height="20" rx="3" fill="#1f8a5b"/><rect x="100" width="6" height="20" fill="#1f8a5b"/><g fill="#fff" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11" text-anchor="middle"><text x="50" y="14">allocyn job-1</text><text x="133.5" y="14">verified</text></g></svg>It renders as:
Try it
GET/v1/jobs/{jobId}/waitWait for a job to change
Wait for a job to change. Long poll, instead of webhooks. Call it once without since to get the job and its version; call it again with that version as since and it answers when the job changes (a worker accepted, a delivery came in, validators judged) or when the wait ends with changed: false. Nothing is stored: if you miss an answer, ask again. The wait is capped by timeout (at most 25 s) and by the server's request timeout.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
since | query | string^[0-9a-f]{16}$ | The `version` returned by the previous call. Leave it out on the first call: the answer is immediate. |
timeout | query | integer | How many seconds to wait for a change, 1 to 25 (default 15). The server may use less: it always answers before `REQUEST_TIMEOUT_MS`. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": JobWait } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 504 | The network took too long to answer. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1/wait'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"changed": false,
"version": "5fb32286e75c0caf",
"waitedSeconds": 0,
"job": {
"id": "job-1",
"title": "Logo files",
"description": "The studio logo as vector files.",
"criteria": [
{
"id": "C1",
"text": "Delivered as SVG"
},
{
"id": "C2",
"text": "Includes a usage guide"
}
],
"client": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"status": "VERIFIED",
"deliveryCount": 1,
"receiptIds": [
"rcpt-1"
],
"termsHash": "802d42cc47cc3596b1052722b9348053d82aad919ec8e46fd09e8845b978927b",
"agreementHash": "093d2859eb18ca4c467183f2dcfa407ae9591b5c28c0e6a46b04f0faed17a891",
"integrity": {
"termsHashMatches": true,
"agreementHashMatches": true
}
}
}
}Try it
GET/v1/jobs/{jobId}/preparePrepare an action for the person to sign
Prepare an action for the person to sign. Checks whether accepting, delivering or evaluating is possible on this job right now, and says exactly what the person would sign: the contract call, the SDK call and a link to the Allocyn app. It only READS the contract: it builds no transaction, holds no key and sends nothing (sent is always false). The person signs in their own wallet, and the contract checks everything again at that moment. For an agent: use it to start a flow, never to act on someone's behalf.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
action | query | string: accept, submit, evaluate | What the person wants to do: `accept` the job, `submit` a delivery, or `evaluate` the delivery that is waiting to be judged. |
deliveryUrl | query | string^https://[^\s"<>]{3,2000}$ | For `submit` only: the public https page the worker will deliver. |
actor | query | string^0x[0-9a-fA-F]{40}$ | Optional. The address that would sign. When given, the answer also says whether that address is allowed to do it. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": PreparedAction } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1/prepare'Example response (simulated contract, status 400)
{
"success": false,
"error": {
"code": "INVALID_ARGUMENT",
"message": "action is required.",
"retryable": false,
"field": "action"
}
}Try it
Receipts#
GET/v1/jobs/{jobId}/receiptsList a job's receipts
List a job's receipts. Every receipt of the job, in delivery order (delivery 1 first).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": ReceiptList } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1/receipts'Example response (simulated contract, status 200)
{
"success": true,
"data": [
{
"id": "rcpt-1",
"jobId": "job-1",
"deliveryIndex": 1,
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"url": "https://example.org/logo-package",
"status": "EVALUATED",
"agreementHash": "093d2859eb18ca4c467183f2dcfa407ae9591b5c28c0e6a46b04f0faed17a891",
"evidenceHash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"evidenceSize": 1234,
"overallStatus": "VERIFIED",
"evaluationRequestedBy": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"results": [
{
"criterionId": "C1",
"status": "MET",
"reasonCode": "MEETS_CRITERION",
"evidenceExcerpt": "quoted evidence for C1"
},
{
"criterionId": "C2",
"status": "MET",
"reasonCode": "MEETS_CRITERION",
"evidenceExcerpt": "quoted evidence for C2"
}
]
}
]
}Try it
GET/v1/jobs/{jobId}/receipts/{deliveryIndex}Read one receipt by delivery number
Read one receipt by delivery number. The receipt of delivery N of a job. A receipt is EVALUATED once validators have judged it; before that results is empty.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobId | path | string^job-[1-9][0-9]*$ | Job id, e.g. "job-1". Ids are assigned by the contract: never invent one. |
deliveryIndex | path | integer | 1-based delivery number within the job. |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Receipt } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/jobs/job-1/receipts/1'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"id": "rcpt-1",
"jobId": "job-1",
"deliveryIndex": 1,
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"url": "https://example.org/logo-package",
"status": "EVALUATED",
"agreementHash": "093d2859eb18ca4c467183f2dcfa407ae9591b5c28c0e6a46b04f0faed17a891",
"evidenceHash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"evidenceSize": 1234,
"overallStatus": "VERIFIED",
"evaluationRequestedBy": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"results": [
{
"criterionId": "C1",
"status": "MET",
"reasonCode": "MEETS_CRITERION",
"evidenceExcerpt": "quoted evidence for C1"
},
{
"criterionId": "C2",
"status": "MET",
"reasonCode": "MEETS_CRITERION",
"evidenceExcerpt": "quoted evidence for C2"
}
]
}
}Try it
GET/v1/receipts/{receiptId}Read a receipt by id
Read a receipt by id. A receipt by its contract id.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
receiptId | path | string^rcpt-[1-9][0-9]*$ | Receipt id, e.g. "rcpt-1". |
consistency | query | string: latest, final | "latest" (default) includes non-final state; "final" reads finalized state only (genlayer-js `latest-final`). |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Receipt } |
| 400 | Invalid parameter. |
| 404 | Not found. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/receipts/rcpt-1'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"id": "rcpt-1",
"jobId": "job-1",
"deliveryIndex": 1,
"worker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"url": "https://example.org/logo-package",
"status": "EVALUATED",
"agreementHash": "093d2859eb18ca4c467183f2dcfa407ae9591b5c28c0e6a46b04f0faed17a891",
"evidenceHash": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"evidenceSize": 1234,
"overallStatus": "VERIFIED",
"evaluationRequestedBy": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
"results": [
{
"criterionId": "C1",
"status": "MET",
"reasonCode": "MEETS_CRITERION",
"evidenceExcerpt": "quoted evidence for C1"
},
{
"criterionId": "C2",
"status": "MET",
"reasonCode": "MEETS_CRITERION",
"evidenceExcerpt": "quoted evidence for C2"
}
]
}
}Try it
Transactions#
GET/v1/transactions/{txHash}Track a transaction
Track a transaction. Where a transaction is in GenLayer consensus. Read-only. decided: true does NOT prove the change was recorded: read the job or receipt to confirm.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
txHash | path | string^0x[0-9a-fA-F]{64}$ | GenLayer transaction hash: 0x followed by 64 hex characters. |
Responses
| Status | Meaning |
|---|---|
| 200 | Success: { "success": true, "data": Transaction } |
| 400 | Invalid parameter. |
| 429 | Rate limit exceeded. See Retry-After. |
| 502 | The network or contract answered badly or not at all. |
| 500 | Unexpected server error. |
Example request
curl -s 'https://allocynapivercel.vercel.app/v1/transactions/0x0000000000000000000000000000000000000000000000000000000000abc001'Example response (simulated contract, status 200)
{
"success": true,
"data": {
"txHash": "0x0000000000000000000000000000000000000000000000000000000000abc001",
"phase": "decided",
"label": "Accepted by validators",
"statusName": "ACCEPTED",
"decided": true,
"failureMessage": null
}
}Try it
Error example#
GET /v1/jobs/job-99 → HTTP 404
{
"success": false,
"error": {
"code": "JOB_NOT_FOUND",
"message": "job-99 does not exist on the contract.",
"retryable": false
}
}