published on Wednesday, Nov 4, 2026 by e-breuninger
published on Wednesday, Nov 4, 2026 by e-breuninger
An API token of a user (users.token).
From the official documentation:
A token is a secret credential associated with a user which authenticates requests to NetBox’s REST and GraphQL APIs. A user may hold multiple tokens; each can be independently expired, restricted, or revoked.
Beginning with NetBox v4.5, two token versions are supported. v2 tokens (the default for newly-created tokens) are stored only as a salted HMAC digest, and the plaintext is shown to the user only once at creation time. Legacy v1 tokens store the plaintext directly; their use is deprecated and support will be removed in NetBox v5.0. See the REST API authentication documentation for the request header formats used by each version.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = netbox.getToken({
id: 123,
});
import pulumi
import pulumi_netbox as netbox
test = netbox.get_token(id=123)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netbox.LookupToken(ctx, &netbox.LookupTokenArgs{
Id: pulumi.Float64Ref(123),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var test = Netbox.GetToken.Invoke(new()
{
Id = 123,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.NetboxFunctions;
import com.pulumi.netbox.inputs.GetTokenArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var test = NetboxFunctions.getToken(GetTokenArgs.builder()
.id(123)
.build());
}
}
variables:
test:
fn::invoke:
function: netbox:getToken
arguments:
id: 123
Example coming soon!
Using getToken
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getToken(args: GetTokenArgs, opts?: InvokeOptions): Promise<GetTokenResult>
function getTokenOutput(args: GetTokenOutputArgs, opts?: InvokeOutputOptions): Output<GetTokenResult>def get_token(id: Optional[float] = None,
user_id: Optional[float] = None,
opts: Optional[InvokeOptions] = None) -> GetTokenResult
def get_token_output(id: pulumi.Input[Optional[float]] = None,
user_id: pulumi.Input[Optional[float]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetTokenResult]func LookupToken(ctx *Context, args *LookupTokenArgs, opts ...InvokeOption) (*LookupTokenResult, error)
func LookupTokenOutput(ctx *Context, args *LookupTokenOutputArgs, opts ...InvokeOption) LookupTokenResultOutput> Note: This function is named LookupToken in the Go SDK.
public static class GetToken
{
public static Task<GetTokenResult> InvokeAsync(GetTokenArgs args, InvokeOptions? opts = null)
public static Output<GetTokenResult> Invoke(GetTokenInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetTokenResult> Invoke(GetTokenInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
public static Output<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
public static Output<GetTokenResult> getToken(GetTokenArgs args, InvokeOutputOptions options)
fn::invoke:
function: netbox:index/getToken:getToken
arguments:
# arguments dictionarydata "netbox_get_token" "name" {
# arguments
}The following arguments are supported:
getToken Result
The following output properties are available:
- Created string
- Description string
- Enabled bool
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- Expires string
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- Id double
- NetBox id.
- Key string
- Identification key NetBox generated for the token; not the secret.
- Last
Used string - When the token was last used.
- Pepper
Id double - Id of the pepper the secret was hashed with.
- Token string
- Url string
- User
Id double - Id of the user the token belongs to.
- Version double
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- Write
Enabled bool - Whether the token permits write operations.
- Created string
- Description string
- Enabled bool
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- Expires string
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- Id float64
- NetBox id.
- Key string
- Identification key NetBox generated for the token; not the secret.
- Last
Used string - When the token was last used.
- Pepper
Id float64 - Id of the pepper the secret was hashed with.
- Token string
- Url string
- User
Id float64 - Id of the user the token belongs to.
- Version float64
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- Write
Enabled bool - Whether the token permits write operations.
- created string
- description string
- enabled bool
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- expires string
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- id number
- NetBox id.
- key string
- Identification key NetBox generated for the token; not the secret.
- last_
used string - When the token was last used.
- pepper_
id number - Id of the pepper the secret was hashed with.
- token string
- url string
- user_
id number - Id of the user the token belongs to.
- version number
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- write_
enabled bool - Whether the token permits write operations.
- created String
- description String
- enabled Boolean
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- expires String
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- id Double
- NetBox id.
- key String
- Identification key NetBox generated for the token; not the secret.
- last
Used String - When the token was last used.
- pepper
Id Double - Id of the pepper the secret was hashed with.
- token String
- url String
- user
Id Double - Id of the user the token belongs to.
- version Double
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- write
Enabled Boolean - Whether the token permits write operations.
- created string
- description string
- enabled boolean
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- expires string
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- id number
- NetBox id.
- key string
- Identification key NetBox generated for the token; not the secret.
- last
Used string - When the token was last used.
- pepper
Id number - Id of the pepper the secret was hashed with.
- token string
- url string
- user
Id number - Id of the user the token belongs to.
- version number
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- write
Enabled boolean - Whether the token permits write operations.
- created str
- description str
- enabled bool
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- expires str
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- id float
- NetBox id.
- key str
- Identification key NetBox generated for the token; not the secret.
- last_
used str - When the token was last used.
- pepper_
id float - Id of the pepper the secret was hashed with.
- token str
- url str
- user_
id float - Id of the user the token belongs to.
- version float
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- write_
enabled bool - Whether the token permits write operations.
- created String
- description String
- enabled Boolean
- Whether the token can authenticate; disabling keeps the token but rejects its use.
- expires String
- Expiry as an RFC 3339 timestamp with milliseconds (2030-01-01T00:00:00.000Z); never expires when unset.
- id Number
- NetBox id.
- key String
- Identification key NetBox generated for the token; not the secret.
- last
Used String - When the token was last used.
- pepper
Id Number - Id of the pepper the secret was hashed with.
- token String
- url String
- user
Id Number - Id of the user the token belongs to.
- version Number
- Token format version (1 legacy plaintext, 2 hashed). Defaults to 2. Changing it replaces the token. One of: 1, 2.
- write
Enabled Boolean - Whether the token permits write operations.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netboxTerraform Provider.
published on Wednesday, Nov 4, 2026 by e-breuninger