# `Attio.Client`
[🔗](https://github.com/sgerrand/ex_attio/blob/v0.2.0/lib/attio/client.ex#L1)

HTTP client for the Attio API.

Build a client once with `new/1` and pass it to resource functions:

    client = Attio.Client.new(api_key: System.fetch_env!("ATTIO_API_KEY"))
    {:ok, response} = Attio.Records.list(client, "people")

## Options for `new/1`

  * `:api_key` - Required. Your Attio API key (used as a Bearer token).
  * `:base_url` - Optional. Defaults to `https://api.attio.com`.

Any additional keyword options are forwarded to `Req.new/1`, which allows
test-time injection of a plug adapter:

    client = Attio.Client.new(api_key: "test", plug: {Req.Test, __MODULE__})

# `t`

```elixir
@type t() :: %Attio.Client{req: Req.Request.t()}
```

# `new`

```elixir
@spec new(keyword()) :: t()
```

Creates a new client.

Raises `KeyError` if `:api_key` is not provided.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
