API V2 Endpoints General Structure
With the introduction of our template API, we started to standardize the API responses and use a common response format.
Old endpoints are still supported and maintained unless they are marked as deprecated.
Response Format
All API endpoints that have a URL structure like https://app.passcreator.com/api/v2/... will return a JSON object with a standardized format.
Response Structure
All V2 API responses follow a consistent JSON structure containing these properties:
- Name
success- Type
- boolean
- (mandatory)
- Description
Indicates whether the request was successful (true) or failed (false).
- Name
description- Type
- string
- (mandatory)
- Description
A human-readable description of the request result.
- Name
errors- Type
- array<object>
- (mandatory)
- Description
An array of error objects. Empty array when successful, contains error details when failed. Each error object contains property and message fields.
- Name
data- Type
- array | object
- (mandatory)
- Description
Contains the actual data that has been requested. Empty array when the request fails.
- Name
statusCode- Type
- integer
- (mandatory)
- Description
The HTTP status code of the response (e.g., 200, 400).
Success Response Example
Successful response
{
"success": true,
"description": "Request succeeded",
"errors": [],
"data": [],
"statusCode": 200
}
Error Response
When a request fails, the errors array contains detailed information about what went wrong.
Error Array Structure
- Name
errors- Type
- array<object>
- (mandatory)
- Description
Array containing error objects with details about validation failures or processing errors.
Error Object Properties
Each error object in the array contains:
- Name
errors[].property- Type
- string
- (mandatory)
- Description
The name of the field that caused the error. Can be nested using dot notation (e.g., expiration.expirationDate).
- Name
errors[].message- Type
- string
- (mandatory)
- Description
A descriptive error message explaining what went wrong with this specific field.
Error Response Example
Error response
{
"success": false,
"description": "Invalid data.",
"errors": [
{
"property": "name",
"message": "The property name is required"
},
{
"property": "type",
"message": "The property type is required"
},
{
"property": "expiration.expirationDate",
"message": "The specified format was wrong. Please use Y-m-d H:i e.g. 2025-01-01 15:30"
}
],
"data": [],
"statusCode": 400
}
Status Codes
V2 endpoints use the following HTTP status codes:
- 200: Success - Request completed successfully
- 201: Created - Resource was successfully created
- 400: Bad Request - Invalid input data or validation errors
- 404: Not Found - Requested resource doesn't exist
- 409: Conflict - Resource already exists or operation conflicts with current state