Fetching Submissions
This document provides a complete reference for API which could be used to fetch the data from your workspace.
Base URL
Section titled “Base URL”https://api.compitcom.inAll API endpoints should be prefixed with this base URL.
1. Get Form Submissions
Section titled “1. Get Form Submissions”Retrieve paginated form submissions with advanced filtering, ordering, and relation resolution.
Endpoint
Section titled “Endpoint”POST /api/public/forms/{workspaceId}/{formSlug}/submissionsDescription
Section titled “Description”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.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | The unique identifier of the workspace |
formSlug | string | Yes | The slug/identifier of the form to query |
Request Body Parameters
Section titled “Request Body Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | No | 1 | Page number (1-based indexing) |
pageSize | number | No | 100 | Number of records per page |
filters | object | No | - | Filter criteria using AND/OR logic |
orderBy | array | No | - | Sorting specifications |
resolveRelations | boolean | No | false | Whether to resolve relation fields |
Filter Structure
Section titled “Filter Structure”Filters support complex boolean logic with AND/OR operators:
{ "filters": { "AND": { "data.fieldName": { "equals": "value" }, "data.anotherField": { "gte": 25, "lte": 40 } } }}Supported Filter Operators
Section titled “Supported Filter Operators”| Operator | Description | Example |
|---|---|---|
equals | Exact match | { "data.department": { "equals": "Engineering" } } |
not | Not equal | { "data.department": { "not": "Archived" } } |
gt | Greater than | { "salary": { "gt": 50000 } } |
gte | Greater than or equal to | { "age": { "gte": 25 } } |
lt | Less than | { "salary": { "lt": 100000 } } |
lte | Less than or equal to | { "age": { "lte": 40 } } |
contains | String contains | { "email": { "contains": "@example.com" } } |
startsWith | String starts with | { "name": { "startsWith": "John" } } |
endsWith | String ends with | { "code": { "endsWith": "_2026" } } |
in | Value in array | { "data.department": { "in": ["Sales", "Marketing"] } } |
notIn | Value not in array | { "data.department": { "notIn": ["Archived"] } } |
has | Has relation | { "manager": { "has": "emp_123" } } |
hasEvery | Has every relation | { "team_members": { "hasEvery": ["emp_1", "emp_2"] } } |
hasSome | Has some relation | { "team_members": { "hasSome": ["emp_1", "emp_2"] } } |
isNull | Is null value | { "notes": { "isNull": true } } |
Ordering
Section titled “Ordering”The orderBy array specifies how to sort results. Priority is determined by array order:
{ "orderBy": [ { "field": "updatedAt", "direction": "desc" }, { "field": "order", "direction": "asc" } ]}| Property | Type | Values | Description |
|---|---|---|---|
field | string | - | Field to sort by (you can only use submittedAt, updatedAt, order) |
direction | string | ”asc”, “desc” | Sort direction |
Response Schema
Section titled “Response Schema”Important Notes
Section titled “Important Notes”- 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 (
stringorstring[]). SetresolveRelations: trueto get full related objects.
Success Response (200 OK)
Section titled “Success Response (200 OK)”{ "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" } } ]}Response Field Descriptions
Section titled “Response Field Descriptions”| Field | Type | Description |
|---|---|---|
pagination | object | Contains pagination metadata |
pagination.page | number | Current page number |
pagination.pageSize | number | Records per page |
pagination.total | number | Total number of records |
pagination.totalPages | number | Total number of pages |
data | array | Array of submission records |
data[].id | string | Unique submission identifier |
data[].submittedAt | string | ISO 8601 timestamp when submitted |
data[].updatedAt | string | ISO 8601 timestamp of last update |
data[].order | number | Order in result set |
data[].data | object | The actual form submission data |
Understanding Relations Fields
Section titled “Understanding Relations Fields”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
HTTP Status Codes
Section titled “HTTP Status Codes”| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid parameters or malformed request |
| 404 | Not Found | Resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error occurred |
Request Examples
Section titled “Request Examples”Basic Request
Section titled “Basic Request”curl -X POST https://api.compitcom.in/api/public/forms/workspace_123/employees/submissions \ -H "Content-Type: application/json" \ -d '{ "page": 1, "pageSize": 20 }'Search for Specific Records
Section titled “Search for Specific Records”Combine multiple filters:
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 } } } }'Get Most Recent Submissions
Section titled “Get Most Recent Submissions”Order by timestamp descending:
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" } ] }'Fetch with Related Data
Section titled “Fetch with Related Data”Include full objects for relations:
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 }'Advanced: Filtering and Ordering
Section titled “Advanced: Filtering and Ordering”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 }'