OLT.Infisical.API.Wrapper 10.0.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package OLT.Infisical.API.Wrapper --version 10.0.1
                    
NuGet\Install-Package OLT.Infisical.API.Wrapper -Version 10.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OLT.Infisical.API.Wrapper" Version="10.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OLT.Infisical.API.Wrapper" Version="10.0.1" />
                    
Directory.Packages.props
<PackageReference Include="OLT.Infisical.API.Wrapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OLT.Infisical.API.Wrapper --version 10.0.1
                    
#r "nuget: OLT.Infisical.API.Wrapper, 10.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OLT.Infisical.API.Wrapper@10.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OLT.Infisical.API.Wrapper&version=10.0.1
                    
Install as a Cake Addin
#tool nuget:?package=OLT.Infisical.API.Wrapper&version=10.0.1
                    
Install as a Cake Tool

OLT.Infisical.API.Wrapper - Wrapper for Infisical API

A .NET API wrapper for Infisical's secrets management endpoints. This library provides strongly-typed interfaces for interacting with Infisical's REST API, including secret creation, update, deletion, retrieval, bulk operations, and tag management.

Nuget

CI

Install the package:

dotnet add package OLT.Infisical.API.Wrapper

Overview

  • Fully async API using Task
  • Designed for .NET 8 and .NET 9
  • Uses Refit for declarative REST API calls
Add the Infisical HTTP Client to your service collection:
using OLT.Infisical.API.Wrapper;


services.AddInfisicalHttpClient(opts =>
{
    // opts.SiteUrl = "https://infisical.mydomain.com";  <-- Custom URL if needed (default is https://us.infisical.com)
    opts.ClientId = "00000000-0000-0000-0000-000000000000";
    opts.ClientSecret = "client secret here";
});

Secrets

  • Create, update, delete, and retrieve secrets
  • Bulk operations for secrets (create, update, delete)
  • Attach and detach tags to secrets
  • Query secrets with advanced filtering

Usage

  • CreateSecret - Create a new secret
  • UpdateSecret - Update an existing secret
  • DeleteSecret - Delete a secret
  • RetrieveSecret - Get a secret by name
  • ListSecrets - List all secrets
  • BulkCreate - Create multiple secrets
  • BulkUpdate - Update multiple secrets
  • BulkDelete - Delete multiple secrets
  • AttachTags - Attach tags to a secret
  • DetachTags - Detach tags from a secret

API Endpoints

Method Verb Endpoint Description
CreateSecret POST /api/v3/secrets/raw/{secretName} Create a secret
UpdateSecret PATCH /api/v3/secrets/raw/{secretName} Update a secret
DeleteSecret DELETE /api/v3/secrets/raw/{secretName} Delete a secret
RetrieveSecret GET /api/v3/secrets/raw/{secretName} Retrieve a secret
ListSecrets GET /api/v3/secrets/raw List secrets
BulkUpdate PATCH /api/v3/secrets/batch/raw Bulk update secrets
BulkCreate POST /api/v3/secrets/batch/raw Bulk create secrets
BulkDelete DELETE /api/v3/secrets/batch/raw Bulk delete secrets
AttachTags POST /api/v3/secrets/tags/{secretName} Attach tags to a secret
DetachTags DELETE /api/v3/secrets/tags/{secretName} Detach tags from a secret

public class InfisicalSecretService : IInfisicalSecretService
{
    private readonly OLT.Infisical.API.Wrapper.IInfisicalApiSecrets _infiscialSecretsApi;

    public InfisicalSecretService(OLT.Infisical.API.Wrapper.IInfisicalApiSecrets infiscialSecretsApi)
    {
        _infiscialSecretsApi = infiscialSecretsApi;
    }

    public async Task GetAllAsync(CancellationToken cancellationToken)
    {
        var query = new OLT.Infisical.API.Wrapper.Secrets.Query.InfisicalListSecretsQuery
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Environment = "prod",
            SecretPath = "/MyPath",            
            Recursive = true,
            IncludeImports = true,
        };

        var queryResult = await _infiscialSecretsApi.ListSecrets(query, cancellationToken);

        foreach (var secret in queryResult.Secrets)
        {
            //Do Stuff
            Console.WriteLine(secret.SecretPath);
            Console.WriteLine(secret.SecretKey);
            Console.WriteLine(secret.SecretValue);
        }
    }

    public async Task<string?> GetAsync(string path, string secretKey, CancellationToken cancellationToken = default)
    {
        var query = new OLT.Infisical.API.Wrapper.Secrets.Query.InfisicalGetSecretQuery
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Environment = "prod",
            SecretPath = path,            
            IncludeImports = true,
        };

        var result = await _infiscialSecretsApi.RetrieveSecret(secretKey, query, cancellationToken);
        return result.Secret?.SecretValue;
    }

    public async Task CreateSecretAsync(string path, string secretKey, string secretValue, CancellationToken cancellationToken)
    {
        var request = new OLT.Infisical.API.Wrapper.Secrets.Request.InfisicalCreateSecretRequest
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Environment = "prod",
            SecretPath = path,
            SecretValue = secretValue,
        };

        var result = await _infiscialSecretsApi.CreateSecret(secretKey, request, cancellationToken);

        Console.Write(result.Secret?.Id);
    }

    public async Task UpdateSecretAsync(string path, string secretKey, string secretValue, InfisicalEnvironmentTypes environment, CancellationToken cancellationToken)
    {
        _ = await GetOrCreateFolderAsync(path, environment, cancellationToken);

        var request = new OLT.Infisical.API.Wrapper.Secrets.Request.InfisicalUpdateSecretRequest
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Environment = "prod",
            SecretPath = path,
            SecretValue = secretValue,
        };

        var result = await _infiscialSecretsApi.UpdateSecret(secretKey, request, cancellationToken);

        Console.Write(result.Secret?.Id);
    }

    public async Task RenameSecretAsync(string path, string secretKey, string newSecretKey, InfisicalEnvironmentTypes environment, CancellationToken cancellationToken)
    {
        _ = await GetOrCreateFolderAsync(path, environment, cancellationToken);

        var request = new OLT.Infisical.API.Wrapper.Secrets.Request.InfisicalUpdateSecretRequest
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Environment = "prod",
            SecretPath = path,
            NewSecretName = newSecretKey,
        };

        var result = await _infiscialSecretsApi.UpdateSecret(secretKey, request, cancellationToken);

        Console.Write(result.Secret?.Id);

    }
}

Folders

  • Create, update, delete, and retrieve folders
  • Query folders with advanced filtering

Usage

  • CreateFolder - Create a new folder
  • UpdateFolder - Update a folder
  • DeleteFolder - Delete a folder
  • GetFolder - Get folder by id
  • ListFolders - List all folders

API Endpoints

Method Verb Endpoint Description
CreateFolder POST /api/v3/folders Create a folder
UpdateFolder PATCH /api/v3/folders/{folderName} Update a folder
DeleteFolder DELETE /api/v3/folders/{folderName} Delete a folder
GetFolderByID GET /api/v3/folders/{id} Get folder by ID
ListFolders GET /api/v3/folders List folders

public class InfisicalFolderService : IInfisicalFolderService
{
    private readonly OLT.Infisical.API.Wrapper.IInfisicalApiFolders _infiscialFoldersApi;

    public InfisicalSecretService(OLT.Infisical.API.Wrapper.IInfisicalApiFolders infiscialFoldersApi)
    {
        _infiscialFoldersApi = infiscialFoldersApi;
    }

    public async Task GetAllAsync(CancellationToken cancellationToken)
    {
        var query = new OLT.Infisical.API.Wrapper.Folders.Query.InfisicalListFoldersQuery
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Path = "/MyPath",
            Environment = "prod"
        };

        var queryResult = await _infiscialFoldersApi.ListFolders(query, cancellationToken);

        foreach (var folder in result.Folders)
        {
            //Do Stuff
            Console.WriteLine(folder.Id);
            Console.WriteLine(folder.Name);
        }
    }

    public async Task CreateAsync(CancellationToken cancellationToken)
    {
        var request = new OLT.Infisical.API.Wrapper.Folders.Requests.InfiscalCreateFolderRequest
        {
            WorkspaceId = "00000000-0000-0000-0000-000000001234",
            Environment = "prod",
            Path = "/MyPath",            
            Name = "NewFolderName"
        };

        var createFolderResult = await _infiscialFoldersApi.CreateFolder(request, cancellationToken);

        Console.WriteLine(createFolderResult.Folder.Id);
        Console.WriteLine(createFolderResult.Folder.Name);
    }
}

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.2 181 3/3/2026
10.0.1 132 2/16/2026
10.0.0 113 2/11/2026
9.1.0 141 2/11/2026
9.1.0-beta-0025 279 10/2/2025
9.1.0-beta-0020 252 9/4/2025
9.1.0-beta-0018 201 9/4/2025
9.1.0-beta-0015 242 8/26/2025