Add Caller Relation
POST/v1/users/{userId}/relations
Adds a relationship rule for how calls from a specific phone number should be handled.
Relation Types
- Block: Automatically reject calls from this number (caller hears busy/unavailable)
- Voicemail: Route calls directly to voicemail, bypassing screening
- Allow: Transfer calls immediately without AI screening (trusted callers)
Behavior
Relations take precedence over AI screening decisions. A number in the Allow list will never be screened, even if Hiya's reputation data indicates potential spam.
Use Cases
- Personal Blocklist: Block persistent telemarketers or unwanted callers
- VIP Callers: Allow family, doctors, or important contacts through immediately
- Voicemail Routing: Send specific callers (e.g., work after hours) directly to voicemail
Path Parameters
UUID for the given user
Header Parameters
Product version. The standard "major.minor.patch" format is highly encouraged without any leading characters; "2.1.3" or "3.0.0" for example.
The identifier of a logged-in user. Same identifier that is used for /users/{user_id}
Body
required- Block: Auto-reject calls from this caller
- Voicemail: Send all calls from this caller to voicemail
- Allow: Auto transfer (don't screen) all calls from this caller
The phone number to add a relation for (E.164 format recommended)
+14155551234Type of relation to create:
Possible values: [Block, Voicemail, Allow]
AllowResponses
- 200
- 400
- 404
- 500
OK
Response Body
- Block: Auto-reject calls from this caller
- Voicemail: Send all calls from this caller to voicemail
- Allow: Auto transfer (don't screen) all calls from this caller
relationobjectrequired
The phone number in E.164 format
Type of relation with this phone number:
Possible values: [Block, Voicemail, Allow]
The UTC timestamp of when the relation was created in ISO 8601 format (including milliseconds).
The UTC timestamp of when the relation was last updated in ISO 8601 format (including milliseconds).
Example from Schema
{
"relation": {
"phoneNumber": "string",
"relationType": "Block",
"createdAt": "string",
"updatedAt": "string"
}
}
Bad Request
Response Body
A unique error ID for tracking and support purposes. Include this ID when contacting support.
err_7f3b9c2a-1234-5678-9abc-def012345678HTTP status code mirrored in the response body for convenience.
400A developer-friendly error message with technical details for debugging.
Invalid phone number format. Expected E.164 format (e.g., +14155551234)A user-friendly error message safe to display in the UI. Localized based on the Accept-Language header when available.
The phone number you entered is not valid. Please check and try again.Example from Schema
{
"errorId": "err_7f3b9c2a-1234-5678-9abc-def012345678",
"status": 400,
"errorDescription": "Invalid phone number format. Expected E.164 format (e.g., +14155551234)",
"displayError": "The phone number you entered is not valid. Please check and try again."
}
Not Found
Response Body
A unique error ID for tracking and support purposes. Include this ID when contacting support.
err_7f3b9c2a-1234-5678-9abc-def012345678HTTP status code mirrored in the response body for convenience.
400A developer-friendly error message with technical details for debugging.
Invalid phone number format. Expected E.164 format (e.g., +14155551234)A user-friendly error message safe to display in the UI. Localized based on the Accept-Language header when available.
The phone number you entered is not valid. Please check and try again.Example from Schema
{
"errorId": "err_7f3b9c2a-1234-5678-9abc-def012345678",
"status": 400,
"errorDescription": "Invalid phone number format. Expected E.164 format (e.g., +14155551234)",
"displayError": "The phone number you entered is not valid. Please check and try again."
}
Internal Server Error
Response Body
A unique error ID for tracking and support purposes. Include this ID when contacting support.
err_7f3b9c2a-1234-5678-9abc-def012345678HTTP status code mirrored in the response body for convenience.
400A developer-friendly error message with technical details for debugging.
Invalid phone number format. Expected E.164 format (e.g., +14155551234)A user-friendly error message safe to display in the UI. Localized based on the Accept-Language header when available.
The phone number you entered is not valid. Please check and try again.Example from Schema
{
"errorId": "err_7f3b9c2a-1234-5678-9abc-def012345678",
"status": 400,
"errorDescription": "Invalid phone number format. Expected E.164 format (e.g., +14155551234)",
"displayError": "The phone number you entered is not valid. Please check and try again."
}