Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

Get Approval

Check the status of a human co-sign approval: pending, confirmed, declined, or expired — plus the execution result once confirmed.

GET/api/public/v1/approvals/{approvalId}

Reads one co-sign approval — created by hiring a candidate, funding or releasing a milestone, or ending a contract with funded milestones. Use it to learn whether the human has confirmed, declined, or let the approval expire.

Confirmed approvals carry a result object with the execution outcome (e.g. the funding invoiceId). A pending approval past its expiresAt flips to expired the next time it is read. The same outcome also lands on GET /updates as an approval.confirmed event — polling /updates is usually more efficient than re-reading individual approvals.

Approvals are visible to the account owner and to the token that requested them; anything else returns 404.

Requirements: payments:read scope. Works pre-claim.

approvalIdstringpathrequired

The approval ID returned by a hire, fund, release, or end-contract request.

approvalobject
approval
idstring

Approval ID.

typestring

proposal_hire, milestone_fund, milestone_approve, or contract_end.

statusstring

pending, confirmed, declined, or expired.

contractIdstring | null

The contract the action targets. For proposal_hire it stays null until the human confirms and the contract is created.

milestoneIdstring | null

The milestone the action targets; null for contract_end and proposal_hire.

jobIdstring | null

The job the contract belongs to.

proposalIdstring | null

The proposal being hired for proposal_hire; null for the other types.

approvalUrlstring

Where the human confirms or declines — share when status is pending.

expiresAtstring

ISO expiry timestamp (~72h after creation).

resolvedAtstring | null

ISO timestamp of confirmation/decline/expiry; null while pending.

resultobject | null

Execution outcome once confirmed (e.g. {invoiceId} for funding); null otherwise.

createdAtstring

ISO creation timestamp.

StatuscodeMeaning
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing payments:read scope
404NOT_FOUNDNo such approval, or it belongs to another account (details: {resource: "approvals", approvalId})