# Ownership ## Get ownership challenge `client.logpush.ownership.create(OwnershipCreateParamsparams, RequestOptionsoptions?): OwnershipCreateResponse | null` **post** `/{accounts_or_zones}/{account_or_zone_id}/logpush/ownership` Gets a new ownership challenge sent to your destination. ### Parameters - `params: OwnershipCreateParams` - `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 - `OwnershipCreateResponse` - `filename?: string` - `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 ownership = await client.logpush.ownership.create({ destination_conf: 's3://mybucket/logs?region=us-west-2', account_id: 'account_id', }); console.log(ownership.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": { "filename": "logs/challenge-filename.txt", "message": "", "valid": true } } ``` ## Validate ownership challenge `client.logpush.ownership.validate(OwnershipValidateParamsparams, RequestOptionsoptions?): OwnershipValidation | null` **post** `/{accounts_or_zones}/{account_or_zone_id}/logpush/ownership/validate` Validates ownership challenge of the destination. ### Parameters - `params: OwnershipValidateParams` - `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. - `ownership_challenge: string` Body param: Ownership challenge token to prove destination ownership. - `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 - `OwnershipValidation | null` - `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 ownershipValidation = await client.logpush.ownership.validate({ destination_conf: 's3://mybucket/logs?region=us-west-2', ownership_challenge: '00000000000000000000', account_id: 'account_id', }); console.log(ownershipValidation.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": { "valid": true } } ``` ## Domain Types ### Ownership Validation - `OwnershipValidation` - `valid?: boolean` ### Ownership Create Response - `OwnershipCreateResponse` - `filename?: string` - `message?: string` - `valid?: boolean`