Solarware API-Dokumentation
YAML herunterladen

Telefon erstellen

post /api/v1/phones

Sicherheit

ApiKeyAuth

Parameter

Name In Typ Details
Idempotency-Key header string Optional Unique key for safe create retries (Make/Zapier/n8n). Replays the stored successful response for the same key + request body within 7 days.

Request-Body Pflicht

application/json

Beispiel

{
    "partners_id": 5,
    "country_code": "+49",
    "number": "1701234567",
    "is_primary": true
}

Schema

{
    "allOf": [
        {
            "type": "object",
            "description": "Phone fields for create/update (linked to a contact or partner).",
            "required": [
                "number"
            ],
            "properties": {
                "id": {
                    "type": "integer",
                    "description": "Existing phone id (update only)"
                },
                "contact_phone_types_id": {
                    "type": "integer"
                },
                "label": {
                    "type": "string"
                },
                "country_code": {
                    "type": "string"
                },
                "number": {
                    "type": "string"
                },
                "extension": {
                    "type": "string"
                },
                "e164_number": {
                    "type": "string"
                },
                "is_primary": {
                    "type": "boolean"
                },
                "is_whatsapp": {
                    "type": "boolean"
                },
                "is_sms_enabled": {
                    "type": "boolean"
                },
                "is_verified": {
                    "type": "boolean"
                },
                "is_active": {
                    "type": "boolean"
                }
            }
        },
        {
            "type": "object",
            "description": "Exactly one of contacts_id or partners_id is required.",
            "properties": {
                "contacts_id": {
                    "type": "integer"
                },
                "partners_id": {
                    "type": "integer"
                }
            }
        }
    ]
}

Antworten

201 Telefonnummer erstellt

application/json

{
    "allOf": [
        {
            "title": "API envelope",
            "type": "object",
            "properties": {
                "success": {
                    "type": "boolean"
                },
                "message": {
                    "type": "string",
                    "nullable": true
                },
                "errors": {
                    "nullable": true
                },
                "meta": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true
                }
            }
        },
        {
            "type": "object",
            "properties": {
                "data": {
                    "title": "Phone",
                    "type": "object",
                    "description": "Phone in responses.",
                    "required": [
                        "number",
                        "is_primary"
                    ],
                    "properties": {
                        "id": {
                            "type": "integer",
                            "nullable": true
                        },
                        "contacts_id": {
                            "type": "integer",
                            "nullable": true
                        },
                        "partners_id": {
                            "type": "integer",
                            "nullable": true
                        },
                        "label": {
                            "type": "string",
                            "nullable": true
                        },
                        "country_code": {
                            "type": "string",
                            "nullable": true
                        },
                        "number": {
                            "type": "string"
                        },
                        "extension": {
                            "type": "string",
                            "nullable": true
                        },
                        "e164_number": {
                            "type": "string",
                            "nullable": true
                        },
                        "is_primary": {
                            "type": "boolean"
                        }
                    }
                }
            }
        }
    ]
}
401 Missing or invalid API key

application/json

{
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean",
            "example": false
        },
        "message": {
            "type": "string",
            "example": "Missing API key (X-Api-Key)"
        }
    }
}
404 Resource not found

application/json

{
    "title": "API envelope",
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean"
        },
        "message": {
            "type": "string",
            "nullable": true
        },
        "errors": {
            "nullable": true
        },
        "meta": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
        }
    }
}
422 Validation failed

application/json

{
    "title": "API envelope",
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean"
        },
        "message": {
            "type": "string",
            "nullable": true
        },
        "errors": {
            "nullable": true
        },
        "meta": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
        }
    }
}