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

# Enable API key

> Enables (un-disables) an API key.

The `{key}` path parameter is the secret key (`token`) of the API key to enable.

Enabling a key is refused when it would exceed the maximum number of allowed active keys.

A `master` key can only be managed from the Dashboard.



## OpenAPI

````yaml https://api.pdfshift.io/openapi.json post /account/api/{key}/enable
openapi: 3.0.3
info:
  title: PDFShift API Documentation
  version: '3.0'
  description: >-
    This is the documentation for the PDFShift API.


    Our aim here is to provide you with a clear, concise and complete set of
    tool to generate the PDF you want.


    Don't forget to add the `sandbox` parameter to `True` while testing the API,
    this won't use your credits and generate free PDF (with a watermark).

    But if you forgot to set it, don't worry ; Send us a message and we'll reset
    your credits usage.
  termsOfService: https://pdfshift.io/terms
  contact:
    name: PDFShift
    url: https://pdfshift.io
    email: support@pdfshift.io
  x-logo:
    url: https://pdfshift.io/images/favicons/android-chrome-512x512.png
servers:
  - url: https://api.pdfshift.io/v3
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://docs.pdfshift.io
  url: https://docs.pdfshift.io
paths:
  /account/api/{key}/enable:
    post:
      tags:
        - api-keys
      summary: Enable API key
      description: >-
        Enables (un-disables) an API key.


        The `{key}` path parameter is the secret key (`token`) of the API key to
        enable.


        Enabling a key is refused when it would exceed the maximum number of
        allowed active keys.


        A `master` key can only be managed from the Dashboard.
      parameters:
        - name: key
          in: path
          required: true
          description: The secret key (token) of the API key to enable.
          schema:
            type: string
      responses:
        '200':
          description: API key enabled
          headers:
            X-RateLimit-Remaining:
              description: >-
                The number of requests remaining in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: >-
                The maximum number of requests allowed in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets (Unix
                timestamp).
              schema:
                type: integer
                format: int64
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyResult'
              example:
                success: true
                key:
                  created: 1734076868000
                  name: Production key
                  removed: null
                  token: sk_3a1f9c2b4d5e6f708192a3b4c5d6e7f8
                  public: 9f8e7d6c5b4a3928176054f3e2d1c0b9
                  last_used: 1764753251000
                  usage: 42
                  is_master: false
        '400':
          description: >-
            Bad request. Enabling this key would exceed the maximum number of
            allowed active keys.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized. Invalid auth key, missing, or disabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden. A master key can only be managed from the Dashboard.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The requested key was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests. You have been rate limited.
          headers:
            X-RateLimit-Remaining:
              description: >-
                The number of requests remaining in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: >-
                The maximum number of requests allowed in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets (Unix
                timestamp).
              schema:
                type: integer
                format: int64
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ApiKeyResult:
      type: object
      properties:
        success:
          type: boolean
        key:
          $ref: '#/components/schemas/ApiKeyObject'
    Error:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        code:
          type: integer
          format: int32
    ApiKeyObject:
      type: object
      properties:
        created:
          type: integer
          format: int64
          description: Creation date of the key, as a Unix timestamp in milliseconds.
        name:
          type: string
          default: null
          description: The name given to the key.
        removed:
          type: integer
          format: int64
          default: null
          description: >-
            Date at which the key was disabled, as a Unix timestamp in
            milliseconds. Null if the key is active.
        token:
          type: string
          description: The secret API key. Use this value to authenticate requests.
        public:
          type: string
          description: The public identifier of the key, used for converting templates.
        last_used:
          type: integer
          format: int64
          default: null
          description: >-
            Date at which the key was last used, as a Unix timestamp in
            milliseconds. Null if never used.
        usage:
          type: integer
          format: int32
          description: Number of conversions performed with this key over the last 7 days.
        is_master:
          type: boolean
          description: Whether this key has master privileges.
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.pdfshift.io/dashboard/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````