Contractors

Contractor API

Let contractors log hours, submit timesheets and read their pay from their own tools.

Contractors who work for a company on Oatmilk have their own API at /api/v1/contractor/. It reaches only that contractor's own records: their hours, timesheets, pay, agreements and profile. Company API keys don't work here, and contractor sign-ins can't see the company's books.

HTTP
POST https://app.getoatmilk.com/api/v1/contractor/hours.create
Authorization: Bearer <contractor OAuth token>

Signing in

The contractor API uses OAuth with the contractor:read and contractor:write permissions. A contractor connects an app or AI assistant by signing in with the account they use for the contractor portal. Use https://app.getoatmilk.com/api/mcp?toolset=contractor to give an assistant only the contractor tools.

Choose the company

A contractor can work for several companies. Call organizations.list first: it needs no company. Then send X-Accounting-Organization with the chosen company's ID on every other request.

curl https://app.getoatmilk.com/api/v1/contractor/organizations.list \
  -H "Authorization: Bearer $OATMILK_OAUTH_TOKEN"

Log and submit hours

Log work on the date it happened, with a separate entry for each day. The timesheet returns the current agreement's limits and guidance. A weekly cap runs Monday–Sunday and can be split across days when there is no daily cap. Pay periods group hours for payment; they do not combine two weekly caps. Choose a past work date to find an earlier timesheet.

curl https://app.getoatmilk.com/api/v1/contractor/hours.create \
  -H "Authorization: Bearer $OATMILK_OAUTH_TOKEN" \
  -H "X-Accounting-Organization: $OATMILK_ORGANIZATION_ID" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "date": "2026-09-15",
  "minutes": 90,
  "description": "Design review with the finance team"
}'

When the pay period is ready, submit every draft entry in it at once:

curl https://app.getoatmilk.com/api/v1/contractor/timesheet.submit \
  -H "Authorization: Bearer $OATMILK_OAUTH_TOKEN" \
  -H "X-Accounting-Organization: $OATMILK_ORGANIZATION_ID" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "date": "2026-09-15"
}'

Payment methods

You and your employer can choose your default from saved bank and Wise email methods. Read payment.methods.list, then use payment.select with the saved method's id and paymentProfileRevision as expectedRevision. payment.add saves another complete method without changing the default; payment.save edits the current one. Details are stored encrypted and replies show only masked destinations.

Your employer's finance team and administrators use contractorOps.payments.list and contractorOps.payments.select. Administrators can also add or edit methods. Changing the default clears its confirmation and makes earlier payout approvals and schedules need review. The new method must be confirmed before money is sent.

The terminal has the same choices: oatmilk hours payment for your own methods, or oatmilk pay methods --contractor <id> for your employer's finance team. In the contractor terminal app, press p to choose a saved method.

Send requested receipts

Your company can ask you for a receipt for a specific purchase. Open the request in your contractor portal and send its photos or PDF files, or reply to the request email with the originals attached. The request stays with the selected company and gives no access to its books.

Connected apps read your own requests with documentRequests.list on the contractor API. Use documentRequests.portal with the request id and action: "view" to open it. To send several originals, begin with their file metadata, prepare and upload each file, confirm its SHA-256, then complete the batch. Keep the same originals when retrying. Receiving the files starts their reading and matching; finance may still need to review the expense.

In the terminal, use oatmilk hours receipts to list requests, then oatmilk hours receipts upload <request-id> receipt.pdf photo.jpg --yes to send the originals. In the contractor terminal app, press e to choose a receipt request and its files.

What stays in the portal

Tax numbers, agreeing to receive tax slips by email, and signing agreements only happen in the contractor's own portal session. The API refuses them with INTERACTIVE_PORTAL_REQUIRED or INTERACTIVE_SIGNATURE_REQUIRED and a portalUrl that opens the exact step.

Request missing information

Ask AI can ask the contractor to complete their own missing payment, profile or tax information. It uses the person and missing fields already discussed, then asks for approval to create the request. The request appears in the contractor's task queue; its notification opens the exact form in the correct company. The email is batched, so creating a request does not mean it was delivered.

Company administrators and finance members can use requests.people for the contractor record, then requests.create with the verified recipient's user ID and the appropriate completionTarget. For a known setup gap, use onlyIfMissing: true so a resolved gap does not cause a stale notification. Bank and tax values belong in the authenticated form, not in a message.

Review before approving

Ask AI shows the saved hours and pay calculation beside its approval control. Search or sort the entries, then expand a row to read its full description, saved form answers and any correction. The review distinguishes saved payout totals from estimates and says when entries are missing or details have changed. Approval stops until the review is current and complete.

Connected AI apps can open oatmilk_review_contractor_hours for the same review, scoped to a payout, pay period or contractor. Apps without cards can read the ordinary timesheet and payout tools. Ask AI and MCP payout approvals must include the returned review.reviewedSnapshot alongside expectedRevision, including approvals resumed from older chats. The server checks the exact linked hours and current payment-profile revisions when it commits. Direct API clients can also send the snapshot; it remains optional there for compatibility. Approving hours or a payout does not send money.

The terminal shows the same entries and details in its timesheet review, payout details and Ask AI approval flow.

Payout sent emails

When Wise confirms a payout was submitted, each current company administrator gets an email with the contractor, amount, pay period and a link to that exact payout in the correct company. This applies to manual sends and authorized scheduled sends, including a send recovered after an unclear Wise response. Scheduling or approving alone does not send this email.

These are immediate payment notices, separate from optional reminders. A saved notice survives interrupted work, and retries do not create duplicate emails. Submitted to Wise does not mean the contractor's bank account has been credited; the payout shows the current delivery status.

Company hour-limit corrections

An administrator or finance member can use Ask AI, including oatmilk exec, to preview and update a contractor's hour limits. The company actions are contractorOps.terms.hours.preview and contractorOps.terms.hours.update. The preview reads the current terms, shows the exact cap changes and returns the version and revision to pass back. Fields left out of the hours patch stay as agreed; null removes a cap. Rate, pay schedule, dates, clauses and original documents are preserved.

Choose record_existing only to record limits the parties already agreed. Give the effective date and a reason for the correction. To change their agreement, choose send_amendment: Oatmilk sends a separate amendment for the contractor and company to sign, with all existing required signers carried forward. Ask AI asks before sending. Current limits apply until everyone signs and the effective date arrives. A waiting or later update, an unavailable signer, or a stale preview blocks the change and explains the next step.

Every contractor action

The contractor reference lists all 49 actions with their fields.