Page options
Review Biocompile contributions through the API
Last updated
The Biocompile API reads a project’s contributions and decides them as you would in the
app. With entities:read a token reads the review queue, and with contributions:review it
accepts, declines or sends back a contribution for you. Accepting applies the changes to the
project in the same call.
A contribution is the reviewed set of changes through which work from a Biocompile conversation reaches a project. The assistant creates them, and so does submitting a workbench through the API.
Read the review queue
GET .../research-projects/{project_id}/contributions lists a project’s contributions, newest
first. Filter with status=awaiting_approval for the ones that wait for review:
curl -s "https://app.biocompile.com/api/v1/organizations/$ORG_ID/research-projects/$PROJECT_ID/contributions?status=awaiting_approval" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Each contribution lists its proposed changes with a before and after, any conflicts, the
decision once made, and a review_url that opens it in Biocompile. available_actions says
what your token may do with it now. Pages hold up to 100 items, and next_cursor fetches the
next page.
A contribution has one of these statuses:
| Status | Meaning |
|---|---|
awaiting_approval | Waits for a person to review it |
applied | Accepted, and its changes are in the project |
revision_requested | Sent back to its author with instructions |
conflicted | The project changed and the changes no longer fit |
withdrawn | Declined by a reviewer, or withdrawn by its author |
Decide a contribution
Each decision matches a button in the app:
| Operation | In the app | What happens |
|---|---|---|
POST .../accept | Accept contribution | The changes are applied to the project at once. |
POST .../withdraw | Decline, or Withdraw for your own | The contribution is closed, and the project does not change. |
POST .../request-revision | Request revision | The contribution goes back to its author with your instructions. |
The paths continue from .../contributions/{contribution_id}. Accepting and declining take an
optional reason:
curl -s --request POST "https://app.biocompile.com/api/v1/organizations/$ORG_ID/research-projects/$PROJECT_ID/contributions/$CONTRIBUTION_ID/accept" \
-H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"reason": "Checked against the raw plate reader data."}'
Only a contribution that is awaiting_approval can be accepted or declined. If the project
changed and the changes no longer fit, accepting applies nothing and the contribution becomes
conflicted. Request a revision to resolve it.
Who may decide
The rule is the app’s: whoever can open the project may decide its contributions, including their own. Through the API, a person decides:
- A personal access token decides as you.
- An AI assistant or partner app with
contributions:reviewdecides as you, and the record names the app. - A service account can read contributions but never decide them.
- A project whose change policy is observe only refuses
accept, but declining still works.
Note: A token with both
entities:writeandcontributions:reviewcan accept changes it proposed itself. Grantcontributions:reviewonly to credentials you use to review.
Every decision sends the contribution.decided webhook event, as a decision in the app does.
Common questions
Can a script accept contributions without anyone opening Biocompile?
Yes, with a personal access token or an app acting for you that holds contributions:review.
The decision is recorded as yours.
Can a service account accept a contribution?
No. A service account is not a person, so it is refused with 403 and the code
service_account_not_supported. It can still read contributions.
What does accepting do when the project has changed?
It applies nothing. The contribution becomes conflicted with its conflicts listed, and you
request a revision.
Related
Was this page helpful?
Something wrong or missing?