User guideDeveloper guideWorking with resources
Developer guide

Working with resources

The CRUD pattern for projects, risks, vendors and other resources, with the few places they differ.

Working with resources

Most VerifyWise resources (projects, risks, vendors, models, tasks and more) follow the same REST pattern: list them, fetch one by id, create, update and delete. Once you know the pattern, every resource works the same way. The few places where they differ are listed at the end.

This article assumes you already have a token and know the base URL. If not, read the Platform REST API article first.

The CRUD pattern

Using vendors as the example, here is the full set of operations. Every request carries your bearer token.

OperationMethod & pathReturns
ListGET /api/vendorsEvery vendor in your organization.
Get oneGET /api/vendors/:idA single vendor by id.
CreatePOST /api/vendorsA 201 response with the created vendor and its new id.
UpdatePATCH /api/vendors/:idA 202 response with the updated vendor.
DeleteDELETE /api/vendors/:idA 202 response whose data is true.

List and get

bash
curl "http://localhost:3000/api/vendors" \
  -H "Authorization: Bearer <your-token>"

The response is the standard envelope. The list lives in the data field:

json
{
  "message": "OK",
  "data": [
    { "id": 1, "vendor_name": "Acme AI", "website": "https://acme.example" }
  ]
}

Fetch a single vendor by adding its id to the path:

bash
curl "http://localhost:3000/api/vendors/1" \
  -H "Authorization: Bearer <your-token>"

Create

Send the resource fields as a JSON body. A vendor needs vendor_name, vendor_provides, website, vendor_contact_person and assignee (the id of a user in your organization who owns the vendor); the other fields are optional. Without one of them the call returns 400.

bash
curl -X POST "http://localhost:3000/api/vendors" \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "vendor_name": "Acme AI",
    "vendor_provides": "LLM hosting",
    "website": "https://acme.example",
    "vendor_contact_person": "Jane Doe",
    "assignee": 1,
    "review_status": "Not started"
  }'

The response returns the created vendor with its assigned id. Each resource has its own set of fields, so check the resource in the API reference to see exactly what it accepts.

Update and delete

Update sends only the fields you want to change. Delete needs no body.

bash
curl -X PATCH "http://localhost:3000/api/vendors/1" \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{ "review_status": "In review" }'

curl -X DELETE "http://localhost:3000/api/vendors/1" \
  -H "Authorization: Bearer <your-token>"

Where resources differ

The pattern is consistent, but three details vary by resource. Always confirm them per resource in the API reference before you wire up an integration.

Some resources also have a newer version under /api/v1 that accepts extra fields, for example POST and PATCH /api/v1/vendors. The legacy path keeps working with the older set of fields.

Path casing

Most paths are lowercase (/api/vendors, /api/projects), but some keep camelCase. Project risks are served at /api/projectRisks, not /api/project-risks. Use the path exactly as the reference shows it.

Update verb (PATCH vs PUT)

The update verb is not the same for every resource. Sending the wrong one returns a 404.

ResourceUpdate verbPath
ProjectsPATCH/api/projects/:id
VendorsPATCH/api/vendors/:id
Project risksPUT/api/projectRisks/:id

The filter parameter

Some list endpoints accept a filter query parameter, and some do not. Project risks support it; projects and vendors do not. When supported, the values are active (the default), deleted or all.

bash
curl "http://localhost:3000/api/projectRisks?filter=all" \
  -H "Authorization: Bearer <your-token>"

Roles and access

Every resource endpoint requires a valid token. Any role can read, though some lists only show the use cases you have access to. Creating, updating and deleting projects, risks, vendors and most other resources needs an edit permission, which the built-in Admin and Editor roles have and Reviewer and Auditor do not; without it the call returns 403. A token carries the role of the user who created it, so an integration that writes data must use a token created by an Admin or Editor.

Two reminders

List endpoints return everything
Most resource lists are not paginated. A list call such as GET /api/vendors returns every matching row for your organization, so fetch and cache rather than polling in a tight loop, and be ready to handle large responses.
Check each resource in the reference
Field names, the update verb and filter support all vary by resource. The API reference (the file Servers/swagger.yaml in the VerifyWise repository, also served at /api/docs on a development install) is the source of truth for any resource you have not used before.
PreviousPlatform REST API
NextBulk importing datasets
Working with resources - Developer guide - VerifyWise User Guide