> For the complete documentation index, see [llms.txt](https://max-daunarovich.gitbook.io/flow-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://max-daunarovich.gitbook.io/flow-network/introduction/accounts.md).

# Accounts

Every account can be accessed through two types:

* As a **Public Account** with the type `PublicAccount`, which represents the publicly available portion of an account.

  ```
  struct PublicAccount {

      let address: Address

      // Storage operations

      fun getCapability<T>(_ path: Path): Capability<T>?
      fun getLinkTarget(_ path: Path): Path?
  }
  ```

  Any code can get the `PublicAccount` for an account address using the built-in `getAccount` function:

  ```
  fun getAccount(_ address: Address): PublicAccount
  ```
* As an **Authorized Account** with type `AuthAccount`, which represents the authorized portion of an account.

  Access to an `AuthAccount` means having full access to its storage, public keys, and code.

  Only signed transactions can get the `AuthAccount` for an account. For each script signer of the transaction, the corresponding `AuthAccount` is passed to the `prepare` phase of the transaction.

  ```
  struct AuthAccount {

      let address: Address

      // Contract code

      fun setCode(_ code: [UInt8], ... contractInitializerArguments)

      // Key management

      fun addPublicKey(_ publicKey: [UInt8])
      fun removePublicKey(_ index: Int)

      // Storage operations

      fun save<T>(_ value: T, to: Path)
      fun load<T>(from: Path): T?
      fun copy<T: AnyStruct>(from: Path): T?

      fun borrow<T: &Any>(from: Path): T?

      fun link<T: &Any>(_ newCapabilityPath: Path, target: Path): Capability<T>?
      fun getLinkTarget(_ path: Path): Path?
      fun unlink(_ path: Path)

      fun getCapability<T: &Any>(_ path Path): Capability<T>?
  }
  ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://max-daunarovich.gitbook.io/flow-network/introduction/accounts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
