Juniper Networks Authentication API

User login, logout, and token management.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

juniper-networks-authentication-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Juniper Networks Juniper Apstra Intent-Based Networking Alarms Authentication API
  description: RESTful API for Juniper Apstra, an intent-based networking platform for automating data center network design, deployment, and operations. Apstra abstracts network infrastructure into design blueprints with logical models, rack types, templates, and connectivity. The platform continuously validates that the network state matches the intended configuration and raises anomalies when deviations occur. The API provides full access to design resources, blueprints, device management, telemetry, and IBA (Intent-Based Analytics) probes. Authentication uses token-based sessions obtained via the login endpoint.
  version: '4.2'
  contact:
    name: Juniper Networks Support
    url: https://www.juniper.net/documentation/product/us/en/juniper-apstra/
  license:
    name: Proprietary
    url: https://www.juniper.net/us/en/legal-notices.html
servers:
- url: https://{apstra_server}/api
  description: Apstra server API endpoint.
  variables:
    apstra_server:
      description: Hostname or IP address of the Apstra server.
      default: apstra.example.com
security:
- authToken: []
tags:
- name: Authentication
  description: User login, logout, and token management.
paths:
  /aaa/login:
    post:
      operationId: login
      summary: Juniper Networks Authenticate and obtain token
      description: Authenticates with username and password, returns an authentication token for subsequent API calls. The token must be passed in the AuthToken header for all authenticated endpoints.
      tags:
      - Authentication
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - username
              - password
              properties:
                username:
                  type: string
                  description: Apstra admin username.
                password:
                  type: string
                  description: Apstra admin password.
      responses:
        '201':
          description: Authentication successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: Authentication token for API access.
                  id:
                    type: string
                    format: uuid
                    description: Session identifier.
        '401':
          description: Invalid credentials.
  /aaa/logout:
    post:
      operationId: logout
      summary: Juniper Networks Logout and invalidate token
      description: Invalidates the current authentication token.
      tags:
      - Authentication
      responses:
        '200':
          description: Logout successful.
  /self:
    get:
      operationId: getSelf
      summary: Juniper Networks Get current user information
      description: Returns the profile of the currently authenticated user, including organization and site-level privileges, email, and name.
      tags:
      - Authentication
      responses:
        '200':
          description: Current user profile returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Admin'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /self/apitokens:
    get:
      operationId: listApiTokens
      summary: Juniper Networks List API tokens
      description: Returns all API tokens created by the authenticated user. API tokens provide bearer token authentication as an alternative to session-based login and are scoped to the user's permissions.
      tags:
      - Authentication
      responses:
        '200':
          description: API tokens returned.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiToken'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createApiToken
      summary: Juniper Networks Create API token
      description: Creates a new API token for the authenticated user. The token inherits the user's organization and site privileges.
      tags:
      - Authentication
      responses:
        '200':
          description: API token created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiToken'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Admin:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Admin user unique identifier.
        name:
          type: string
          description: Admin display name.
        email:
          type: string
          format: email
          description: Admin email address.
        privileges:
          type: array
          description: List of organization and site-level privileges.
          items:
            type: object
            properties:
              scope:
                type: string
                enum:
                - org
                - site
              org_id:
                type: string
                format: uuid
              site_id:
                type: string
                format: uuid
              role:
                type: string
                enum:
                - admin
                - write
                - read
                - helpdesk
    ApiToken:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Token identifier.
        key:
          type: string
          description: API token value. Only returned on creation.
        created_time:
          type: number
          description: Creation timestamp in epoch seconds.
        last_used:
          type: number
          description: Last usage timestamp in epoch seconds.
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error description.
  responses:
    Unauthorized:
      description: Authentication required or token invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    authToken:
      type: apiKey
      in: header
      name: AuthToken
      description: Authentication token obtained from POST /api/aaa/login. Include in the AuthToken header for all authenticated API requests.