Describe API¶
Descriptions¶
- GET /api/descriptions/¶
- Query Parameters:
label (string)
label__in (array) – Multiple values may be separated by commas.
limit (integer) – Number of results to return per page.
offset (integer) – The initial index from which to return the results.
protocol (integer)
protocol__in (array) – Multiple values may be separated by commas.
variety (integer)
variety__in (array) – Multiple values may be separated by commas.
variety_name (string) – Variety Name
Example request:
GET /api/descriptions/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "species": "string", "protocol": 1, "protocol_name": "string" } ] }
- POST /api/descriptions/¶
Example request:
POST /api/descriptions/ HTTP/1.1 Host: example.com Content-Type: application/json { "label": 1, "variety": 1, "protocol": 1 }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "species": "string", "protocol": 1, "protocol_name": "string" }
- GET /api/descriptions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this description.
Example request:
GET /api/descriptions/{id}/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "species": "string", "protocol": 1, "protocol_name": "string" }
- PUT /api/descriptions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this description.
Example request:
PUT /api/descriptions/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "label": 1, "variety": 1, "protocol": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "species": "string", "protocol": 1, "protocol_name": "string" }
- PATCH /api/descriptions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this description.
Example request:
PATCH /api/descriptions/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "label": 1, "variety": 1, "protocol": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "species": "string", "protocol": 1, "protocol_name": "string" }
- DELETE /api/descriptions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this description.
- Status Codes:
204 No Content – No response body
- POST /api/descriptions/bulk/¶
Bulk create descriptions
Create multiple objects from a JSON array.Each item follows the same schema as the normal create endpoint.
Example request:
POST /api/descriptions/bulk/ HTTP/1.1 Host: example.com Content-Type: application/json [ { "label": 1, "variety": 1, "protocol": 1 } ]
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json [ { "id": 1, "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "species": "string", "protocol": 1, "protocol_name": "string" } ]
- GET /api/descriptions/export-jsonl/¶
Export the full filtered result set as newline-delimited JSON.
Example request:
GET /api/descriptions/export-jsonl/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK – Newline-delimited JSON stream.
- POST /api/descriptions/spreadsheet_import/¶
Import variety descriptions from a spreadsheet file.
Supported file formats are CSV, XLS, XLSX, and ODS. The first row must contain the column names described below.
Select
Validate onlyto check the file for errors without importing any rows.Accepted columns:
variety_name(text, required): name of the variety. It is matched against existing varieties with the species of the selected protocol; validation fails if no variety or more than one variety matches;label_name(text, optional): name of an existing description label. Validation fails if the label does not exist; leave the cell blank for no label;notes(text, optional): free text notes (max 500 characters);any other column whose header is a trait numeric id (integer): each cell must hold the numeric id of a state of that trait, and creates an expression for the description. Blank cells are ignored. Columns with non-numeric headers are ignored.
A row whose combination of
variety_name,label_name, and protocol already exists is skipped and is not updated. Rows with the samevariety_nameandlabel_namewithin one file are reported as errors and the whole import fails.Example request:
POST /api/descriptions/spreadsheet_import/ HTTP/1.1 Host: example.com Content-Type: application/json { "file": "01010101", "validate_only": true, "protocol_id": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "imported_rows": 1 }
Expressions¶
- GET /api/expressions/¶
- Query Parameters:
description (integer)
description__in (array) – Multiple values may be separated by commas.
description_id__in (array) – Multiple values may be separated by commas.
limit (integer) – Number of results to return per page.
note__icontains (string)
offset (integer) – The initial index from which to return the results.
state (integer)
state__in (array) – Multiple values may be separated by commas.
trait__in (array) – Multiple values may be separated by commas.
trait_numeric_id (integer)
Example request:
GET /api/expressions/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "description": 1, "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "state_group": 1, "note": "string" } ] }
- POST /api/expressions/¶
Example request:
POST /api/expressions/ HTTP/1.1 Host: example.com Content-Type: application/json { "description": 1, "state": 1, "note": "string" }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "description": 1, "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "state_group": 1, "note": "string" }
- GET /api/expressions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this expression.
Example request:
GET /api/expressions/{id}/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "description": 1, "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "state_group": 1, "note": "string" }
- PUT /api/expressions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this expression.
Example request:
PUT /api/expressions/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "description": 1, "state": 1, "note": "string" }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "description": 1, "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "state_group": 1, "note": "string" }
- PATCH /api/expressions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this expression.
Example request:
PATCH /api/expressions/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "description": 1, "state": 1, "note": "string" }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "description": 1, "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "state_group": 1, "note": "string" }
- DELETE /api/expressions/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this expression.
- Status Codes:
204 No Content – No response body
- POST /api/expressions/bulk/¶
Bulk create expressions
Create multiple objects from a JSON array.Each item follows the same schema as the normal create endpoint.
Example request:
POST /api/expressions/bulk/ HTTP/1.1 Host: example.com Content-Type: application/json [ { "description": 1, "state": 1, "note": "string" } ]
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json [ { "id": 1, "description": 1, "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "state_group": 1, "note": "string" } ]
Protocols¶
- GET /api/protocols/¶
- Query Parameters:
exclude_id (integer)
limit (integer) – Number of results to return per page.
name (string)
name__icontains (string)
offset (integer) – The initial index from which to return the results.
plantspecies (integer)
plantspecies__in (array) – Multiple values may be separated by commas.
Example request:
GET /api/protocols/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "name": "string", "plantspecies": 1, "url_ref": "https://example.com" } ] }
- POST /api/protocols/¶
Example request:
POST /api/protocols/ HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- GET /api/protocols/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this protocol.
Example request:
GET /api/protocols/{id}/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- PUT /api/protocols/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this protocol.
Example request:
PUT /api/protocols/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- PATCH /api/protocols/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this protocol.
Example request:
PATCH /api/protocols/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "string", "plantspecies": 1, "url_ref": "https://example.com" }
- DELETE /api/protocols/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this protocol.
- Status Codes:
204 No Content – No response body
- POST /api/protocols/bulk/¶
Bulk create protocols
Create multiple objects from a JSON array.Each item follows the same schema as the normal create endpoint.
Example request:
POST /api/protocols/bulk/ HTTP/1.1 Host: example.com Content-Type: application/json [ { "name": "string", "plantspecies": 1, "url_ref": "https://example.com" } ]
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json [ { "id": 1, "name": "string", "plantspecies": 1, "url_ref": "https://example.com" } ]
Traits¶
- GET /api/traits/¶
- Query Parameters:
description__icontains (string)
limit (integer) – Number of results to return per page.
numeric_id (integer)
numeric_id__in (array) – Multiple values may be separated by commas.
offset (integer) – The initial index from which to return the results.
protocol (integer)
protocol__in (array) – Multiple values may be separated by commas.
Example request:
GET /api/traits/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 } ] }
- POST /api/traits/¶
Example request:
POST /api/traits/ HTTP/1.1 Host: example.com Content-Type: application/json { "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- GET /api/traits/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this trait.
Example request:
GET /api/traits/{id}/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- PUT /api/traits/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this trait.
Example request:
PUT /api/traits/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- PATCH /api/traits/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this trait.
Example request:
PATCH /api/traits/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 }
- DELETE /api/traits/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this trait.
- Status Codes:
204 No Content – No response body
- POST /api/traits/bulk/¶
Bulk create traits
Create multiple objects from a JSON array.Each item follows the same schema as the normal create endpoint.
Example request:
POST /api/traits/bulk/ HTTP/1.1 Host: example.com Content-Type: application/json [ { "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 } ]
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json [ { "id": 1, "numeric_id": 1, "description": "string", "grouping": true, "protocol": 1 } ]
States¶
- GET /api/states/¶
- Query Parameters:
description__icontains (string)
limit (integer) – Number of results to return per page.
numeric_id (integer)
numeric_id__in (array) – Multiple values may be separated by commas.
offset (integer) – The initial index from which to return the results.
protocol (number)
trait (integer)
trait__in (array) – Multiple values may be separated by commas.
trait_numeric_id (integer)
trait_numeric_id__in (array) – Multiple values may be separated by commas.
Example request:
GET /api/states/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "numeric_id": 1, "description": "string", "trait": 1, "group": 1 } ] }
- POST /api/states/¶
Example request:
POST /api/states/ HTTP/1.1 Host: example.com Content-Type: application/json { "numeric_id": 1, "description": "string", "trait": 1 }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "trait": 1, "group": 1 }
- GET /api/states/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this state.
Example request:
GET /api/states/{id}/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "trait": 1, "group": 1 }
- PUT /api/states/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this state.
Example request:
PUT /api/states/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "numeric_id": 1, "description": "string", "trait": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "trait": 1, "group": 1 }
- PATCH /api/states/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this state.
Example request:
PATCH /api/states/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "numeric_id": 1, "description": "string", "trait": 1 }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "numeric_id": 1, "description": "string", "trait": 1, "group": 1 }
- DELETE /api/states/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this state.
- Status Codes:
204 No Content – No response body
- POST /api/states/bulk/¶
Bulk create states
Create multiple objects from a JSON array.Each item follows the same schema as the normal create endpoint.
Example request:
POST /api/states/bulk/ HTTP/1.1 Host: example.com Content-Type: application/json [ { "numeric_id": 1, "description": "string", "trait": 1 } ]
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json [ { "id": 1, "numeric_id": 1, "description": "string", "trait": 1, "group": 1 } ]
Workspaces¶
- GET /api/workspaces/¶
- Query Parameters:
limit (integer) – Number of results to return per page.
offset (integer) – The initial index from which to return the results.
Example request:
GET /api/workspaces/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "name": "string" } ] }
- POST /api/workspaces/¶
Example request:
POST /api/workspaces/ HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string" }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "name": "string" }
- GET /api/workspaces/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this workspace.
Example request:
GET /api/workspaces/{id}/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "string" }
- PUT /api/workspaces/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this workspace.
Example request:
PUT /api/workspaces/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string" }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "string" }
- PATCH /api/workspaces/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this workspace.
Example request:
PATCH /api/workspaces/{id}/ HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string" }
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "name": "string" }
- DELETE /api/workspaces/{id}/¶
- Parameters:
id (integer) – A unique integer value identifying this workspace.
- Status Codes:
204 No Content – No response body
- GET /api/workspaces/{workspace}/elements/¶
- Parameters:
workspace (integer)
- Query Parameters:
limit (integer) – Number of results to return per page.
offset (integer) – The initial index from which to return the results.
Example request:
GET /api/workspaces/{workspace}/elements/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "description": 1, "description_detail": { "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "protocol": 1, "protocol_name": "string", "expressions": [ { "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "note": "string" } ] }, "order": 1 } ] }
- POST /api/workspaces/{workspace}/elements/¶
- Parameters:
workspace (integer)
Example request:
POST /api/workspaces/{workspace}/elements/ HTTP/1.1 Host: example.com Content-Type: application/json { "description": 1, "order": 1 }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "description": 1, "description_detail": { "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "protocol": 1, "protocol_name": "string", "expressions": [ { "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "note": "string" } ] }, "order": 1 }
- GET /api/workspaces/{workspace}/elements/export-jsonl/¶
Export the full filtered result set as newline-delimited JSON.
- Parameters:
workspace (integer)
Example request:
GET /api/workspaces/{workspace}/elements/export-jsonl/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK – Newline-delimited JSON stream.
Workspace Elements¶
- GET /api/workspaces/{workspace}/elements/¶
- Parameters:
workspace (integer)
- Query Parameters:
limit (integer) – Number of results to return per page.
offset (integer) – The initial index from which to return the results.
Example request:
GET /api/workspaces/{workspace}/elements/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": "https://example.com", "previous": "https://example.com", "results": [ { "id": 1, "description": 1, "description_detail": { "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "protocol": 1, "protocol_name": "string", "expressions": [ { "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "note": "string" } ] }, "order": 1 } ] }
- POST /api/workspaces/{workspace}/elements/¶
- Parameters:
workspace (integer)
Example request:
POST /api/workspaces/{workspace}/elements/ HTTP/1.1 Host: example.com Content-Type: application/json { "description": 1, "order": 1 }
- Status Codes:
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "description": 1, "description_detail": { "label": 1, "label_name": "string", "variety": 1, "variety_name": "string", "protocol": 1, "protocol_name": "string", "expressions": [ { "trait": 1, "trait_numeric_id": 1, "trait_description": "string", "state": 1, "state_numeric_id": 1, "state_description": "string", "note": "string" } ] }, "order": 1 }
- GET /api/workspaces/{workspace}/elements/export-jsonl/¶
Export the full filtered result set as newline-delimited JSON.
- Parameters:
workspace (integer)
Example request:
GET /api/workspaces/{workspace}/elements/export-jsonl/ HTTP/1.1 Host: example.com
- Status Codes:
200 OK – Newline-delimited JSON stream.