Esc

↑↓ move↵ openIndex · Pagefind
Bulk writes

Up to 100 records, a result for each.

Bulk endpoints take an array of records and report what happened to each one. They do the same work as calling the single-record endpoint once per item, in one round trip.

LiveRFIsPunch itemsBudget line itemsTimecard entries

Endpoints

  • POST /rest/v1.0/projects/{project_id}/rfis/bulk_create
    { "rfis": [ ... ] }: each item is the body of POST …/rfis without the rfi wrapper.
  • PATCH /rest/v1.0/projects/{project_id}/rfis
    { "data": [ { "id", ... } ] }: assignees and distribution change through add_/remove_ lists, so two batches do not overwrite each other.
  • POST /rest/v1.0/punch_items/bulk_create
    { "project_id", "punch_items": [ ... ] }
  • PATCH /rest/v1.0/punch_items/bulk_update
    { "project_id", "punch_items": [ { "id", ... } ] }
  • POST /rest/v1.0/budget_line_items/bulk_create
    { "project_id", "budget_line_items": [ ... ] }
  • PATCH /rest/v1.0/budget_line_items/bulk_update
    { "project_id", "budget_line_items": [ { "id", ... } ] }
  • PATCH /rest/v1.0/projects/{project_id}/timecard_entries/bulk_update
    { "timecard_entries": [ { "id", ... } ] }
  • PATCH /rest/v1.0/projects/{project_id}/direct_costs/sync
    Create or update up to 100 direct costs; nothing is deleted.

The existing POST …/timecard_entries/bulk_create stays all or nothing (one transaction) and also accepts at most 100 entries.

Bulk createcurl
curl -X POST https://app.os.construction/rest/v1.0/projects/{project_id}/rfis/bulk_create \
  -H "Authorization: Bearer $OS_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0b8e8f3c-1d1f-4a0e-9a57-3f0f1b6a2c11" \
  -d '{ "rfis": [
        { "subject": "Anchor spacing at grid B", "question": { "body": "Confirm spacing." } },
        { "subject": "", "question": { "body": "Missing subject" } }
      ] }'
Per-item resultshttp
HTTP/1.1 200 OK
Content-Type: application/json

{
  "results": [
    { "index": 0, "status": 201, "id": 318, "data": { "id": 318, "subject": "Anchor spacing at grid B", ... } },
    { "index": 1, "status": 422, "errors": { "subject": ["can't be blank"] } }
  ],
  "summary": { "total": 2, "succeeded": 1, "failed": 1 }
}

How a batch runs

  • One at a time, in order
    Each item goes through the same checks as the single-record endpoint: permissions, private-record visibility, budget locks, workflow rules, audit history and webhook events.
  • No rollback across items
    A failed item does not undo the items before it. Read results[].status and retry only the failed items.
  • 200 for a valid envelope
    The request itself returns 200 whenever the body was a well-formed batch, even if every item failed. 400 means the envelope was wrong, 413 means more than 100 items.
  • Item status
    201 for a created record, 200 for an updated one, and the usual 403, 404, 409 or 422 for an item that failed. Successful items carry data, failed items carry errors.
  • Idempotency-Key
    A retried batch with the same key replays the first response, including its failures. Send the failed items again as a new batch with a new key.
  • Agent credentials
    Bulk creates are proposals that agent tokens may send. Bulk updates of punch items, budget lines and timecards can carry status or approval changes, so agent tokens cannot call them.
Batch update RFIscurl
curl -X PATCH https://app.os.construction/rest/v1.0/projects/{project_id}/rfis \
  -H "Authorization: Bearer $OS_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "data": [
        { "id": 318, "due_date": "2026-12-04", "add_assignee_ids": [42] },
        { "id": 319, "remove_distribution_ids": [17] }
      ] }'

Ask the OS

Reading this page

Ask anything about this page. Answers use what you're reading as context.

Suggested

    AI · may be imperfect · sample data where shown

    Open file