published on Saturday, Jul 11, 2026 by Pulumi
published on Saturday, Jul 11, 2026 by Pulumi
This resource manages Org API Tokens.
An Org API token is a unique identifier used by an application to authenticate and access the Mist APIs. These tokens are used to authenticate requests made to the API server and ensure secure access to the API. They are not bound to any specific user and provide access to the organization as a whole. Organization tokens support different privileges and can only be used for the specific organization they are generated for. Rate limiting is done on an individual token basis, so if one token reaches its rate limit, it does not impact other tokens.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as junipermist from "@pulumi/juniper-mist";
const apitokenOne = new junipermist.org.Apitoken("apitoken_one", {
orgId: terraformTest.id,
name: "apitoken_one",
privileges: [
{
scope: "site",
role: "admin",
siteId: "d7c8364e-xxxx-xxxx-xxxx-37eff0475b03",
},
{
scope: "site",
role: "read",
siteId: "08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4",
},
],
srcIps: ["1.2.3.4/32"],
});
import pulumi
import pulumi_juniper_mist as junipermist
apitoken_one = junipermist.org.Apitoken("apitoken_one",
org_id=terraform_test["id"],
name="apitoken_one",
privileges=[
{
"scope": "site",
"role": "admin",
"site_id": "d7c8364e-xxxx-xxxx-xxxx-37eff0475b03",
},
{
"scope": "site",
"role": "read",
"site_id": "08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4",
},
],
src_ips=["1.2.3.4/32"])
package main
import (
"github.com/pulumi/pulumi-junipermist/sdk/go/junipermist/org"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := org.NewApitoken(ctx, "apitoken_one", &org.ApitokenArgs{
OrgId: pulumi.Any(terraformTest.Id),
Name: pulumi.String("apitoken_one"),
Privileges: org.ApitokenPrivilegeArray{
&org.ApitokenPrivilegeArgs{
Scope: pulumi.String("site"),
Role: pulumi.String("admin"),
SiteId: pulumi.String("d7c8364e-xxxx-xxxx-xxxx-37eff0475b03"),
},
&org.ApitokenPrivilegeArgs{
Scope: pulumi.String("site"),
Role: pulumi.String("read"),
SiteId: pulumi.String("08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4"),
},
},
SrcIps: pulumi.StringArray{
pulumi.String("1.2.3.4/32"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using JuniperMist = Pulumi.JuniperMist;
return await Deployment.RunAsync(() =>
{
var apitokenOne = new JuniperMist.Org.Apitoken("apitoken_one", new()
{
OrgId = terraformTest.Id,
Name = "apitoken_one",
Privileges = new[]
{
new JuniperMist.Org.Inputs.ApitokenPrivilegeArgs
{
Scope = "site",
Role = "admin",
SiteId = "d7c8364e-xxxx-xxxx-xxxx-37eff0475b03",
},
new JuniperMist.Org.Inputs.ApitokenPrivilegeArgs
{
Scope = "site",
Role = "read",
SiteId = "08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4",
},
},
SrcIps = new[]
{
"1.2.3.4/32",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.junipermist.org.Apitoken;
import com.pulumi.junipermist.org.ApitokenArgs;
import com.pulumi.junipermist.org.inputs.ApitokenPrivilegeArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var apitokenOne = new Apitoken("apitokenOne", ApitokenArgs.builder()
.orgId(terraformTest.id())
.name("apitoken_one")
.privileges(
ApitokenPrivilegeArgs.builder()
.scope("site")
.role("admin")
.siteId("d7c8364e-xxxx-xxxx-xxxx-37eff0475b03")
.build(),
ApitokenPrivilegeArgs.builder()
.scope("site")
.role("read")
.siteId("08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4")
.build())
.srcIps("1.2.3.4/32")
.build());
}
}
resources:
apitokenOne:
type: junipermist:org:Apitoken
name: apitoken_one
properties:
orgId: ${terraformTest.id}
name: apitoken_one
privileges:
- scope: site
role: admin
siteId: d7c8364e-xxxx-xxxx-xxxx-37eff0475b03
- scope: site
role: read
siteId: 08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4
srcIps:
- 1.2.3.4/32
pulumi {
required_providers {
junipermist = {
source = "pulumi/junipermist"
}
}
}
resource "junipermist_org_apitoken" "apitoken_one" {
org_id = terraformTest.id
name = "apitoken_one"
privileges {
scope = "site"
role = "admin"
site_id = "d7c8364e-xxxx-xxxx-xxxx-37eff0475b03"
}
privileges {
scope = "site"
role = "read"
site_id = "08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4"
}
src_ips = ["1.2.3.4/32"]
}
Create Apitoken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Apitoken(name: string, args: ApitokenArgs, opts?: CustomResourceOptions);@overload
def Apitoken(resource_name: str,
args: ApitokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Apitoken(resource_name: str,
opts: Optional[ResourceOptions] = None,
org_id: Optional[str] = None,
privileges: Optional[Sequence[ApitokenPrivilegeArgs]] = None,
name: Optional[str] = None,
src_ips: Optional[Sequence[str]] = None)func NewApitoken(ctx *Context, name string, args ApitokenArgs, opts ...ResourceOption) (*Apitoken, error)public Apitoken(string name, ApitokenArgs args, CustomResourceOptions? opts = null)
public Apitoken(String name, ApitokenArgs args)
public Apitoken(String name, ApitokenArgs args, CustomResourceOptions options)
type: junipermist:org:Apitoken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "junipermist_org_apitoken" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ApitokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ApitokenArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ApitokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApitokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApitokenArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var apitokenResource = new JuniperMist.Org.Apitoken("apitokenResource", new()
{
OrgId = "string",
Privileges = new[]
{
new JuniperMist.Org.Inputs.ApitokenPrivilegeArgs
{
Role = "string",
Scope = "string",
SiteId = "string",
SitegroupId = "string",
},
},
Name = "string",
SrcIps = new[]
{
"string",
},
});
example, err := org.NewApitoken(ctx, "apitokenResource", &org.ApitokenArgs{
OrgId: pulumi.String("string"),
Privileges: org.ApitokenPrivilegeArray{
&org.ApitokenPrivilegeArgs{
Role: pulumi.String("string"),
Scope: pulumi.String("string"),
SiteId: pulumi.String("string"),
SitegroupId: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
SrcIps: pulumi.StringArray{
pulumi.String("string"),
},
})
resource "junipermist_org_apitoken" "apitokenResource" {
lifecycle {
create_before_destroy = true
}
org_id = "string"
privileges {
role = "string"
scope = "string"
site_id = "string"
sitegroup_id = "string"
}
name = "string"
src_ips = ["string"]
}
var apitokenResource = new Apitoken("apitokenResource", ApitokenArgs.builder()
.orgId("string")
.privileges(ApitokenPrivilegeArgs.builder()
.role("string")
.scope("string")
.siteId("string")
.sitegroupId("string")
.build())
.name("string")
.srcIps("string")
.build());
apitoken_resource = junipermist.org.Apitoken("apitokenResource",
org_id="string",
privileges=[{
"role": "string",
"scope": "string",
"site_id": "string",
"sitegroup_id": "string",
}],
name="string",
src_ips=["string"])
const apitokenResource = new junipermist.org.Apitoken("apitokenResource", {
orgId: "string",
privileges: [{
role: "string",
scope: "string",
siteId: "string",
sitegroupId: "string",
}],
name: "string",
srcIps: ["string"],
});
type: junipermist:org:Apitoken
properties:
name: string
orgId: string
privileges:
- role: string
scope: string
siteId: string
sitegroupId: string
srcIps:
- string
Apitoken Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Apitoken resource accepts the following input properties:
- Org
Id string - Organization that owns this API token
- Privileges
List<Pulumi.
Juniper Mist. Org. Inputs. Apitoken Privilege> - Access scopes and roles granted to the organization API token
- Name string
- Display name of the organization API token
- Src
Ips List<string> - Allowed source IP addresses or CIDRs from which the token may be used
- Org
Id string - Organization that owns this API token
- Privileges
[]Apitoken
Privilege Args - Access scopes and roles granted to the organization API token
- Name string
- Display name of the organization API token
- Src
Ips []string - Allowed source IP addresses or CIDRs from which the token may be used
- org_
id string - Organization that owns this API token
- privileges list(object)
- Access scopes and roles granted to the organization API token
- name string
- Display name of the organization API token
- src_
ips list(string) - Allowed source IP addresses or CIDRs from which the token may be used
- org
Id String - Organization that owns this API token
- privileges
List<Apitoken
Privilege> - Access scopes and roles granted to the organization API token
- name String
- Display name of the organization API token
- src
Ips List<String> - Allowed source IP addresses or CIDRs from which the token may be used
- org
Id string - Organization that owns this API token
- privileges
Apitoken
Privilege[] - Access scopes and roles granted to the organization API token
- name string
- Display name of the organization API token
- src
Ips string[] - Allowed source IP addresses or CIDRs from which the token may be used
- org_
id str - Organization that owns this API token
- privileges
Sequence[Apitoken
Privilege Args] - Access scopes and roles granted to the organization API token
- name str
- Display name of the organization API token
- src_
ips Sequence[str] - Allowed source IP addresses or CIDRs from which the token may be used
- org
Id String - Organization that owns this API token
- privileges List<Property Map>
- Access scopes and roles granted to the organization API token
- name String
- Display name of the organization API token
- src
Ips List<String> - Allowed source IP addresses or CIDRs from which the token may be used
Outputs
All input properties are implicitly available as output properties. Additionally, the Apitoken resource produces the following output properties:
- created_
by string - email of the token creator / null if creator is deleted
- id string
- The provider-assigned unique ID for this managed resource.
- key string
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- created_
by str - email of the token creator / null if creator is deleted
- id str
- The provider-assigned unique ID for this managed resource.
- key str
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
Look up Existing Apitoken Resource
Get an existing Apitoken resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ApitokenState, opts?: CustomResourceOptions): Apitoken@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_by: Optional[str] = None,
key: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
privileges: Optional[Sequence[ApitokenPrivilegeArgs]] = None,
src_ips: Optional[Sequence[str]] = None) -> Apitokenfunc GetApitoken(ctx *Context, name string, id IDInput, state *ApitokenState, opts ...ResourceOption) (*Apitoken, error)public static Apitoken Get(string name, Input<string> id, ApitokenState? state, CustomResourceOptions? opts = null)public static Apitoken get(String name, Output<String> id, ApitokenState state, CustomResourceOptions options)resources: _: type: junipermist:org:Apitoken get: id: ${id}import {
to = junipermist_org_apitoken.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created
By string - email of the token creator / null if creator is deleted
- Key string
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- Name string
- Display name of the organization API token
- Org
Id string - Organization that owns this API token
- Privileges
List<Pulumi.
Juniper Mist. Org. Inputs. Apitoken Privilege> - Access scopes and roles granted to the organization API token
- Src
Ips List<string> - Allowed source IP addresses or CIDRs from which the token may be used
- Created
By string - email of the token creator / null if creator is deleted
- Key string
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- Name string
- Display name of the organization API token
- Org
Id string - Organization that owns this API token
- Privileges
[]Apitoken
Privilege Args - Access scopes and roles granted to the organization API token
- Src
Ips []string - Allowed source IP addresses or CIDRs from which the token may be used
- created_
by string - email of the token creator / null if creator is deleted
- key string
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- name string
- Display name of the organization API token
- org_
id string - Organization that owns this API token
- privileges list(object)
- Access scopes and roles granted to the organization API token
- src_
ips list(string) - Allowed source IP addresses or CIDRs from which the token may be used
- created
By String - email of the token creator / null if creator is deleted
- key String
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- name String
- Display name of the organization API token
- org
Id String - Organization that owns this API token
- privileges
List<Apitoken
Privilege> - Access scopes and roles granted to the organization API token
- src
Ips List<String> - Allowed source IP addresses or CIDRs from which the token may be used
- created
By string - email of the token creator / null if creator is deleted
- key string
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- name string
- Display name of the organization API token
- org
Id string - Organization that owns this API token
- privileges
Apitoken
Privilege[] - Access scopes and roles granted to the organization API token
- src
Ips string[] - Allowed source IP addresses or CIDRs from which the token may be used
- created_
by str - email of the token creator / null if creator is deleted
- key str
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- name str
- Display name of the organization API token
- org_
id str - Organization that owns this API token
- privileges
Sequence[Apitoken
Privilege Args] - Access scopes and roles granted to the organization API token
- src_
ips Sequence[str] - Allowed source IP addresses or CIDRs from which the token may be used
- created
By String - email of the token creator / null if creator is deleted
- key String
- Token secret key. The full API Token is only returned when the API token is created and can only be partially retrieved afterward
- name String
- Display name of the organization API token
- org
Id String - Organization that owns this API token
- privileges List<Property Map>
- Access scopes and roles granted to the organization API token
- src
Ips List<String> - Allowed source IP addresses or CIDRs from which the token may be used
Supporting Types
ApitokenPrivilege, ApitokenPrivilegeArgs
- Role string
- Access role granted by this organization privilege
- Scope string
- Organization hierarchy level where this privilege applies
- Site
Id string - Required if
scope==site - Sitegroup
Id string - Required if
scope==sitegroup
- Role string
- Access role granted by this organization privilege
- Scope string
- Organization hierarchy level where this privilege applies
- Site
Id string - Required if
scope==site - Sitegroup
Id string - Required if
scope==sitegroup
- role string
- Access role granted by this organization privilege
- scope string
- Organization hierarchy level where this privilege applies
- site_
id string - Required if
scope==site - sitegroup_
id string - Required if
scope==sitegroup
- role String
- Access role granted by this organization privilege
- scope String
- Organization hierarchy level where this privilege applies
- site
Id String - Required if
scope==site - sitegroup
Id String - Required if
scope==sitegroup
- role string
- Access role granted by this organization privilege
- scope string
- Organization hierarchy level where this privilege applies
- site
Id string - Required if
scope==site - sitegroup
Id string - Required if
scope==sitegroup
- role str
- Access role granted by this organization privilege
- scope str
- Organization hierarchy level where this privilege applies
- site_
id str - Required if
scope==site - sitegroup_
id str - Required if
scope==sitegroup
- role String
- Access role granted by this organization privilege
- scope String
- Organization hierarchy level where this privilege applies
- site
Id String - Required if
scope==site - sitegroup
Id String - Required if
scope==sitegroup
Package Details
- Repository
- junipermist pulumi/pulumi-junipermist
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mistTerraform Provider.
published on Saturday, Jul 11, 2026 by Pulumi