> ## Documentation Index
> Fetch the complete documentation index at: https://docs.discountdrugnetwork.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Login

> Use the following endpoint to obtain an access token required for authenticating subsequent API requests to the DDN API.

## Endpoint

```http theme={null}
POST https://api.discountdrugnetwork.com/gateway/auth/login?groupId=GROUPID
```

## Input Parameters

<ResponseField name="groupId" type="string" required>
  Your group ID number.

  Example: `12345`
</ResponseField>

## Response Fields

<ResponseField name="accessToken" type="string" required>
  The JWT Authentication token to use in the Authorization Bearer header for future requests.

  Example: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`
</ResponseField>

<ResponseField name="refreshToken" type="string" required>
  The token to refresh the authentication session.

  Example: `8joiu...`
</ResponseField>

<ResponseField name="expiresIn" type="int" required>
  Number of seconds before the token expires.

  Example: `3600`
</ResponseField>

<ResponseField name="tokenType" type="string" required>
  Identifies the type of token. Typically, this will be "Bearer".

  Example: `Bearer`
</ResponseField>


## OpenAPI

````yaml POST /gateway/auth/login
openapi: 3.0.0
info:
  title: Discount Drug Network API
  version: 1.0.0
  description: >-
    API for authentication, drug searches, discount information, and related
    data.
servers:
  - url: https://api.discountdrugnetwork.com
    description: Production server
security: []
paths:
  /gateway/auth/login:
    post:
      summary: Login
      description: >-
        Obtain an access token required for authenticating subsequent API
        requests to the DDN API.
      parameters:
        - name: groupId
          in: query
          required: true
          schema:
            type: string
          description: 'Your group ID number. Example: 12345'
      responses:
        '200':
          description: Successful login
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                    description: >-
                      The JWT Authentication token to use in the Authorization
                      Bearer header for future requests.
                    example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  refreshToken:
                    type: string
                    description: The token to refresh the authentication session.
                    example: 8joiu...
                  expiresIn:
                    type: integer
                    description: Number of seconds before the token expires.
                    example: 3600
                  tokenType:
                    type: string
                    description: >-
                      Identifies the type of token. Typically, this will be
                      'Bearer'.
                    example: Bearer
        '400':
          description: Bad request - invalid parameters.
        '401':
          description: Unauthorized - invalid group ID or credentials.

````