← Back to docs

API Reference

Complete REST API documentation for building integrations and automations with Squiz.

Authentication

All API requests require an API token. Include it in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

Generate an API token in your account settings →

Base URL

https://api.squiz.com/v1

All endpoints are prefixed with this base URL.

Endpoints

Authentication

POST/api/auth/signin

Sign in with email and password

POST/api/auth/signup

Create a new account

POST/api/auth/signout

Sign out current session

Quizzes

GET/api/quiz

List all quizzes for current user

POST/api/quiz

Create a new quiz

GET/api/quiz/:id

Get quiz details by ID

PUT/api/quiz/:id

Update quiz properties

DELETE/api/quiz/:id

Delete a quiz

POST/api/quiz/:id/publish

Publish a quiz

Questions

POST/api/quiz/:quizId/question

Add a question to a quiz

PUT/api/question/:id

Update a question

DELETE/api/question/:id

Delete a question

POST/api/question/:id/reorder

Reorder questions in a quiz

Responses

POST/api/quiz/:quizId/respond

Submit a quiz response

GET/api/quiz/:id/responses

Get all responses for a quiz

GET/api/quiz/:id/analytics

Get analytics for a quiz

GET/api/quiz/:id/stats

Get high-level stats

Media

POST/api/upload-image

Upload an image file (multipart form)

DELETE/api/upload/:fileId

Delete an uploaded file

Code Example

// Example: Fetch quiz analytics
const response = await fetch('/api/quiz/abc123/analytics', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  }
});

const data = await response.json();
console.log(data.dailyResponses); // Array of daily response counts
console.log(data.devices);        // Device breakdown
console.log(data.countries);      // Geographic data

Error Handling

200
OK

Request succeeded

201
Created

Resource created successfully

400
Bad Request

Invalid request parameters

401
Unauthorized

Missing or invalid API token

403
Forbidden

Access denied to resource

404
Not Found

Resource does not exist

429
Rate Limited

Too many requests

500
Server Error

Internal server error

Rate Limits

Free

100 requests/hour

Pro

1,000 requests/hour

Teams

Unlimited

Need help?

Our API team is here to help with integration questions.