IBM Db2 Authentication API

The Authentication API from IBM Db2 — 3 operation(s) for authentication.

GitHub OpenAPI

Operations 3

POST /auth/tokens Request a new access token #
GET /auth/token/publickey Returns public key of Json Web Token #
PUT /auth/password Sets a new password using dswebToken #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ibm-db2:ibm-db2-authentication-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ibm-db2-authentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ibm Db2 Authentication API
  version: '4'
  termsOfService: http://www.ibm.com/software/sla/sladb.nsf
  x-github: https://github.ibm.com/cloud-api-docs/db2-saas
  x-github-issues: https://github.ibm.com/cloud-api-docs/db2-saas/issues/new
  x-last-updated: '2025-06-25'
  x-sdk-supported-languages:
  - java
  - node
  - go
  - python
  x-try-it-out-enabled: true
  description: 'Operations tagged Authentication across 2 of this provider''s published API definitions: ibm-db2-db2-on-cloud-v4-openapi.json, ibm-db2-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
security:
- authToken: []
- deploymentId: []
tags:
- name: Authentication
paths:
  /auth/tokens:
    post:
      operationId: Authenticate
      summary: Request a new access token
      description: Authenticates the user credentials and returns an access token that can be used when invoking the operations.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCredentials'
        description: User credentials
        required: true
      x-codegen-request-body-name: credentials
      security: []
      tags:
      - Authentication
      responses:
        '200':
          description: Authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationToken'
        '401':
          description: Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorContainer'
        default:
          description: Error payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorContainer'
      x-sdk-operations:
        request-examples:
          go:
          - name: Example request
            example:
            - type: code
              source:
              - "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/auth/tokens\"\n\n\tpayload := strings.NewReader(\"{\\\"userid\\\":\\\"<ADD STRING VALUE>\\\",\\\"password\\\":\\\"<ADD STRING VALUE>\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
          java:
          - name: Example request
            example:
            - type: code
              source:
              - "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"userid\\\":\\\"<ADD STRING VALUE>\\\",\\\"password\\\":\\\"<ADD STRING VALUE>\\\"}\");\nRequest request = new Request.Builder()\n  .url(\"https://{HOSTNAME}/dbapi/v4/auth/tokens\")\n  .post(body)\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n  .build();\n\nResponse response = client.newCall(request).execute();"
          node:
          - name: Example request
            example:
            - type: code
              source:
              - "var http = require(\"https\");\n\nvar options = {\n  \"method\": \"POST\",\n  \"hostname\": \"{HOSTNAME}\",\n  \"port\": null,\n  \"path\": \"/dbapi/v4/auth/tokens\",\n  \"headers\": {\n    \"content-type\": \"application/json\",\n    \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n  }\n};\n\nvar req = http.request(options, function (res) {\n  var chunks = [];\n\n  res.on(\"data\", function (chunk) {\n    chunks.push(chunk);\n  });\n\n  res.on(\"end\", function () {\n    var body = Buffer.concat(chunks);\n    console.log(body.toString());\n  });\n});\n\nreq.write(JSON.stringify({userid: '<ADD STRING VALUE>', password: '<ADD STRING VALUE>'}));\nreq.end();"
          python:
          - name: Example request
            example:
            - type: code
              source:
              - "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\npayload = \"{\\\"userid\\\":\\\"<ADD STRING VALUE>\\\",\\\"password\\\":\\\"<ADD STRING VALUE>\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'x-deployment-id': \"{DEPLOYMENT_ID}\"\n    }\n\nconn.request(\"POST\", \"/dbapi/v4/auth/tokens\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
          curl:
          - name: Example request
            example:
            - type: code
              source:
              - "curl -X POST \\\n  https://{HOSTNAME}/dbapi/v4/auth/tokens \\\n  -H 'content-type: application/json' \\\n  -H 'x-deployment-id: {DEPLOYMENT_ID}' \\\n  -d '{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}'"
    servers:
    - url: https://_HOSTNAME_VARIABLE_/dbapi/v4
  /auth/token/publickey:
    get:
      operationId: GetPublicKey
      summary: Returns public key of Json Web Token
      description: Returns public key of Json Web Token.
      tags:
      - Authentication
      responses:
        '200':
          description: Token public key and key id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationTokenPublicKey'
      x-sdk-operations:
        request-examples:
          go:
          - name: Example request
            example:
            - type: code
              source:
              - "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/auth/token/publickey\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
          java:
          - name: Example request
            example:
            - type: code
              source:
              - "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(\"https://{HOSTNAME}/dbapi/v4/auth/token/publickey\")\n  .get()\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n  .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n  .build();\n\nResponse response = client.newCall(request).execute();"
          node:
          - name: Example request
            example:
            - type: code
              source:
              - "var http = require(\"https\");\n\nvar options = {\n  \"method\": \"GET\",\n  \"hostname\": \"{HOSTNAME}\",\n  \"port\": null,\n  \"path\": \"/dbapi/v4/auth/token/publickey\",\n  \"headers\": {\n    \"content-type\": \"application/json\",\n    \"authorization\": \"Bearer {AUTH_TOKEN}\",\n    \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n  }\n};\n\nvar req = http.request(options, function (res) {\n  var chunks = [];\n\n  res.on(\"data\", function (chunk) {\n    chunks.push(chunk);\n  });\n\n  res.on(\"end\", function () {\n    var body = Buffer.concat(chunks);\n    console.log(body.toString());\n  });\n});\n\nreq.end();"
          python:
          - name: Example request
            example:
            - type: code
              source:
              - "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\nheaders = {\n    'content-type': \"application/json\",\n    'authorization': \"Bearer {AUTH_TOKEN}\",\n    'x-deployment-id': \"{DEPLOYMENT_ID}\"\n    }\n\nconn.request(\"GET\", \"/dbapi/v4/auth/token/publickey\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
          curl:
          - name: Example request
            example:
            - type: code
              source:
              - "curl -X GET \\\n  https://{HOSTNAME}/dbapi/v4/auth/token/publickey \\\n  -H 'authorization: Bearer {AUTH_TOKEN}' \\\n  -H 'content-type: application/json' \\\n  -H 'x-deployment-id: {DEPLOYMENT_ID}'"
    servers:
    - url: https://_HOSTNAME_VARIABLE_/dbapi/v4
  /auth/password:
    put:
      operationId: SetPassword
      summary: Sets a new password using dswebToken
      description: Sets a new password using the dswebToken obtained from /auth/reset.
      security: []
      tags:
      - Authentication
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPasswordReset'
        description: New password and dswebToken
        required: true
      x-codegen-request-body-name: password
      responses:
        '200':
          description: Password changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPasswordResetResponse'
        '400':
          description: Invalid or missing new password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorContainer'
        '403':
          description: If dswebToken is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorContainer'
        default:
          description: Error payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorContainer'
      x-sdk-operations:
        request-examples:
          go:
          - name: Example request
            example:
            - type: code
              source:
              - "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/auth/password\"\n\n\tpayload := strings.NewReader(\"{\\\"password\\\":\\\"<ADD STRING VALUE>\\\",\\\"dswebToken\\\":\\\"<ADD STRING VALUE>\\\"}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
          java:
          - name: Example request
            example:
            - type: code
              source:
              - "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"password\\\":\\\"<ADD STRING VALUE>\\\",\\\"dswebToken\\\":\\\"<ADD STRING VALUE>\\\"}\");\nRequest request = new Request.Builder()\n  .url(\"https://{HOSTNAME}/dbapi/v4/auth/password\")\n  .put(body)\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n  .build();\n\nResponse response = client.newCall(request).execute();"
          node:
          - name: Example request
            example:
            - type: code
              source:
              - "var http = require(\"https\");\n\nvar options = {\n  \"method\": \"PUT\",\n  \"hostname\": \"{HOSTNAME}\",\n  \"port\": null,\n  \"path\": \"/dbapi/v4/auth/password\",\n  \"headers\": {\n    \"content-type\": \"application/json\",\n    \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n  }\n};\n\nvar req = http.request(options, function (res) {\n  var chunks = [];\n\n  res.on(\"data\", function (chunk) {\n    chunks.push(chunk);\n  });\n\n  res.on(\"end\", function () {\n    var body = Buffer.concat(chunks);\n    console.log(body.toString());\n  });\n});\n\nreq.write(JSON.stringify({password: '<ADD STRING VALUE>', dswebToken: '<ADD STRING VALUE>'}));\nreq.end();"
          python:
          - name: Example request
            example:
            - type: code
              source:
              - "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\npayload = \"{\\\"password\\\":\\\"<ADD STRING VALUE>\\\",\\\"dswebToken\\\":\\\"<ADD STRING VALUE>\\\"}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'x-deployment-id': \"{DEPLOYMENT_ID}\"\n    }\n\nconn.request(\"PUT\", \"/dbapi/v4/auth/password\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
          curl:
          - name: Example request
            example:
            - type: code
              source:
              - "curl -X PUT \\\n  https://{HOSTNAME}/dbapi/v4/auth/password \\\n  -H 'content-type: application/json' \\\n  -H 'x-deployment-id: {DEPLOYMENT_ID}' \\\n  -d '{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}'"
    servers:
    - url: https://_HOSTNAME_VARIABLE_/dbapi/v4
components:
  schemas:
    AuthenticationToken:
      type: object
      description: Token generated after successful authentication.
      required:
      - userid
      - token
      properties:
        userid:
          description: User ID associated with the generated token.
          type: string
        token:
          description: Token string that can be used in subsequent requests that require authentication.
          type: string
    UserCredentials:
      type: object
      required:
      - userid
      - password
      properties:
        userid:
          type: string
          description: The user's ID
        password:
          type: string
          description: The user's password
    ErrorContainer:
      type: object
      description: Error response containing one or more error messages
      required:
      - trace
      - errors
      properties:
        trace:
          type: string
          description: Unique ID assigned by the server that identifies the request that generated the error
        errors:
          type: array
          description: List of errors
          items:
            $ref: '#/components/schemas/ErrorModel'
    UserPasswordResetResponse:
      type: object
      required:
      - code
      properties:
        code:
          type: string
          description: status code
    ErrorModel:
      type: object
      description: Error information
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: Error code succinctly identifying the problem
          enum:
          - authentication_failure
          - database_error
          - forbidden
          - internal_server_error
          - invalid_authentication_token
          - invalid_content_type
          - invalid_api_endpoint
          - invalid_parameters
          - invalid_request_payload
          - not_found
          - resource_already_exists
          - session_expired
          - unavailable
        message:
          type: string
          description: Explanation of the problem and possible solutions
        target:
          $ref: '#/components/schemas/ErrorTargetModel'
        more_info:
          type: string
          description: URL where more information about the error can be found (if available)
    AuthenticationTokenPublicKey:
      type: object
      description: Public key of token.
      required:
      - kty
      - e
      - kid
      - alg
      - n
      properties:
        kty:
          description: Public key type.
          type: string
        e:
          description: Exponent of public key.
          type: string
        kid:
          description: Key ID of public key.
          type: string
        alg:
          description: Algorithm of public key.
          type: string
        n:
          description: Modulus of public key.
          type: string
    UserPasswordReset:
      type: object
      required:
      - password
      - dswebToken
      properties:
        password:
          type: string
          description: New password
        dswebToken:
          type: string
          description: dswebToken received by email
    ErrorTargetModel:
      type: object
      description: Field or parameter related to an error
      required:
      - type
      - name
      properties:
        type:
          type: string
          description: Field type
          enum:
          - field
          - parameter
          - header
        name:
          type: string
          description: Name of the problematic field (with dot-syntax if necessary), query parameter, or header
  securitySchemes:
    authToken:
      type: apiKey
      in: header
      name: Authorization
      description: Authorize using **Bearer [access_token]**. The access token can be obtained by authenticating with the **/auth/tokens** endpoint or [use the API key to generate an IAM Bearer Token](https://cloud.ibm.com/docs/account?topic=account-iamtoken_from_apikey).
    deploymentId:
      type: apiKey
      in: header
      name: X-Deployment-Id
      description: The deployment id of the service, which can be obtained after provision. When providing the deployment id in the header, use URL encoding. For example, ":" should be escaped as "%3A", and "/" should be escaped as "%2F".
x-refined-from:
- ibm-db2-db2-on-cloud-v4-openapi.json
- ibm-db2-openapi.yml