# Validate ## Validate destination `client.logpush.validate.destination(ValidateDestinationParamsparams, RequestOptionsoptions?): ValidateDestinationResponse | null` **post** `/{accounts_or_zones}/{account_or_zone_id}/logpush/validate/destination` Validates destination. ### Parameters - `params: ValidateDestinationParams` - `destination_conf: string` Body param: Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included. - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ### Returns - `ValidateDestinationResponse` - `message?: string` - `valid?: boolean` ### 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 response = await client.logpush.validate.destination({ destination_conf: 's3://mybucket/logs?region=us-west-2', account_id: 'account_id', }); console.log(response.valid); ``` #### 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": { "message": "", "valid": true } } ``` ## Check destination exists `client.logpush.validate.destinationExists(ValidateDestinationExistsParamsparams, RequestOptionsoptions?): ValidateDestinationExistsResponse | null` **post** `/{accounts_or_zones}/{account_or_zone_id}/logpush/validate/destination/exists` Checks if there is an existing job with a destination. ### Parameters - `params: ValidateDestinationExistsParams` - `destination_conf: string` Body param: Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included. - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ### Returns - `ValidateDestinationExistsResponse` - `exists?: boolean` ### 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 response = await client.logpush.validate.destinationExists({ destination_conf: 's3://mybucket/logs?region=us-west-2', account_id: 'account_id', }); console.log(response.exists); ``` #### 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": { "exists": false } } ``` ## Validate origin `client.logpush.validate.origin(ValidateOriginParamsparams, RequestOptionsoptions?): ValidateOriginResponse | null` **post** `/{accounts_or_zones}/{account_or_zone_id}/logpush/validate/origin` Validates logpull origin with logpull_options. ### Parameters - `params: ValidateOriginParams` - `logpull_options: string | null` Body param: This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately. - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ### Returns - `ValidateOriginResponse` - `message?: string` - `valid?: boolean` ### 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 response = await client.logpush.validate.origin({ logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339', account_id: 'account_id', }); console.log(response.valid); ``` #### 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": { "message": "", "valid": true } } ``` ## Domain Types ### Validate Destination Response - `ValidateDestinationResponse` - `message?: string` - `valid?: boolean` ### Validate Destination Exists Response - `ValidateDestinationExistsResponse` - `exists?: boolean` ### Validate Origin Response - `ValidateOriginResponse` - `message?: string` - `valid?: boolean`