# `client.delete_config`

Delete

Permanently deletes a configuration object.

## Endpoint

`DELETE /keys/{key}/configs/{config}`

See the [API reference](/docs/api/delete-config.md) for this endpoint.

This operation needs a Management Key. Pass it as `management_key:` to `IdealPostcodes::Client.new`, which sends it in the `Authorization` header. See [setup](/docs/sdks/ruby/setup.md).

## Signature

```ruby
def delete_config(key, config)
```

## Arguments

| Name     | Type     | Required | Description        |
| -------- | -------- | -------- | ------------------ |
| `key`    | `String` | yes      | API Key            |
| `config` | `String` | yes      | Configuration Name |

## Query Parameters

*None.*

## Response

`IdealPostcodes::Responses::DeleteConfigResponse`. Read fields with readers named as the API names them, such as `response.result`, or with `response["result"]`. `to_h` returns the decoded body.

## Errors

An HTTP error raises `IdealPostcodes::ApiError` with the HTTP `status`, the API error `code` and the decoded `body`. A transport failure raises `IdealPostcodes::TransportError`. See [error handling](/docs/sdks/ruby/errors.md).

## Example

delete-config.rbruby

```ruby
require "ideal_postcodes"

client = IdealPostcodes::Client.new(api_key: "ak_test", management_key: "uk_test")

response = client.delete_config("ak_test", "woocommerce")

puts "Deleted: #{response.result.deleted}"
```
