Uploads files, reads their metadata, and delivers their original bytes.
Inttegro stores file metadata separately from binary contents. Uploads move through processing
and safety checks before becoming available. create/3 accepts bytes, lookup/3 returns
metadata, and contents/3 returns a %Inttegro.Files.Download{} without exposing storage
provider credentials or object keys.
Upload and download
upload = %Inttegro.Files.CreateRequest{
file_name: "receipt.pdf",
bytes: File.read!("receipt.pdf"),
purpose: "order_document"
}
{:ok, file} = Inttegro.Files.create(client, upload,
idempotency_key: "receipt-order-123"
)
request = Inttegro.Files.ContentsRequest.new!(file_id: file.id)
{:ok, download} = Inttegro.Files.contents(client, request)
File.write!("downloaded-receipt.pdf", download.bytes)See the Files guide for lifecycle, delivery, and deletion behavior.
Summary
Functions
Streams original file bytes for a file owned by the authorized application, or returns a 303 redirect to a short-lived signed delivery URL when delivery is redirect.
Upload a file to Inttegro for the authorized application. The request must be multipart form data and include a binary file part plus a purpose.
Tombstones a file and schedules backing-object cleanup when allowed by reference policy.
Retrieves metadata for one file owned by the authorized application.
Lists files for the authorized application, optionally filtered by purpose, status, and creation window.
Functions
@spec contents(Inttegro.Client.t(), Inttegro.Files.ContentsRequest.t(), keyword()) :: {:ok, Inttegro.Files.Download.t()} | {:error, Exception.t()}
Streams original file bytes for a file owned by the authorized application, or returns a 303 redirect to a short-lived signed delivery URL when delivery is redirect.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Files.ContentsRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Files.Download.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Files.ContentsRequest.new!(request_attributes)
case Inttegro.Files.contents(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec create(Inttegro.Client.t(), Inttegro.Files.CreateRequest.t(), keyword()) :: {:ok, Inttegro.Files.File.t()} | {:error, Exception.t()}
Upload a file to Inttegro for the authorized application. The request must be multipart form data and include a binary file part plus a purpose.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Files.CreateRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Files.File.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Files.CreateRequest.new!(request_attributes)
case Inttegro.Files.create(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec delete(Inttegro.Client.t(), Inttegro.Files.DeleteRequest.t(), keyword()) :: {:ok, Inttegro.Files.File.t()} | {:error, Exception.t()}
Tombstones a file and schedules backing-object cleanup when allowed by reference policy.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Files.DeleteRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Files.File.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Files.DeleteRequest.new!(request_attributes)
case Inttegro.Files.delete(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec lookup(Inttegro.Client.t(), Inttegro.Files.LookupRequest.t(), keyword()) :: {:ok, Inttegro.Files.File.t()} | {:error, Exception.t()}
Retrieves metadata for one file owned by the authorized application.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Files.LookupRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Files.File.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Files.LookupRequest.new!(request_attributes)
case Inttegro.Files.lookup(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end
@spec page(Inttegro.Client.t(), Inttegro.Files.PageRequest.t(), keyword()) :: {:ok, Inttegro.Files.Page.t()} | {:error, Exception.t()}
Lists files for the authorized application, optionally filtered by purpose, status, and creation window.
Parameters
client— an authenticatedInttegro.Client.request— aInttegro.Files.PageRequestcontaining the operation input.options— request options such as:idempotency_keyand additional:headers.
Returns
Returns {:ok, Inttegro.Files.Page.t()} when Inttegro accepts and decodes the operation. Returns
{:error, exception} for API, transport, or decoding failures. A successful API response can
still describe an asynchronous resource that has not reached its terminal state.
Example
request = Inttegro.Files.PageRequest.new!(request_attributes)
case Inttegro.Files.page(client, request) do
{:ok, result} -> result
{:error, error} -> {:error, error}
end