API Documentation

API Endpoint

Surveys

Surveys

The Survey object represents a form within the application.

It is the primary container for collecting user responses.

Surveys contain multiple Survey fields, which represent the questions. These fields can have various types, such as: text, number, etc.

In the application, surveys provide a structured way to gather insights and feedback, making them a key component of user interaction.

Supported filter params

  • created_at

  • creator_id

  • id

  • project_id

  • title

Supported sort params

  • id

  • title

GET /api/v2/surveys
Requestsreturns surveys

GET  /api/v2/surveys

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": "2",
      "type": "surveys",
      "attributes": {
        "title": "Survey2",
        "description": null,
        "public_uuid": "2f3809fc-9729-5a66-ab39-2d9b846cd02e",
        "submission_access": "nobody",
        "created_at": "2025-08-02T02:25:46.951+02:00",
        "updated_at": "2025-08-02T02:25:46.955+02:00"
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "2281"
          }
        },
        "project": {
          "meta": {
            "included": false
          }
        },
        "creator": {
          "meta": {
            "included": false
          }
        },
        "updater": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/surveys?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/surveys?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 surveys
GET/api/v2/surveys


GET /api/v2/surveys/1
Requestsreturns survey

GET  /api/v2/surveys/3

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": "3",
    "type": "surveys",
    "attributes": {
      "title": "Survey3",
      "description": null,
      "public_uuid": "e35cb86c-398a-584b-b8d3-b8f97b15203b",
      "submission_access": "nobody",
      "created_at": "2025-08-02T02:25:47.035+02:00",
      "updated_at": "2025-08-02T02:25:47.039+02:00"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "2282"
        }
      },
      "project": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "updater": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets a survey
GET/api/v2/surveys/{id}

URI Parameters
HideShow
id
number (required) Example: 1

survey id


POST /api/v2/surveys
Requestscreates survey when params valid

POST  /api/v2/surveys

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": "surveys",
    "attributes": {
      "title": "Survey title",
      "project_id": 2370
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "surveys",
    "attributes": {
      "title": "Survey title",
      "description": null,
      "public_uuid": "466a5b8f-73be-5793-bb79-6c247f719f61",
      "submission_access": "nobody",
      "created_at": "2025-08-02T02:25:47.120+02:00",
      "updated_at": "2025-08-02T02:25:47.125+02:00"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "2283"
        }
      },
      "project": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "updater": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Create a survey
POST/api/v2/surveys

URI Parameters
HideShow
project_id
number (required) Example: 1

project id

title
string (required) Example: Title

title

description
string (optional) Example: Description

description


PATCH /api/v2/surveys/1
Requestsupdates survey when valid

PATCH  /api/v2/surveys/5

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": "surveys",
    "attributes": {
      "title": "new title"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "5",
    "type": "surveys",
    "attributes": {
      "title": "new title",
      "description": null,
      "public_uuid": "5df7bdf1-af2c-5379-9d3d-43f5aea60600",
      "submission_access": "nobody",
      "created_at": "2025-08-02T02:25:47.271+02:00",
      "updated_at": "2025-08-02T02:25:47.290+02:00"
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "2285"
        }
      },
      "project": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "updater": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Update a survey
PATCH/api/v2/surveys/{id}

URI Parameters
HideShow
id
number (required) Example: 1

survey id


DELETE /api/v2/surveys/1
Requestsdestroyes survey

DELETE  /api/v2/surveys/7

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
Responses204
This response has no content.

Deletes a survey
DELETE/api/v2/surveys/{id}

URI Parameters
HideShow
id
number (required) Example: 1

survey id


Generated by aglio on 02 Aug 2025