Skip to main content

Resources API Schema and Attributes

Schema Endpoint

The Resources API provides a comprehensive OpenAPI schema that describes all available resources, their properties, validation rules, and available operations.

Accessing the Schema

curl -X GET https://api0.spaaza.com/resources/schema \
-H "X-Spaaza-Chain-ID: {chain_id}" \
-H "X-Spaaza-API-version: 1.6.1" \
-H "X-Spaaza-Session-User-ID: {your user ID}" \
-H "X-Spaaza-Session-Key: {your key}"

Schema Structure

The schema response includes the following OpenAPI elements:

  • components - Reusable objects and schemas included in the OpenAPI specification
  • info - Metadata about the API including contact details and version information
  • openapi - The OpenAPI specification version being used
  • paths - All available API endpoints with their supported methods and parameters
  • servers - Array of servers providing connectivity information
  • tags - List of tags used to group related endpoints

The schema provides complete documentation of all resource properties, including standard OpenAPI attributes (type, format, validation rules) and custom Spaaza vendor extensions (recursion levels, filter properties, operation support).

Spaaza Vendor Attributes

Spaaza vendor attributes are custom extensions to the OpenAPI specification that provide additional metadata about resource properties. These attributes control various aspects of API behavior and are prefixed with spaaza- in the underlying schema but documented without the prefix for clarity.

Available Spaaza Vendor Attributes

AttributeDescription
recursionLevelControls at which API response detail levels (0-4) the property is included. Lower numbers mean the property appears in more minimal responses. Level 0 properties are always included, while higher levels provide increasingly detailed information.
filter-propertyIndicates the property can be used to filter results when retrieving multiple resources using plural endpoints (e.g., /resources/businesses). Properties with this attribute can be used as query parameters to narrow down result sets.
fulltext-searchIndicates the property supports text search with partial matching. Properties with this attribute can be searched using the search[property]=value syntax. See Text Search for details.
identifierMarks the property as an alternative identifier that can be used instead of the numeric ID for single resource operations (GET, PATCH, PUT, DELETE). This allows resources to be accessed using business-meaningful identifiers like owner codes.
operationsSpecifies which HTTP methods (get, post, put, patch, delete) can use this property as a parameter. This controls which API operations accept the property in requests.
required-inLists the operations where this property is required (e.g., ["post"] means required when creating resources). This ensures mandatory fields are provided for specific operations.
immutableIndicates the property cannot be changed after resource creation. Attempts to modify immutable properties in PUT or PATCH requests will be ignored or may result in errors.
sort-by-propertyEnables the property for sorting results when retrieving multiple resources. Properties with this attribute can be used with the sort_by parameter to order result sets.

These attributes help developers understand how properties behave in different API contexts and which properties are available for filtering, identification, sorting, and operation-specific requirements.

Standard Attributes

Standard attributes are part of the OpenAPI specification and define the basic characteristics and validation rules for resource properties.

Common Standard Attributes

AttributeDescription
typeThe data type of the property (string, integer, float, boolean, object, array). Defines the expected format of the property value.
nullableWhether the property can have a null value (true/false). When true, the property accepts null in addition to its specified type.
readOnlyIndicates the property is read-only and cannot be modified via API requests (true/false). Read-only properties are typically system-generated values like IDs or timestamps.
requiredFor object types, specifies which nested properties are required. Lists the mandatory fields that must be present in object values.
minLengthMinimum length for string properties. Enforces that string values contain at least this many characters.
maxLengthMaximum length for string properties. Limits string values to this maximum number of characters.
minimumMinimum value for numeric properties (integer, float). Ensures numeric values are not below this threshold.
maximumMaximum value for numeric properties (integer, float). Ensures numeric values do not exceed this threshold.
patternRegular expression pattern that string values must match. Provides format validation for strings like email addresses, phone numbers, or codes.
defaultDefault value used when the property is not specified in requests. The API will use this value if the property is omitted.
exampleExample value demonstrating proper usage of the property. Helps developers understand the expected format and content.

These attributes ensure data consistency and provide validation rules that are enforced by the API when creating or updating resources.