Skip to content

Fetching Submissions

This document provides a complete reference for API which could be used to fetch the data from your workspace.

https://api.compitcom.in

All API endpoints should be prefixed with this base URL.


Retrieve paginated form submissions with advanced filtering, ordering, and relation resolution.

POST /api/public/forms/{workspaceId}/{formSlug}/submissions

Fetches submissions from a specific form with support for pagination, filtering, ordering, and optional relation resolution.

Note: The public API only returns submissions that are published.

ParameterTypeRequiredDescription
workspaceIdstringYesThe unique identifier of the workspace
formSlugstringYesThe slug/identifier of the form to query
ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number (1-based indexing)
pageSizenumberNo100Number of records per page
filtersobjectNo-Filter criteria using AND/OR logic
orderByarrayNo-Sorting specifications
resolveRelationsbooleanNofalseWhether to resolve relation fields

Filters support complex boolean logic with AND/OR operators:

{
"filters": {
"AND": {
"data.fieldName": {
"equals": "value"
},
"data.anotherField": {
"gte": 25,
"lte": 40
}
}
}
}
OperatorDescriptionExample
equalsExact match{ "data.department": { "equals": "Engineering" } }
notNot equal{ "data.department": { "not": "Archived" } }
gtGreater than{ "salary": { "gt": 50000 } }
gteGreater than or equal to{ "age": { "gte": 25 } }
ltLess than{ "salary": { "lt": 100000 } }
lteLess than or equal to{ "age": { "lte": 40 } }
containsString contains{ "email": { "contains": "@example.com" } }
startsWithString starts with{ "name": { "startsWith": "John" } }
endsWithString ends with{ "code": { "endsWith": "_2026" } }
inValue in array{ "data.department": { "in": ["Sales", "Marketing"] } }
notInValue not in array{ "data.department": { "notIn": ["Archived"] } }
hasHas relation{ "manager": { "has": "emp_123" } }
hasEveryHas every relation{ "team_members": { "hasEvery": ["emp_1", "emp_2"] } }
hasSomeHas some relation{ "team_members": { "hasSome": ["emp_1", "emp_2"] } }
isNullIs null value{ "notes": { "isNull": true } }

The orderBy array specifies how to sort results. Priority is determined by array order:

{
"orderBy": [
{
"field": "updatedAt",
"direction": "desc"
},
{
"field": "order",
"direction": "asc"
}
]
}
PropertyTypeValuesDescription
fieldstring-Field to sort by (you can only use submittedAt, updatedAt, order)
directionstring”asc”, “desc”Sort direction
  • Media Fields: By default, media/image fields are returned as array of string IDs (e.g., ["media_456", "media_123"]). See the Media Files API guide for details on retrieving media.
  • Relation Fields: By default, relation fields return as IDs (string or string[]). Set resolveRelations: true to get full related objects.

{
"pagination": {
"page": 1,
"pageSize": 20,
"total": 150,
"totalPages": 8
},
"data": [
{
"id": "sub_123456",
"submittedAt": "2026-02-05T10:30:00Z",
"updatedAt": "2026-02-05T10:35:00Z",
"order": 1,
"data": {
"employee_name": "Alice",
"age": 28,
"department": "dept_789",
"profile_image": "media_456",
"manager": "emp_789"
}
},
{
"id": "sub_123457",
"submittedAt": "2026-02-04T14:20:00Z",
"updatedAt": "2026-02-04T14:25:00Z",
"order": 2,
"data": {
"employee_name": "Bob",
"age": 35,
"department": "dept_789",
"profile_image": "media_457",
"manager": "emp_123"
}
}
]
}
FieldTypeDescription
paginationobjectContains pagination metadata
pagination.pagenumberCurrent page number
pagination.pageSizenumberRecords per page
pagination.totalnumberTotal number of records
pagination.totalPagesnumberTotal number of pages
dataarrayArray of submission records
data[].idstringUnique submission identifier
data[].submittedAtstringISO 8601 timestamp when submitted
data[].updatedAtstringISO 8601 timestamp of last update
data[].ordernumberOrder in result set
data[].dataobjectThe actual form submission data

Relation fields point to other form submissions and are stored as IDs:

{
"data": {
"manager": "emp_123",
"team_members": ["emp_456", "emp_789"]
}
}

Without resolveRelations:

  • Returns IDs as strings or arrays of strings
  • Fast response, minimal data

With resolveRelations: true:

  • Returns full objects with all submission data
  • Larger response size
  • Single API call vs multiple calls for each relation

StatusMeaningDescription
200OKRequest successful
400Bad RequestInvalid parameters or malformed request
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error occurred
Terminal window
curl -X POST https://api.compitcom.in/api/public/forms/workspace_123/employees/submissions \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"pageSize": 20
}'

Combine multiple filters:

Terminal window
curl -X POST https://api.compitcom.in/api/public/forms/workspace_123/employees/submissions \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"pageSize": 20,
"filters": {
"data.slug": {
"equals": "abcd"
},
"AND": {
"data.employee_name": {
"equals": "Alice"
},
"data.age": {
"gte": 25,
"lte": 40
}
}
}
}'

Order by timestamp descending:

Terminal window
curl -X POST https://api.compitcom.in/api/public/forms/workspace_123/employees/submissions \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"pageSize": 10,
"orderBy": [
{ "field": "submittedAt", "direction": "desc" }
]
}'

Include full objects for relations:

Terminal window
curl -X POST https://api.compitcom.in/api/public/forms/workspace_123/employees/submissions \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"pageSize": 50,
"resolveRelations": true
}'
Terminal window
curl -X POST https://api.compitcom.in/api/public/forms/workspace_123/employees/submissions \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"pageSize": 20,
"filters": {
"AND": {
"data.employee_name": { "contains": "John" },
"data.department": { "equals": "Engineering" }
}
},
"orderBy": [
{ "field": "order", "direction": "asc" },
{ "field": "updatedAt", "direction": "desc" }
],
"resolveRelations": false
}'