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
- List eligible tests with
GET /api/v1/testsand select a test ID. This requirescontrol_test:read. - Use
GET /api/v1/tests/{id}/evidence-requestswith bothcontrol_test:readandevidence:submitto select an open or rejected request. If the complete traversal is empty, a workspace user must configure an eligible request in the app. SetRESGUARDA_REQUEST_IDto the returned request ID. - Set
IDEMPOTENCY_KEYto a unique value for this submission, such as a UUID. Save it with the request ID, file, and metadata. Upload and status both requireevidence: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, or413, check the request, credential, scopes, resource ID, or upload size before another attempt. Missing and inaccessible resources both return404. - For a network failure or HTTP
429,500, or503, use a bounded retry count and wait budget with backoff and jitter. Wait at least as long asRetry-Afterwhen present. Retry the same page or resource ID. - For an upload conflict (
409), automatically retry only whenerror.details.reasonisUPLOAD_IN_PROGRESS. HonorRetry-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.