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)`.

OpenAPI Specification

tyk-basic-authentication-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Tyk Dashboard Admin Additional Permissions Basic Authentication API
  version: 5.3.0
  description: 'For Tyk On-Premises installations only, the Dashboard Admin API has two endpoints and is used to set up and provision a Tyk Dashboard instance without the command line.


    In order to use the Dashboard Admin API, you''ll need to get the `admin_secret` value from your Tyk Dashboard configurations.


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


    ```

    admin-auth: <your-secret>

    ```'
servers:
- url: http://localhost/
- url: https://localhost/
security:
- ApiKeyAuth: []
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:
      nullable: true
      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
    SessionEndpointMethod:
      properties:
        limit:
          $ref: '#/components/schemas/SessionEndpointRateLimit'
        name:
          type: string
      type: object
    FieldAccessDefinition:
      properties:
        field_name:
          type: string
        limits:
          $ref: '#/components/schemas/FieldLimits'
        type_name:
          type: string
      type: object
    RateLimitSmoothing:
      nullable: true
      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
    ApiModel:
      type: object
    AccessSpec:
      properties:
        methods:
          example:
          - GET
          - PATCH
          - HEAD
          - PUT
          - DELETE
          items:
            type: string
          nullable: true
          type: array
        url:
          example: anything/rate-limit-1-per-5
          type: string
      type: object
    SessionEndpoint:
      properties:
        methods:
          items:
            $ref: '#/components/schemas/SessionEndpointMethod'
          type: array
        path:
          type: string
      type: object
    GraphqlType:
      properties:
        fields:
          items:
            type: string
          nullable: true
          type: array
        name:
          type: string
      type: object
    SessionEndpointRateLimit:
      properties:
        per:
          format: int64
          type: integer
        rate:
          format: int64
          type: integer
      type: object
    ApiResponse:
      properties:
        ID:
          type: string
        Message:
          type: string
        Meta: {}
        Status:
          type: string
      type: object
    SessionState:
      properties:
        access_rights:
          additionalProperties:
            $ref: '#/components/schemas/AccessDefinition'
          nullable: true
          type: object
        alias:
          example: portal-developer@example.org
          type: string
        allowance:
          example: 1000
          format: double
          type: number
        apply_policies:
          example:
          - 641c15dd0fffb800010197bf
          - 615d2e528bf3980001c7c6c2
          items:
            type: string
          nullable: true
          type: array
        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
              nullable: true
              type: array
          type: object
        oauth_client_id:
          type: string
        oauth_keys:
          additionalProperties:
            type: string
          nullable: true
          type: object
        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
          nullable: true
          type: array
        throttle_interval:
          example: 10
          format: double
          type: number
        throttle_retry_limit:
          example: -1
          type: integer
      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
    FieldLimits:
      properties:
        max_query_depth:
          type: integer
      type: object
    AccessDefinition:
      properties:
        allowance_scope:
          type: string
        allowed_types:
          items:
            $ref: '#/components/schemas/GraphqlType'
          nullable: true
          type: array
        allowed_urls:
          items:
            $ref: '#/components/schemas/AccessSpec'
          nullable: true
          type: array
        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'
          nullable: true
          type: array
        limit:
          $ref: '#/components/schemas/APILimit'
        restricted_types:
          items:
            $ref: '#/components/schemas/GraphqlType'
          nullable: true
          type: array
        versions:
          example:
          - Default
          - v2
          items:
            type: string
          nullable: true
          type: array
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Admin-Auth