API Documentation

API Endpoint

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
Requestsreturns survey_fields

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
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "34",
      "type": "survey_fields",
      "attributes": {
        "created_at": "2025-08-02T06:23:59.555+02:00",
        "updated_at": "2025-08-02T06:23:59.555+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": "2326"
          }
        },
        "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 fields
GET/api/v2/survey_fields


GET /api/v2/survey_fields/1
Requestsreturns survey_field

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
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "36",
    "type": "survey_fields",
    "attributes": {
      "created_at": "2025-08-02T06:23:59.664+02:00",
      "updated_at": "2025-08-02T06:23:59.664+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": "2327"
        }
      },
      "survey": {
        "meta": {
          "included": false
        }
      },
      "origin_field": {
        "meta": {
          "included": false
        }
      },
      "options": {
        "meta": {
          "included": false
        }
      },
      "custom_field_people": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets a survey field
GET/api/v2/survey_fields/{id}

URI Parameters
HideShow
id
number (required) Example: 1

survey field id


POST /api/v2/survey_fields
Requestscreates survey field when params validreturns errors when params invalid

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
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "37",
    "type": "survey_fields",
    "attributes": {
      "created_at": "2025-08-02T06:23:59.791+02:00",
      "updated_at": "2025-08-02T06:23:59.791+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": "2328"
        }
      },
      "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
    }
  }
}
Responses422
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 field
POST/api/v2/survey_fields

URI Parameters
HideShow
survey_id
number (required) Example: 1

survey id

data_type_id
number (required) Example: 1

data type id

name
string (required) Example: Survey+Field+name

survey field name

origin_field_id
number (optional) Example: 1

origin field id


PATCH /api/v2/survey_fields/1
Requestsupdates survey field when validreturns error

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"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "38",
    "type": "survey_fields",
    "attributes": {
      "created_at": "2025-08-02T06:23:59.963+02:00",
      "updated_at": "2025-08-02T06:23:59.975+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": "2330"
        }
      },
      "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
    }
  }
}
Responses422
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 field
PATCH/api/v2/survey_fields/{id}

URI Parameters
HideShow
id
number (required) Example: 1

survey field id


PATCH /api/v2/survey_fields/1/archive
Requestsarchives survey field

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
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "40",
    "type": "survey_fields",
    "attributes": {
      "created_at": "2025-08-02T06:24:00.150+02:00",
      "updated_at": "2025-08-02T06:24:00.174+02:00",
      "name": "Custom field no.35",
      "data_type_id": 3,
      "required": false,
      "description": null,
      "archived_at": "2025-08-02T06:24:00.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": "2332"
        }
      },
      "survey": {
        "meta": {
          "included": false
        }
      },
      "origin_field": {
        "meta": {
          "included": false
        }
      },
      "options": {
        "meta": {
          "included": false
        }
      },
      "custom_field_people": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Archives a survey field
PATCH/api/v2/survey_fields/{id}/archive

URI Parameters
HideShow
id
number (required) Example: 1

survey field id


Generated by aglio on 02 Aug 2025