Tyk

Tyk Basic Authentication API

An API request made using Basic Authentication will have an Authorization header that contains the API key. The value of the Authorization header will be in the form: `Basic base64Encode(username:password)`.

Operations 1

POST /api/apis/keys/basic/{username} Create a Basic Auth User. #

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/tyk-basic-authentication-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

tyk-basic-authentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@tyk.io
    name: Tyk Technologies
    url: https://tyk.io/contact
  description: '

    ## <a name="introduction"></a> Introduction


    The Tyk Dashboard API offers granular, programmatic access to a centralised database of resources that your Tyk nodes can pull from. This API has a dynamic user administrative structure which means the secret key that is used to communicate with your Tyk nodes can be kept secret and access to the wider management functions can be handled on a user-by-user and organisation-by-organisation basis.


    A common question around using a database-backed configuration is how to programmatically add API definitions to your Tyk nodes, the Dashboard API allows much more fine-grained, secure and multi-user access to your Tyk cluster, and should be used to manage a database-backed Tyk node.


    The Tyk Dashboard API works seamlessly with the Tyk Dashboard (and the two come bundled together).


    ## <a name="security-hierarchy"></a> Security Hierarchy


    The Dashboard API provides a more structured security layer to managing Tyk nodes.


    ### Organisations, APIs and Users


    With the Dashboard API and a database-backed Tyk setup, (and to an extent with file-based API setups - if diligence is used in naming and creating definitions), the following security model is applied to the management of Upstream APIs:


    * **Organisations**: All APIs are *owned* by an organisation, this is designated by the ''OrgID'' parameter in the API Definition.

    * **Users**: All users created in the Dashboard belong to an organisation (unless an exception is made for super-administrative access).

    * **APIs**: All APIs belong to an Organisation and only Users that belong to that organisation can see the analytics for those APIs and manage their configurations.

    * **API Keys**: API Keys are designated by organisation, this means an API key that has full access rights will not be allowed to access the APIs of another organisation on the same system, but can have full access to all APIs within the organisation.

    * **Access Rights**: Access rights are stored with the key, this enables a key to give access to multiple APIs, this is defined by the session object in the core Tyk API.


    In order to use the Dashboard API, you''ll need to get the ''Tyk Dashboard API Access Credentials'' secret from your user profile on the Dashboard UI.


    The secret you set should then be sent along as a header with each Dashboard API Request in order for it to be successful:



    authorization: <your-secret>

    '
  license:
    name: Mozilla Public License Version 2.0
    url: https://github.com/TykTechnologies/tyk/blob/master/LICENSE.md
  title: Tyk Dashboard Basic Authentication API
  version: 5.7.1
servers:
- url: https://{tenant}
  variables:
    tenant:
      default: localhost:8080
      description: Your dashboard host
security:
- bearerAuth: []
tags:
- description: 'An API request made using Basic Authentication will have an Authorization header that contains the API key. The value of the Authorization header will be in the form:</br>

    `Basic base64Encode(username:password)`.'
  externalDocs:
    description: Basic Authentication.
    url: https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/basic-auth/
  name: Basic Authentication
paths:
  /api/apis/keys/basic/{username}:
    post:
      description: Create a Basic Auth user with the username specified in the path {username}. Note you have to send password via(the basic_auth_data.password field) in the request body.
      operationId: createBasicAuthUser
      parameters:
      - description: ' Username of Basic Auth user to create or update.'
        example: itachi
        in: path
        name: username
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            example:
              alias: portal-key
              allowance: 1000
              apply_policies:
              - 62a0ec9092faf50001395817
              basic_auth_data:
                password: test123
              enable_detailed_recording: true
              expires: 1718439136
              hmac_enabled: false
              is_inactive: false
              meta_data:
                tyk_developer_id: 62b3fb9a1d5e4f00017226f5
              org_id: 5e9d9544a1dcd60001d0ed20
              per: 60
              quota_max: -1
              quota_remaining: 0
              quota_renewal_rate: -1
              quota_renews: 1715847135
              rate: 1000
              tags:
              - edge-eu
              - edge
              throttle_interval: 0
              throttle_retry_limit: 0
            schema:
              $ref: '#/components/schemas/SessionState'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyData'
          description: User created successfully.
        '401':
          content:
            application/json:
              example:
                Message: Not authorised
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              example:
                Message: Request body malformed
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Unmarshalling request body failed, malformed.
        '500':
          content:
            application/json:
              example:
                Message: Failed to unmarshal Key data.
                Meta: null
                Status: Error
              schema:
                $ref: '#/components/schemas/ApiResponse'
          description: Internal server error.
      summary: Create a Basic Auth User.
      tags:
      - Basic Authentication
components:
  schemas:
    APILimit:
      properties:
        max_query_depth:
          type: integer
        per:
          format: double
          type: number
        quota_max:
          format: int64
          type: integer
        quota_remaining:
          format: int64
          type: integer
        quota_renewal_rate:
          format: int64
          type: integer
        quota_renews:
          format: int64
          type: integer
        rate:
          format: double
          type: number
        set_by_policy:
          type: boolean
        smoothing:
          $ref: '#/components/schemas/RateLimitSmoothing'
        throttle_interval:
          format: double
          type: number
        throttle_retry_limit:
          type: integer
      type:
      - object
      - 'null'
    FieldAccessDefinition:
      properties:
        field_name:
          type: string
        limits:
          $ref: '#/components/schemas/FieldLimits'
        type_name:
          type: string
      type: object
    SessionState:
      properties:
        access_rights:
          additionalProperties:
            $ref: '#/components/schemas/AccessDefinition'
          type:
          - object
          - 'null'
        alias:
          example: portal-developer@example.org
          type: string
        allowance:
          example: 1000
          format: double
          type: number
        apply_policies:
          example:
          - 641c15dd0fffb800010197bf
          - 615d2e528bf3980001c7c6c2
          items:
            type: string
          type:
          - array
          - 'null'
        apply_policy_id:
          deprecated: true
          description: deprecated use apply_policies going forward instead to send a list of policies ids
          example: 641c15dd0fffb800010197bf
          type: string
        basic_auth_data:
          properties:
            hash_type:
              example: bcrypt
              type: string
            password:
              example: testuse1
              type: string
            user:
              example: admin-user@example.org
              type: string
          type: object
        certificate:
          type: string
        data_expires:
          example: 0
          format: int64
          type: integer
        date_created:
          example: '2024-05-14T13:15:46.560506+03:00'
          format: date-time
          type: string
        enable_detailed_recording:
          example: true
          type: boolean
        expires:
          example: 1716895221
          format: int64
          type: integer
        hmac_enabled:
          example: false
          type: boolean
        hmac_string:
          type: string
        id_extractor_deadline:
          example: 0
          format: int64
          type: integer
        is_inactive:
          type: boolean
        jwt_data:
          properties:
            secret:
              type: string
          type: object
        key_id:
          type: string
        last_check:
          example: 0
          format: int64
          type: integer
        last_updated:
          example: '1715681746'
          type: string
        max_query_depth:
          example: 5
          type: integer
        meta_data:
          example:
            tyk_developer_id: 62b3fb9a1d5e4f00017226f5
        monitor:
          properties:
            trigger_limits:
              example:
              - 80
              - 60
              - 50
              items:
                format: double
                type: number
              type:
              - array
              - 'null'
          type: object
        oauth_client_id:
          type: string
        oauth_keys:
          additionalProperties:
            type: string
          type:
          - object
          - 'null'
        org_id:
          example: 5e9d9544a1dcd60001d0ed20
          type: string
        per:
          example: 60
          format: double
          type: number
        quota_max:
          example: 1710302205
          format: int64
          type: integer
        quota_remaining:
          example: 20000
          format: int64
          type: integer
        quota_renewal_rate:
          example: -1
          format: int64
          type: integer
        quota_renews:
          example: 1715681745
          format: int64
          type: integer
        rate:
          example: 1000
          format: double
          type: number
        session_lifetime:
          example: 0
          format: int64
          type: integer
        smoothing:
          $ref: '#/components/schemas/RateLimitSmoothing'
        tags:
          example:
          - edge
          - edge-eu
          items:
            type: string
          type:
          - array
          - 'null'
        throttle_interval:
          example: 10
          format: double
          type: number
        throttle_retry_limit:
          example: -1
          type: integer
      type: object
    SessionEndpointMethod:
      properties:
        limit:
          $ref: '#/components/schemas/SessionEndpointRateLimit'
        name:
          type: string
      type: object
    SessionEndpointRateLimit:
      properties:
        per:
          format: int64
          type: integer
        rate:
          format: int64
          type: integer
      type: object
    AccessDefinition:
      properties:
        allowance_scope:
          type: string
        allowed_types:
          items:
            $ref: '#/components/schemas/GraphqlType'
          type:
          - array
          - 'null'
        allowed_urls:
          items:
            $ref: '#/components/schemas/AccessSpec'
          type:
          - array
          - 'null'
        api_id:
          example: d1dfc6a927a046c54c0ed470f19757cc
          type: string
        api_name:
          example: Rate Limit Proxy API
          type: string
        disable_introspection:
          example: false
          type: boolean
        endpoints:
          items:
            $ref: '#/components/schemas/SessionEndpoint'
          type: array
        field_access_rights:
          items:
            $ref: '#/components/schemas/FieldAccessDefinition'
          type:
          - array
          - 'null'
        limit:
          $ref: '#/components/schemas/APILimit'
        restricted_types:
          items:
            $ref: '#/components/schemas/GraphqlType'
          type:
          - array
          - 'null'
        versions:
          example:
          - Default
          - v2
          items:
            type: string
          type:
          - array
          - 'null'
      type: object
    ApiModel:
      type: object
    RateLimitSmoothing:
      properties:
        delay:
          description: Delay is a hold-off between smoothing events and controls how frequently the current allowance will step up or down (in seconds).
          format: int64
          minimum: 1
          type: integer
        enabled:
          description: ' Enabled indicates if rate limit smoothing is active.'
          type: boolean
        step:
          description: Step is the increment by which the current allowance will be increased or decreased each time a smoothing event is emitted.
          format: int64
          minimum: 1
          type: integer
        threshold:
          description: Threshold is the initial rate limit beyond which smoothing will be applied. It is a count of requests during the per interval and should be less than the maximum configured rate.
          format: int64
          minimum: 1
          type: integer
        trigger:
          description: Trigger is a fraction (typically in the range 0.1-1.0) of the step at which point a smoothing event will be emitted as the request rate approaches the current allowance.
          format: double
          minimum: 0
          multipleOf: 0.01
          type: number
      type:
      - object
      - 'null'
    SessionEndpoint:
      properties:
        methods:
          items:
            $ref: '#/components/schemas/SessionEndpointMethod'
          type: array
        path:
          type: string
      type: object
    GraphqlType:
      properties:
        fields:
          items:
            type: string
          type:
          - array
          - 'null'
        name:
          type: string
      type: object
    ApiResponse:
      properties:
        ID:
          type: string
        Message:
          type: string
        Meta: {}
        Status:
          type: string
      type: object
    FieldLimits:
      properties:
        max_query_depth:
          type: integer
      type: object
    AccessSpec:
      properties:
        methods:
          example:
          - GET
          - PATCH
          - HEAD
          - PUT
          - DELETE
          items:
            type: string
          type:
          - array
          - 'null'
        url:
          example: anything/rate-limit-1-per-5
          type: string
      type: object
    KeyData:
      properties:
        api_model:
          $ref: '#/components/schemas/ApiModel'
        data:
          $ref: '#/components/schemas/SessionState'
        key_hash:
          example: 41c5cb1e
          type: string
        key_id:
          example: 5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      description: The Tyk Dashboard API Access Credentials
      scheme: bearer
      type: http