# LOA Documents ## Download LOA Document `client.Addressing.LOADocuments.Get(ctx, loaDocumentID, query) (*Response, error)` **get** `/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download` Download specified LOA document under the account. ### Parameters - `loaDocumentID string` Identifier for the uploaded LOA document. - `query LOADocumentGetParams` - `AccountID param.Field[string]` Identifier of a Cloudflare account. ### Returns - `type LOADocumentGetResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) loaDocument, err := client.Addressing.LOADocuments.Get( context.TODO(), "d933b1530bc56c9953cf8ce166da8004", addressing.LOADocumentGetParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", loaDocument) } ``` ## Upload LOA Document `client.Addressing.LOADocuments.New(ctx, params) (*LOADocumentNewResponse, error)` **post** `/accounts/{account_id}/addressing/loa_documents` Submit LOA document (pdf format) under the account. ### Parameters - `params LOADocumentNewParams` - `AccountID param.Field[string]` Path param: Identifier of a Cloudflare account. - `LOADocument param.Field[string]` Body param: LOA document to upload. ### Returns - `type LOADocumentNewResponse struct{…}` - `ID string` Identifier for the uploaded LOA document. - `AccountID string` Identifier of a Cloudflare account. - `AutoGenerated bool` Whether the LOA has been auto-generated for the prefix owner by Cloudflare. - `Created Time` - `Filename string` Name of LOA document. Max file size 10MB, and supported filetype is pdf. - `SizeBytes int64` File size of the uploaded LOA document. - `Verified bool` Whether the LOA has been verified by Cloudflare staff. - `VerifiedAt Time` Timestamp of the moment the LOA was marked as validated. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/addressing" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) loaDocument, err := client.Addressing.LOADocuments.New(context.TODO(), addressing.LOADocumentNewParams{ AccountID: cloudflare.F("258def64c72dae45f3e4c8516e2111f2"), LOADocument: cloudflare.F("@document.pdf"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", loaDocument.ID) } ``` #### 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": { "id": "d933b1530bc56c9953cf8ce166da8004", "account_id": "258def64c72dae45f3e4c8516e2111f2", "auto_generated": true, "created": "2014-01-01T05:20:00.12345Z", "filename": "site_loa_doc.pdf", "size_bytes": 444, "verified": true, "verified_at": "2019-12-27T18:11:19.117Z" } } ```