API Documentation
Survey Fields ¶
Survey Fields ¶
The Survey field
object represents a question inside of a form
within the application.
Data type
The data_type_id
attribute can have one of the following integer values:
-
1 (Text field)
-
2 (Number field)
-
3 (Select field)
-
4 (Date field)
-
5 (Multiple select field)
-
7 (Attachment field)
Formatting type
The formatting_type_id
attribute can have one of the following integer values:
-
1 (decimal)
-
2 (percentage)
Supported filter params
-
archived (‘true’ or ‘false’)
-
global (‘true’ or ‘false’)
-
name
-
origin_field_id
-
project_id
-
survey_id
GET /api/v2/survey_fields
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": [
{
"id": "34",
"type": "survey_fields",
"attributes": {
"created_at": "2025-08-02T02:25:50.587+02:00",
"updated_at": "2025-08-02T02:25:50.587+02:00",
"name": "Custom field no.32",
"data_type_id": 1,
"required": false,
"description": null,
"archived_at": null,
"aggregation_type_id": null,
"formatting_type_id": null,
"global": null,
"show_in_add_edit_views": true,
"sensitive": false,
"position": 1,
"quick_add_enabled": false,
"customizable_type": "survey_responses"
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2324"
}
},
"survey": {
"meta": {
"included": false
}
},
"origin_field": {
"meta": {
"included": false
}
},
"options": {
"meta": {
"included": false
}
},
"custom_field_people": {
"meta": {
"included": false
}
}
}
}
],
"links": {
"first": "http://api-test.productive.io/api/v2/survey_fields?page%5Bnumber%5D=1&page%5Bsize%5D=30",
"last": "http://api-test.productive.io/api/v2/survey_fields?page%5Bnumber%5D=1&page%5Bsize%5D=30"
},
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 1,
"page_size": 30,
"max_page_size": 200
}
}
Get survey fieldsGET/api/v2/survey_fields
GET /api/v2/survey_fields/36
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "36",
"type": "survey_fields",
"attributes": {
"created_at": "2025-08-02T02:25:50.690+02:00",
"updated_at": "2025-08-02T02:25:50.690+02:00",
"name": "Custom field no.34",
"data_type_id": 1,
"required": false,
"description": null,
"archived_at": null,
"aggregation_type_id": null,
"formatting_type_id": null,
"global": null,
"show_in_add_edit_views": true,
"sensitive": false,
"position": 1,
"quick_add_enabled": false,
"customizable_type": "survey_responses"
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2325"
}
},
"survey": {
"meta": {
"included": false
}
},
"origin_field": {
"meta": {
"included": false
}
},
"options": {
"meta": {
"included": false
}
},
"custom_field_people": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
Gets a survey fieldGET/api/v2/survey_fields/{id}
- id
number
(required) Example: 1survey field id
POST /api/v2/survey_fields
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "survey_fields",
"attributes": {
"name": "Just an another question for survey",
"survey_id": 17,
"customizable_type": "survey_responses",
"data_type_id": 1
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "37",
"type": "survey_fields",
"attributes": {
"created_at": "2025-08-02T02:25:50.799+02:00",
"updated_at": "2025-08-02T02:25:50.799+02:00",
"name": "Just an another question for survey",
"data_type_id": 1,
"required": false,
"description": null,
"archived_at": null,
"aggregation_type_id": null,
"formatting_type_id": null,
"global": true,
"show_in_add_edit_views": true,
"sensitive": false,
"position": 1,
"quick_add_enabled": false,
"customizable_type": "survey_responses"
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2326"
}
},
"survey": {
"meta": {
"included": false
}
},
"origin_field": {
"meta": {
"included": false
}
},
"options": {
"meta": {
"included": false
}
},
"custom_field_people": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
POST /api/v2/survey_fields
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "survey_fields",
"attributes": {
"name": "Just an another question for survey",
"survey_id": 18,
"customizable_type": "survey_responses",
"data_type_id": null
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "can't be blank",
"source": {
"pointer": "data/attributes/data_type_id"
}
},
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "is not included in the list",
"source": {
"pointer": "data/attributes/data_type_id"
}
}
]
}
Creates a survey fieldPOST/api/v2/survey_fields
- survey_id
number
(required) Example: 1survey id
- data_type_id
number
(required) Example: 1data type id
- name
string
(required) Example: Survey+Field+namesurvey field name
- origin_field_id
number
(optional) Example: 1origin field id
PATCH /api/v2/survey_fields/38
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "survey_fields",
"attributes": {
"name": "New name"
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "38",
"type": "survey_fields",
"attributes": {
"created_at": "2025-08-02T02:25:50.986+02:00",
"updated_at": "2025-08-02T02:25:51.001+02:00",
"name": "New name",
"data_type_id": 1,
"required": false,
"description": null,
"archived_at": null,
"aggregation_type_id": null,
"formatting_type_id": null,
"global": true,
"show_in_add_edit_views": true,
"sensitive": false,
"position": 1,
"quick_add_enabled": false,
"customizable_type": "survey_responses"
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2328"
}
},
"survey": {
"meta": {
"included": false
}
},
"origin_field": {
"meta": {
"included": false
}
},
"options": {
"meta": {
"included": false
}
},
"custom_field_people": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
PATCH /api/v2/survey_fields/39
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "survey_fields",
"attributes": {
"name": null
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "can't be blank",
"source": {
"pointer": "data/attributes/name"
}
}
]
}
Updates a survey fieldPATCH/api/v2/survey_fields/{id}
- id
number
(required) Example: 1survey field id
PATCH /api/v2/survey_fields/40/archive
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "40",
"type": "survey_fields",
"attributes": {
"created_at": "2025-08-02T02:25:51.186+02:00",
"updated_at": "2025-08-02T02:25:51.211+02:00",
"name": "Custom field no.35",
"data_type_id": 3,
"required": false,
"description": null,
"archived_at": "2025-08-02T02:25:51.000+02:00",
"aggregation_type_id": null,
"formatting_type_id": null,
"global": null,
"show_in_add_edit_views": true,
"sensitive": false,
"position": 1,
"quick_add_enabled": false,
"customizable_type": "survey_responses"
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2330"
}
},
"survey": {
"meta": {
"included": false
}
},
"origin_field": {
"meta": {
"included": false
}
},
"options": {
"meta": {
"included": false
}
},
"custom_field_people": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
Archives a survey fieldPATCH/api/v2/survey_fields/{id}/archive
- id
number
(required) Example: 1survey field id
Generated by aglio on 02 Aug 2025