1. Packages
  2. Packages
  3. Pulumi Cloud (Pulumi Service provider)
  4. API Docs
  5. api
  6. api/tokens
  7. OrgToken

This provider is currently in preview.

Viewing docs for Pulumi Cloud v1.1.0
published on Thursday, May 21, 2026 by Pulumi
pulumiservice logo

This provider is currently in preview.

Viewing docs for Pulumi Cloud v1.1.0
published on Thursday, May 21, 2026 by Pulumi

    Generates a new access token scoped to the organization for use in CI/CD pipelines and automated workflows. Organization tokens belong to the organization rather than individual users, ensuring that access is not disrupted when team members leave.

    The name field must be unique across the organization (including deleted tokens) and cannot exceed 40 characters. The expires field accepts a unix epoch timestamp up to two years from the present, or 0 for no expiry (default).

    Important: The token value in the response is only returned once at creation time and cannot be retrieved later. Audit logs for actions performed with organization tokens are attributed to the organization rather than an individual user.

    Create OrgToken Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OrgToken(name: string, args: OrgTokenArgs, opts?: CustomResourceOptions);
    @overload
    def OrgToken(resource_name: str,
                 args: OrgTokenArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrgToken(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 admin: Optional[bool] = None,
                 description: Optional[str] = None,
                 expires: Optional[int] = None,
                 name: Optional[str] = None,
                 org_name: Optional[str] = None,
                 reason: Optional[str] = None,
                 role_id: Optional[str] = None)
    func NewOrgToken(ctx *Context, name string, args OrgTokenArgs, opts ...ResourceOption) (*OrgToken, error)
    public OrgToken(string name, OrgTokenArgs args, CustomResourceOptions? opts = null)
    public OrgToken(String name, OrgTokenArgs args)
    public OrgToken(String name, OrgTokenArgs args, CustomResourceOptions options)
    
    type: pulumiservice:api/tokens:OrgToken
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "pulumiservice_api_tokens_orgtoken" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args OrgTokenArgs
    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 OrgTokenArgs
    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 OrgTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrgTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrgTokenArgs
    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 orgTokenResource = new PulumiService.Api.Tokens.OrgToken("orgTokenResource", new()
    {
        Admin = false,
        Description = "string",
        Expires = 0,
        Name = "string",
        OrgName = "string",
        Reason = "string",
        RoleID = "string",
    });
    
    example, err := tokens.NewOrgToken(ctx, "orgTokenResource", &tokens.OrgTokenArgs{
    	Admin:       pulumi.Bool(false),
    	Description: pulumi.String("string"),
    	Expires:     pulumi.Int(0),
    	Name:        pulumi.String("string"),
    	OrgName:     pulumi.String("string"),
    	Reason:      pulumi.String("string"),
    	RoleID:      pulumi.String("string"),
    })
    
    resource "pulumiservice_api_tokens_orgtoken" "orgTokenResource" {
      admin       = false
      description = "string"
      expires     = 0
      name        = "string"
      org_name    = "string"
      reason      = "string"
      role_id     = "string"
    }
    
    var orgTokenResource = new OrgToken("orgTokenResource", OrgTokenArgs.builder()
        .admin(false)
        .description("string")
        .expires(0)
        .name("string")
        .orgName("string")
        .reason("string")
        .roleID("string")
        .build());
    
    org_token_resource = pulumiservice.api.tokens.OrgToken("orgTokenResource",
        admin=False,
        description="string",
        expires=0,
        name="string",
        org_name="string",
        reason="string",
        role_id="string")
    
    const orgTokenResource = new pulumiservice.api.tokens.OrgToken("orgTokenResource", {
        admin: false,
        description: "string",
        expires: 0,
        name: "string",
        orgName: "string",
        reason: "string",
        roleID: "string",
    });
    
    type: pulumiservice:api/tokens:OrgToken
    properties:
        admin: false
        description: string
        expires: 0
        name: string
        orgName: string
        reason: string
        roleID: string
    

    OrgToken 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 OrgToken resource accepts the following input properties:

    Admin bool
    Whether the entity has admin privileges
    Description string
    The description
    Expires int
    The expiration time
    Name string
    The name
    OrgName string
    The organization name
    Reason string
    Audit log reason for creating this token
    RoleID string
    The role identifier
    Admin bool
    Whether the entity has admin privileges
    Description string
    The description
    Expires int
    The expiration time
    Name string
    The name
    OrgName string
    The organization name
    Reason string
    Audit log reason for creating this token
    RoleID string
    The role identifier
    admin bool
    Whether the entity has admin privileges
    description string
    The description
    expires number
    The expiration time
    name string
    The name
    org_name string
    The organization name
    reason string
    Audit log reason for creating this token
    role_id string
    The role identifier
    admin Boolean
    Whether the entity has admin privileges
    description String
    The description
    expires Integer
    The expiration time
    name String
    The name
    orgName String
    The organization name
    reason String
    Audit log reason for creating this token
    roleID String
    The role identifier
    admin boolean
    Whether the entity has admin privileges
    description string
    The description
    expires number
    The expiration time
    name string
    The name
    orgName string
    The organization name
    reason string
    Audit log reason for creating this token
    roleID string
    The role identifier
    admin bool
    Whether the entity has admin privileges
    description str
    The description
    expires int
    The expiration time
    name str
    The name
    org_name str
    The organization name
    reason str
    Audit log reason for creating this token
    role_id str
    The role identifier
    admin Boolean
    Whether the entity has admin privileges
    description String
    The description
    expires Number
    The expiration time
    name String
    The name
    orgName String
    The organization name
    reason String
    Audit log reason for creating this token
    roleID String
    The role identifier

    Outputs

    All input properties are implicitly available as output properties. Additionally, the OrgToken resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    TokenId string
    The unique identifier
    TokenValue string
    The token value
    Id string
    The provider-assigned unique ID for this managed resource.
    TokenId string
    The unique identifier
    TokenValue string
    The token value
    id string
    The provider-assigned unique ID for this managed resource.
    token_id string
    The unique identifier
    token_value string
    The token value
    id String
    The provider-assigned unique ID for this managed resource.
    tokenId String
    The unique identifier
    tokenValue String
    The token value
    id string
    The provider-assigned unique ID for this managed resource.
    tokenId string
    The unique identifier
    tokenValue string
    The token value
    id str
    The provider-assigned unique ID for this managed resource.
    token_id str
    The unique identifier
    token_value str
    The token value
    id String
    The provider-assigned unique ID for this managed resource.
    tokenId String
    The unique identifier
    tokenValue String
    The token value

    Package Details

    Repository
    pulumiservice pulumi/pulumi-pulumiservice
    License
    Apache-2.0
    pulumiservice logo

    This provider is currently in preview.

    Viewing docs for Pulumi Cloud v1.1.0
    published on Thursday, May 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial