defguard
  • Welcome
  • Getting help
  • About
    • About defguard
    • Features overview
  • Getting started
    • One-line install script
  • Admin Features
    • Overview
    • Zero-Trust VPN with 2FA/MFA
      • Create/manage VPN Location
      • Network overview
      • Executing custom gateway commands
      • Multi-Factor Authentication (MFA/2FA)
        • MFA Architecture
      • Remote desktop client configuration
      • DNS and domains
    • Remote user enrollment
      • User onboarding after enrollment
    • SSO (OpenID Connect)
      • Portainer
      • Grafana setup
      • Proxmox
      • Matrix / Synapse
      • Django
      • MinIO
      • Vault
    • SMTP for email notifications
    • YubiKey Provisioning
    • Webhooks
    • Forward auth
    • SSH Authentication
    • Network devices
    • Activity & Audit logs
    • Gateway notifications
    • New version notifications
  • User features
    • Overwiew
    • Desktop Client
    • CLI Client
    • Configuring VPN
      • Defguard Desktop Client
        • Update instance
      • Other WireGuard® Clients
        • Configuring a device for new VPN Location manually
    • Password change / Reset
    • Enrollment & Onboarding
      • With internal Defguard SSO
      • With external SSO (Google/Microsoft/Custom)
    • Setting up 2FA/MFA
  • Enterprise Features
    • Overview
    • Enteprise features
      • Automatic (real time) desktop client configuration & sync
      • External OpenID providers
        • Google
        • Microsoft
        • Zitadel
        • Keycloak
        • JumpCloud
        • Okta
        • Custom
      • External OIDC secure enrollment
      • VPN & Client behavior customization
      • Access Control List
        • ACL Aliases
        • Implementation Details
      • Audit Log Streaming to SIEM systems
        • Supported SIEM systems integrations
          • Vector integration guide
          • Logstash integration guide
      • LDAP and Active Directory integration
        • Configuration
        • Settings table
        • Two-way LDAP and Active Directory synchronization
      • REST API
  • Deployment strategies
    • Prerequisites
    • Standalone package based installation
    • Docker images and tags
    • Docker Compose
    • Kubernetes
    • Terraform
    • High Availability and Failover
    • Upgrading
    • Pre-production and development releases
    • Gateway
      • Running gateway on MikroTik routers
  • Securing gRPC communication
  • OpenID RSA key
  • Health check
  • Configuration
  • Tutorials
    • Step by step setting up a VPN server
      • Adding additional VPN locations
  • In depth
    • Architecture
      • How do VPN statistics work
      • Security concepts
    • Roadmap
    • Release cycle
  • For Developers
    • Contributing
    • Environment setup
      • Translations (core/web)
        • Switching language
        • Adding translations
      • Translations (client)
        • Adding translations
  • Resources
    • Troubleshooting Guide
      • Sending support information
      • Client Windows installer exit codes
      • Client "All traffic" connection issues
      • WebAuthn security keys
Powered by GitBook
On this page
  • REST API documentation
  • Generating API token
  • Setup
  • Usage

Was this helpful?

Edit on GitHub
  1. Enterprise Features
  2. Enteprise features

REST API

PreviousTwo-way LDAP and Active Directory synchronizationNextPrerequisites

Last updated 3 months ago

Was this helpful?

API functionality:

  1. requires defguard version 1.2.4+

  2. is also available without enterprise license, if your instance does not exceed the limits described here.

REST API documentation

You can explore the defguard REST API using Swagger UI by going to <YOUR_DEFGUARD_URL>/api-docs.

API specification JSON in OpenAPI format can also be fetched from <YOUR_DEFGUARD_URL>/api/v1/api-docs.

Admin users can generate API tokens to enable request authentication for custom external tools which use defguard REST API.

Tokens retain the same access permissions as their owner, so be careful when sharing them with others.

Generating API token

Setup

To generate a new API token go to your profile page and click the Add new API Tokenbutton:

Fill in your chosen token name and submit form:

Copy generated token. This is the only time the token will be available in plain text form. If you lose it you will have to generate a new one.

In the API token list you can later rename or delete a token:

Usage

defguard API uses a standard Bearer token authentication scheme.

This means that an API token can be passed in the Authorizationheader to authenticate a given request instead of a session cookie used by the web UI:

Authorization: Bearer <token>

Example GET request:

curl -H "Authorization: Bearer <token>" <YOUR_DEFGUARD_URL>/api/v1/me