cPanel External Authentication API

The ExternalAuthentication module for UAPI.

Operations 5

GET /ExternalAuthentication/configured_modules Return server's external authentication providers #
GET /ExternalAuthentication/has_external_auth_modules_configured Return external authentication user status #

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/cpanel-externalauthentication-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

cpanel-externalauthentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: cs@cpanel.net
    name: WebPros International, LLC
    url: https://cpanel.net/support/
  description: UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
  license:
    name: cPanel License
    url: https://cpanel.net/legal-notices/
  termsOfService: https://cpanel.net/legal-notices/
  title: cPanel U External Authentication API
  version: 11.137.9999.106
  x-api-evangelist-provenance: 'Harvested verbatim from cPanel''s developer portal on 2026-09-05 via the MCP tool get-full-api-description at https://api.docs.cpanel.net/mcp. ONE mechanical change was made before storage: example values containing PEM private-key or certificate blocks, and AWS-access-key-shaped example strings, were replaced with REDACTED_* placeholders so the file can be stored in a public git repository without tripping secret scanning. No path, operation, parameter, schema or description was altered, added or removed.'
servers:
- description: A server running cPanel.
  url: https://{host}:{port}/execute
  variables:
    host:
      default: cpanel-server.tld
      description: The hostname of a server running cPanel.
    port:
      default: '2083'
      description: The cPanel port.
security:
- BasicAuth: []
tags:
- description: The ExternalAuthentication module for UAPI.
  name: ExternalAuthentication
paths:
  /ExternalAuthentication/add_authn_link:
    get:
      x-readonly: false
      x-rollback: none
      description: This function adds an External Authentication authorization link to an account.
      operationId: ExternalAuthentication-add_authn_link
      parameters:
      - description: The preferred username of the account on the identity provider.
        in: query
        name: preferred_username
        required: true
        schema:
          example: Example
          type: string
      - description: The name of the identity provider.
        in: query
        name: provider_id
        required: true
        schema:
          example: google
          type: string
      - description: The unique identifier for the user at the identity provider.
        in: query
        name: subject_unique_identifier
        required: true
        schema:
          example: '123456789012345678901'
          type: string
      - description: The username.
        in: query
        name: username
        required: true
        schema:
          example: example
          format: username
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  apiversion:
                    description: The version of the API.
                    example: 3
                    type: integer
                  func:
                    description: The name of the method called.
                    example: add_authn_link
                    type: string
                  module:
                    description: The name of the module called.
                    example: ExternalAuthentication
                    type: string
                  result:
                    properties:
                      data:
                        default: null
                        type:
                        - object
                        - 'null'
                      errors:
                        description: List of errors if the API failed.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      messages:
                        description: List of messages generated by the API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      metadata:
                        properties: {}
                      status:
                        description: '- `1` - Success

                          - `0` - Failed. Check the `errors` field for more details.'
                        enum:
                        - 0
                        - 1
                        example: 1
                        type: integer
                      warnings:
                        description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                type: object
          description: HTTP Request was successful.
      summary: Add external authentication link
      tags:
      - ExternalAuthentication
      x-codeSamples:
      - label: CLI
        lang: Shell
        source: "uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  add_authn_link \\\n  username='example' \\\n  provider_id='google' \\\n  subject_unique_identifier='123456789012345678901' \\\n  preferred_username='Example'\n"
      - label: URL
        lang: HTTP
        source: https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/add_authn_link?username=example&provider_id=google&subject_unique_identifier=123456789012345678901&preferred_username=Example
      - label: LiveAPI Perl
        lang: Perl
        source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_add_authn_link.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_add_authn_link.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n    q/ExternalAuthentication/,\n    q/add_authn_link/,\n    {\n        'username' => 'example',\n        'provider_id' => 'google',\n        'subject_unique_identifier' => '123456789012345678901',\n        'preferred_username' => 'Example',\n    }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n    my $data = $response->{cpanelresult}{result}{data};\n    # Do something with the $data\n    # So you can see the data shape we print it here.\n    print to_json($data);\n}\nelse {\n    # Report errors:\n    print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n    require JSON;\n    my $str = JSON->new->pretty->encode($_[0]);\n    return $str;\n}\n"
      - label: LiveAPI PHP
        lang: PHP
        source: "<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_add_authn_link.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_add_authn_link.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n    'ExternalAuthentication',\n    'add_authn_link',\n    array (\n        'username' => 'example',\n        'provider_id' => 'google',\n        'subject_unique_identifier' => '123456789012345678901',\n        'preferred_username' => 'Example',\n    )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n    $data = $response['cpanelresult']['result']['data'];\n    // Do something with the $data\n    // So you can see the data shape we print it here.\n    print to_json($data);\n}\nelse {\n    // Report errors:\n    print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n    return json_encode($data, JSON_PRETTY_PRINT);\n}"
      x-cpanel-api-version: UAPI
      x-cpanel-available-version: cPanel 56
  /ExternalAuthentication/configured_modules:
    get:
      x-readonly: true
      description: This function lists the display information for your server's available and configured external authentication identity provider modules.
      operationId: ExternalAuthentication-configured_modules
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  apiversion:
                    description: The version of the API.
                    example: 3
                    type: integer
                  func:
                    description: The name of the method called.
                    example: configured_modules
                    type: string
                  module:
                    description: The name of the module called.
                    example: ExternalAuthentication
                    type: string
                  result:
                    properties:
                      data:
                        items:
                          properties:
                            color:
                              description: The background color of the button on the cPanel interface.
                              example: 00aef0
                              format: RGB
                              type: string
                            display_name:
                              description: The identity provider's friendly name. cPanel & WHM interfaces will display this value.
                              example: cPanel ID
                              type: string
                            documentation_url:
                              description: The public URL of the identity provider's implementation documentation.
                              example: https://go.cpanel.net/OpenIDConnect
                              format: url
                              type: string
                            icon:
                              description: The icon file to display on the button in the cPanel login interface.
                              example: iVBORw0KGgoAAAANSUhEUgAAACMAAAAhCAYAAABTERJSAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMTNFRUVGMzIyODUxMUU1OUM1RERGODcwRjIwNTQ4MCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMTNFRUVGNDIyODUxMUU1OUM1RERGODcwRjIwNTQ4MCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjExM0VFRUYxMjI4NTExRTU5QzVEREY4NzBGMjA1NDgwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjExM0VFRUYyMjI4NTExRTU5QzVEREY4NzBGMjA1NDgwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+oa0v2AAAA3VJREFUeNrsWM1uFEcQruqent3Z9Y43DmuD2YT1LoIICSIgEULKC+SaF8gr5JAnyD3XKCcChxxyyhNYiFMU5ZRTzE8UuGCQY8DGeGd3Zqrydc/ajiWjBHCEpWxLPf1T01VfV/d09TesqnRUUuQfN+5tUzMylAsRM9EOPlTJV0V9qWQg3BgLXek4+mUtpxKy+bqhAvIcLxVSlT4FHVAQITegO7Z8vGFpqeW4P+N40Iy434rNR23Hcd3ymV0wL00TNIJH6UsY2syVsrICuTlWGFJyAJlYrtVj7jUi9gZhzPQSS4tJRO+1nF1C/aThoHFfgp7n+zzjZ+GNjUWDB7yHRPYAQQnV8MCMOu04ughvPEbzztV599UHbXvOGe7OwHhsKH3jZdrKiZwhgrtcYs0ilJ6A4ffhytMpZtmAa/3s4OYuQFhg/m75IX1xtm2/XKjbw90zn3Zr19+p81W4dr5mqP0vxslkOx3+Bu6n9jOsROttf02GjlCagpmCmYI5VDD8GuP0tYYdHP72HXq3N4prTcfHEA6ev8ir2OSjLwK0jkvRoRAjNmlkFG1aGAktPxrK6NZq/o3lwh1POPtkIQ4ncqm7Y2lcqua4o4zKKr4h66ggLrSSo2zinfUrnXgPzM9r+c0P51wySE22NhTBNUEQnVGqbuZSrm6LXJhzMkit/JmVdfT/vl1QcXej+H4r91cLyrtNW/ZmrG4AydORytMRyrHXpfJgq5TL70Zy+Vgs97JCnwS5yhOgRD3fAUP+coW8qa+Q4Kxr3/72Il0dFqEtPsuubLctupdflqSyHXBEkzvFq26AfYGS/7b4hg/YDNNPewpmCuZ/DwYn5I/rI7mLY/7ZW2eUy6ujz/0ZBZoSz8a8CB50ohkRqIo57QkZiNhS6mw/qaiKwYHmySXzfwGmorZKw1LGOjb3s7K8r8o/CRXhIPXZU9Sa5Q441aVByz5CoMtXnpVfyyydQ4DtQt4DzXkjhsE+JvzwRxZ4smeToKehHpgtVzxbAuPUwDwR2Oj8XES/rueB5nbqDJCeBJo6xvZmQG8bEQ1mY3Mqifgk+jzb9H3dgzzp6S3603/m2hOv+OwmRDnFTQHLFdaphWAL8h68mpWSbRW08lBoxf8I8IQfohCrEu9VLD1Yqmel/TQOSz5oxfzxrDN2h5TyUfolcqQ+7b8EGACd0Ob6pUnq9QAAAABJRU5ErkJggg==
                              format: base64 image
                              type: string
                            icon_type:
                              description: The icon file's MIME type.
                              example: image/svg+xml
                              format: MIME
                              type: string
                            label:
                              description: The text label of the login icon in the cPanel login interface.
                              example: Log in with a cPanel ID Account
                              type: string
                            link:
                              description: link to the identity provider's configuration for the appropriate service on the system.
                              example: https://hostname.example.com:2083/openid_connect/cpanelid
                              format: url
                              type: string
                            provider_name:
                              description: The identity provider's system name.
                              example: cpanelid
                              type: string
                            textcolor:
                              description: The color of the text label in the cPanel login interface.
                              example: FFFFFF
                              format: RGB
                              type: string
                          type: object
                        type: array
                      errors:
                        description: List of errors if the API failed.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      messages:
                        description: List of messages generated by the API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      metadata:
                        properties: {}
                      status:
                        description: '- `1` - Success

                          - `0` - Failed. Check the `errors` field for more details.'
                        enum:
                        - 0
                        - 1
                        example: 1
                        type: integer
                      warnings:
                        description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                    type: object
                type: object
          description: HTTP Request was successful.
      summary: Return server's external authentication providers
      tags:
      - ExternalAuthentication
      x-codeSamples:
      - label: CLI
        lang: Shell
        source: "uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  configured_modules\n"
      - label: URL
        lang: HTTP
        source: https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/configured_modules
      - label: LiveAPI Perl
        lang: Perl
        source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_configured_modules.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_configured_modules.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n    q/ExternalAuthentication/,\n    q/configured_modules/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n    my $data = $response->{cpanelresult}{result}{data};\n    foreach my $item (@{$data}) {\n        # Do something with the $item\n    }\n\n    # So you can see the data shape we print it here.\n    print to_json($data);\n}\nelse {\n    # Report errors:\n    print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n    require JSON;\n    my $str = JSON->new->pretty->encode($_[0]);\n    return $str;\n}\n"
      - label: LiveAPI PHP
        lang: PHP
        source: "<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_configured_modules.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_configured_modules.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n    'ExternalAuthentication',\n    'configured_modules'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n    $data = $response['cpanelresult']['result']['data'];\n    foreach ($data as $item) {\n        // Do something with the $item\n    }\n\n    // So you can see the data shape we print it here.\n    print to_json($data);\n}\nelse {\n    // Report errors:\n    print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n    return json_encode($data, JSON_PRETTY_PRINT);\n}"
      x-cpanel-api-version: UAPI
      x-cpanel-available-version: cPanel 54
  /ExternalAuthentication/get_authn_links:
    get:
      x-readonly: true
      description: This function lists the external authentication links to the current cPanel account.
      operationId: ExternalAuthentication-get_authn_links
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  apiversion:
                    description: The version of the API.
                    example: 3
                    type: integer
                  func:
                    description: The name of the method called.
                    example: get_authn_links
                    type: string
                  module:
                    description: The name of the module called.
                    example: ExternalAuthentication
                    type: string
                  result:
                    properties:
                      data:
                        items:
                          properties:
                            link_time:
                              description: When the user linked their account to the identity provider.
                              example: 1443124604
                              format: unix_timestamp
                              type: integer
                            preferred_username:
                              description: The preferred username of the account on the identity provider.
                              example: username@gmail.com
                              type: string
                            provider_id:
                              description: The system's unique key for the identity provider.
                              example: google
                              type: string
                            provider_protocol:
                              description: The identity provider's protocol.
                              example: openid_connect
                              type: string
                            subject_unique_identifier:
                              description: The unique identifier for the user at the identity provider.
                              example: 123456789012346
                              type: integer
                          type: object
                        type: array
                      errors:
                        description: List of errors if the API failed.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      messages:
                        description: List of messages generated by the API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      metadata:
                        properties: {}
                      status:
                        description: '* 1 — Success

                          * 0 — Failed. Check the `errors` field for more details.'
                        enum:
                        - 0
                        - 1
                        example: 1
                        type: integer
                      warnings:
                        description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                    type: object
                type: object
          description: HTTP Request was successful.
      summary: Return external authentication links
      tags:
      - ExternalAuthentication
      x-codeSamples:
      - label: CLI
        lang: Shell
        source: "uapi --output=jsonpretty \\\n  --user=username \\\n  ExternalAuthentication \\\n  get_authn_links\n"
      - label: URL
        lang: HTTP
        source: https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/get_authn_links
      - label: LiveAPI Perl
        lang: Perl
        source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# <theme-name> is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file ExternalAuthentication_get_authn_links.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/<theme-name>/\n#    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_get_authn_links.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n    q/ExternalAuthentication/,\n    q/get_authn_links/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n    my $data = $response->{cpanelresult}{result}{data};\n    foreach my $item (@{$data}) {\n        # Do something with the $item\n    }\n\n    # So you can see the data shape we print it here.\n    print to_json($data);\n}\nelse {\n    # Report errors:\n    print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n    require JSON;\n    my $str = JSON->new->pretty->encode($_[0]);\n    return $str;\n}\n"
      - label: LiveAPI PHP
        lang: PHP
        source: "<?php\n//--------------------------------------------------------------------------------------\n// Instructions:\n//--------------------------------------------------------------------------------------\n// <theme-name> is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/<theme-name>\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file ExternalAuthentication_get_authn_links.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/<theme-name>/\n//    to .../frontend/<theme-name>/api_examples/ExternalAuthentication_get_authn_links.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n    'ExternalAuthentication',\n    'get_authn_links'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n    $data = $response['cpanelresult']['result']['data'];\n    foreach ($data as $item) {\n        // Do something with the $item\n    }\n\n    // So you can see the data shape we print it here.\n    print to_json($data);\n}\nelse {\n    // Report errors:\n    print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n    return json_encode($data, JSON_PRETTY_PRINT);\n}"
      x-cpanel-api-version: UAPI
      x-cpanel-available-version: cPanel 54
  /ExternalAuthentication/has_external_auth_modules_configured:
    get:
      x-readonly: true
      description: This function determines whether the user enabled external authentication modules.
      operationId: ExternalAuthentication-has_external_auth_modules_configured
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  apiversion:
                    description: The version of the API.
                    example: 3
                    type: integer
                  func:
                    description: The name of the method called.
                    example: has_external_auth_modules_configured
                    type: string
                  module:
                    description: The name of the module called.
                    example: ExternalAuthentication
                    type: string
                  result:
                    properties:
                      data:
                        description: 'Whether the cPanel user enabled any external modules.


                          * `1` - Enabled.

                          * `0` - **Not** enabled.


                          **Note:**


                          For more information, read our [Password and Security](https://go.cpanel.net/cpaneldocsPasswordoutputampSecurity) and [External Authentication](https://go.cpanel.net/externalauth) FAQ documentation.'
                        enum:
                        - 0
                        - 1
                        example: 1
                        type: integer
                      errors:
                        description: List of errors if the API failed.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      messages:
                        description: List of messages generated by the API.
                        example: null
                        items:
                          type: string
                        type:
                        - array
                        - 'null'
                      metadata:
                        properties: {}
                      status:
                        description: '* `1` - Success.

                          * `0` - Failed. Check the `errors` field for more details.'
                        enum:
                        - 0
                        - 1
                        example: 1
                 

# --- truncated at 32 KB (48 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/cpanel/refs/heads/main/openapi/cpanel-externalauthentication-api-openapi.yml