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/jsonContent-Type: application/hal+json
The
application/hal+jsoncontent type includes hypermedia controls using HAL (Hypertext Application Language).
Common Field Types
| Type | Description | Example |
|---|---|---|
| string | Text data | "John Doe" |
| integer | Whole numbers | 123 |
| boolean | true/false values | true |
| datetime | ISO 8601 timestamp | "2024-01-15T10:30:00Z" |
| uuid | Unique identifier | "550e8400-e29b-41d4-a716-446655440000" |
| array | List of values | ["value1", "value2"] |
| object | Nested 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.