## Replace Hostname Associations `client.certificateAuthorities.hostnameAssociations.update(HostnameAssociationUpdateParamsparams, RequestOptionsoptions?): HostnameAssociationUpdateResponse` **put** `/zones/{zone_id}/certificate_authorities/hostname_associations` Replace Hostname Associations ### Parameters - `params: HostnameAssociationUpdateParams` - `zone_id: string` Path param: Identifier. - `hostnames?: Array` Body param - `mtls_certificate_id?: string` Body param: The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the hostnames will be associated to your active Cloudflare Managed CA. ### Returns - `HostnameAssociationUpdateResponse` - `hostnames?: Array` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const hostnameAssociation = await client.certificateAuthorities.hostnameAssociations.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(hostnameAssociation.hostnames); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "hostnames": [ "api.example.com" ] } } ```