Skip to content

Integration guides

Read registers, submit evidence, and handle pagination and retries.

Follow the quickstart to set API_BASE_URL and load RESGUARDA_API_TOKEN before running these shell examples.

Read assets, risks, and vendors

Use the read scope for your register. This example uses vendor:read to list vendors with overdue reviews in the organization tied to the token.

curl --fail-with-body \
  --header "Authorization: Bearer $RESGUARDA_API_TOKEN" \
  "$API_BASE_URL/api/v1/vendors?reviewOverdue=true&page=1&pageSize=25"

A successful request returns HTTP 200. This example uses a fictional vendor.

{
  "items": [
    {
      "id": "vendor_example",
      "name": "Northstar Hosting",
      "lifecycleStatus": "ACTIVE",
      "criticality": "HIGH",
      "reviewStatus": "PENDING_RENEWAL"
    }
  ],
  "page": 1,
  "pageSize": 25,
  "hasMore": false
}

Append a returned ID to the collection path to get one record. For example, GET /api/v1/vendors/vendor_example returns detail fields and a quoted revision in the ETag header. Use the ID to select a record when names match multiple results. The OpenAPI document defines the filters and response fields for each register.

Submit evidence for a test

  1. List eligible tests with GET /api/v1/tests and select a test ID. This requires control_test:read.
  2. Use GET /api/v1/tests/{id}/evidence-requests with both control_test:read and evidence:submit to select an open or rejected request. If the complete traversal is empty, a workspace user must configure an eligible request in the app. Set RESGUARDA_REQUEST_ID to the returned request ID.
  3. Set IDEMPOTENCY_KEY to a unique value for this submission, such as a UUID. Save it with the request ID, file, and metadata. Upload and status both require evidence:submit.

Substitute the path to your own file for fictional-acceptance.csv and set its media type. Send one file, a title, and an optional note. The file can be up to 4 MiB and the full multipart body up to 4,400,000 bytes. See the integration guide for supported file types and field limits.

curl --fail-with-body \
  --header "Authorization: Bearer $RESGUARDA_API_TOKEN" \
  --header "Idempotency-Key: $IDEMPOTENCY_KEY" \
  --form "file=@fictional-acceptance.csv;type=text/csv" \
  --form-string "title=Policy acceptance export" \
  "$API_BASE_URL/api/v1/evidence-requests/$RESGUARDA_REQUEST_ID/submissions"

The first successful upload and a completed replay both return HTTP 200 with a receipt.

{
  "receiptId": "receipt_example",
  "requestId": "request_example",
  "submissionId": "submission_example",
  "evidenceId": "evidence_example",
  "evidenceVersionId": "version_example",
  "fileId": "file_example"
}

Read review, test, and coverage state separately with GET /api/v1/evidence-requests/{id}?submissionId={submissionId}. Use the request and submission IDs from the receipt to check that exact submission. The receipt confirms submission. Review and approval take place in the app.

Paginate lists

Lists default to page=1 and pageSize=25. You can request up to 100 items per page. Keep the filters and page size fixed and increment page while hasMore is true, even if items is empty or short. If page 10,000 still has more results, report the traversal as incomplete. Concurrent changes can move records between pages, so deduplicate by ID when needed.

Handle errors and retries

The JSON error contains error.code and error.message and can include error.details. Use the HTTP status and machine-readable codes for retry decisions.

  • For 400, 401, 403, 404, or 413, check the request, credential, scopes, resource ID, or upload size before another attempt. Missing and inaccessible resources both return 404.
  • For a network failure or HTTP 429, 500, or 503, use a bounded retry count and wait budget with backoff and jitter. Wait at least as long as Retry-After when present. Retry the same page or resource ID.
  • For an upload conflict (409), automatically retry only when error.details.reason is UPLOAD_IN_PROGRESS. Honor Retry-After. Other or missing reasons require investigation.

Every upload retry, including after an uncertain network outcome, must reuse the saved key, request ID, file name, content type, bytes, title, and note. A new key represents a new submission.

Rate limits

Reads and writes use separate budgets per network address and per token. Asset, risk, and vendor reads also share an organization-wide budget. Pace list and detail requests together. After 429 RATE_LIMITED, wait for the Retry-After delay before retrying within your budget.