The fields namespace provides API methods for retrieving custom field definitions for a Testmo project. This is useful for discovering field IDs and available option values — particularly the option IDs for dropdown and multi-select fields required when creating or updating test cases via the API.
GET /projects/{project_id}/fields
Returns a list of fields defined for the specified project.
This method uses pagination so you might need to request additional pages to retrieve all results.
project_id id required
ID of the project.
Request
page integer
Number of page to return (default: first page).
per_page integer
Maximum number of fields to return (supported: 15, 25, 50, 100; default: 100).
entity string
Filter fields by entity type (supported: repository_case, session, run_result). If omitted, fields for all entity types are returned.
"page": {
"type": "integer",
"format": "int64",
"description": "Number of page to return (default: first page)."
},
"per_page": {
"type": "integer",
"format": "int64",
"enum": [15, 25, 50, 100],
"description": "Maximum number of fields to return per page (default: 100)."
},
"entity": {
"type": "string",
"enum": ["repository_case", "session", "run_result"],
"description": "Filter fields by entity type. If omitted, fields for all entity types are returned."
}
Response
GET /api/v1/projects/1/fields
200 OK
{
"page": 1,
"prev_page": null,
"next_page": null,
"last_page": 1,
"per_page": 100,
"total": 2,
"result": [
{
"id": 1,
"entity": "repository_case",
"type": "dropdown",
"name": "Priority",
"system_name": "priority",
"column_name": "custom_priority",
"note": null,
"is_active": true,
"is_compact": false,
"is_multi": false,
"include_all": true,
"display_order": 1,
"options": [
{
"id": 1,
"field_id": 1,
"is_required": false,
"is_restricted": false,
"include_all": true,
"initial_height": null,
"default_string": null,
"default_text": null,
"default_float": null,
"float_min": null,
"float_max": null,
"default_integer": null,
"integer_min": null,
"integer_max": null,
"default_bool": null,
"default_index": 1,
"values": [
{
"id": 1,
"field_id": 1,
"option_id": 1,
"name": "Critical",
"icon": "icon-priority-critical",
"color": "#e74c3c",
"is_active": true,
"display_order": 1
},
..
]
}
]
},
..
]
}
Field types
The type field will contain one of the following string values:
| Value | Description |
|---|---|
string |
Single-line text field |
text |
Multi-line rich text field |
integer |
Integer number field |
float |
Decimal number field |
checkbox |
Boolean checkbox field |
date |
Date field |
url |
URL field |
dropdown |
Single-select dropdown field; available option IDs are listed in the values array |
multiselect |
Multi-select dropdown field; available option IDs are listed in the values array |
steps |
Test steps field |
Examples
// Get all fields for a project
GET /api/v1/projects/1/fields
// Get only test case fields
GET /api/v1/projects/1/fields?entity=repository_case
// Get only result fields
GET /api/v1/projects/1/fields?entity=run_result
// Get only session fields
GET /api/v1/projects/1/fields?entity=session
// Paginate through results (page 2, 50 per page)
GET /api/v1/projects/1/fields?page=2&per_page=50Status codes
200 401 403 404 422 429 (details)