Data Formats & Field Types

Understanding the formats and types used across AgentSync APIs ensures consistent integrations and reliable data handling.

Request and Response Formats

All request bodies must be in JSON format, and the following request header must be included:

  • Content-Type: application/json

API responses are compressed using gzip and will return one of the following content types:

  • Content-Type: application/json
  • Content-Type: application/hal+json

The application/hal+json content type includes hypermedia controls using HAL (Hypertext Application Language).

Common Field Types

TypeDescriptionExample
stringText data"John Doe"
integerWhole numbers123
booleantrue/false valuestrue
datetimeISO 8601 timestamp"2024-01-15T10:30:00Z"
uuidUnique identifier"550e8400-e29b-41d4-a716-446655440000"
arrayList of values["value1", "value2"]
objectNested data structure{"key": "value"}

Date Formats

All dates are in ISO 8601 format with UTC timezone:

{
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T15:45:30Z"
}

Best Practices

  • Validate inputs: Ensure requests conform to JSON schema expectations.
  • Handle gzip compression: Configure clients to automatically decompress responses.
  • Use UUIDs consistently: Treat UUIDs as immutable identifiers across systems.
  • Normalize dates: Always store and process dates in UTC to avoid timezone drift.
  • Leverage HAL links: Use hypermedia controls to navigate related resources instead of hardcoding URLs.