Try Devtron Enterprise!
Start Free Trial
LogoLogo
WebsiteDevtron demoGithub RepoJoin Discord
v0.5
v0.5
  • Overview
  • Getting Started
    • Install Devtron
      • Install Devtron with CI/CD integration
      • Install Devtron
      • Install Devtron on Minikube, Microk8s, K3s, Kind
      • Installation Configurations
      • Override Configurations
      • Ingress setup for Devtron Installation
    • Global Configurations
      • GitOps
      • Projects
      • Cluster And Environments
        • Namespaces And Environments
      • Git Accounts
      • Container Registries
      • Chart Repositories
      • Custom charts
      • SSO Login Service
      • Authorization
        • User Permissions
        • Permission Groups
        • API Tokens
      • Manage Notification
      • External links
    • Devtron Upgrade
      • Update Devtron from Devtron UI
      • 0.4.x-0.5.x
      • 0.4.x-0.4.x
      • 0.3.x-0.4.x
      • 0.3.x-0.3.x
      • 0.2.x-0.3.x
  • Usage
    • Applications
      • Create a new application
      • Clone an existing application
      • Deploy a sample application
      • App Configuration
        • Git Repository
        • Docker Build Configuration
        • Deployment Template
          • Deployment
          • Rollout Deployment
          • Job and Cronjob
        • Workflow Overview
        • CI Pipeline
          • Pre-Build/Post-Build Tasks
        • CI Pipeline (Legacy)
        • CD Pipeline
        • Config Maps
        • Secrets
        • Environment Overrides
        • Deleting Application
      • Build and Deploy
        • Triggering CI
        • Triggering CD
      • App Details
        • Debugging Deployment And Monitoring
        • Application Metrics
    • Charts
      • Charts Overview
      • Deploy & Observe
      • Examples
        • Deploying Mysql Helm Chart
        • Deploying MongoDB Helm Chart
      • Chart Group
    • Security
    • Bulk Edit
    • Integrations
  • Resources
    • Troubleshooting
    • Use Cases
      • Devtron Generic Helm Chart To Run CronJob Or One Time Job
      • Connect SpringBoot with Mysql Database
      • Connect Expressjs With Mongodb Database
      • Connect Django With Mysql Database
    • Telemetry Overview
  • Deprecated
    • Hyperion
Powered by GitBook
On this page
  • Generate API Token
  • Use API Token
  • Update API Token
  • Delete API Token

Was this helpful?

Export as PDF
  1. Getting Started
  2. Global Configurations
  3. Authorization

API Tokens

PreviousPermission GroupsNextManage Notification

Last updated 2 years ago

Was this helpful?

API tokens are like ordinary OAuth access tokens. They can be used instead of username and password for programmatic access to API. API token allows users to generate API tokens with the desired access. Only super admin users can generate tokens and see generated tokens.

Generate API Token

To generate API tokens, go to global configurations -> Authorizations -> API tokens and click on Generate New Token.

  1. Enter a name for the token

  2. Add Description.

  3. Select an Expiration date for the token(7 days, 30 days, 60 days, 90 days, custom and no expiration)

To select a custom expiration date, select Custom from the drop-down. This will pop-up a calender from where you can select your custom expiration date for the API token.

  1. Assign permissions to the token. To generate a token with super admin permission, select super admin permission.

Or select specific permission if you want to generate a token with a specific role over a particular Devtron app or Helm app or chart group.

  1. Now click on Generate Token.

A pop-up window will appear over the screen from where you can copy the API token.

Use API Token

Once devtron api token has been generated, you can use this token to hit devtron apis using any api testing tool like Jmeter, postman, citrus. Using postman here.

Open postman. Enter the request URL with POST method and under HEADERS, enter the API token as shown in the image below.

Now, under body, provide the api payload as shown below and click on Send.

As soon as you click on send, the create application api will be triggered and a new devtron app will be created as you mentioned in the payload.

Update API Token

To set a new expiration date or to make changes in permissions assigned to the token, we need to update the API token. To update the API token, click over the token name or click on the edit icon.

To set a new expiration date, you can regenerate the API token. Any scripts or applications using this token will need to be updated. To regenerate a token, click on regenerate token. A pop-up window will appear on the screen from where you can select a new expiration date and then click on regenerate token.

Select a new expiration date and click on regenerated token.

This will generated a new token with new expiration date.

To update API token permissions, give the permissions as you want to and click on update token.

Delete API Token

To delete an API token, click on the delete icon. Any applications or scripts using this token will no longer be able to access the Devtron API.