---
agentTools:
  projectIndex: https://liveconsent.readme.io/llms.txt
---

# Authentication Secret Key (recommended)

<section><p>This authentication function is the recommended alternative of using a secret key for API integrations.</p><p>It uses:</p><ul><li><code>username</code> - account email </li><li><code>developer_key</code> - API Key (public identifier) </li><li><code>secret_key</code> - Secret Key (confidential) </li></ul><p style="color: #856404; background-color: #fff3cd; border: 1px solid #ffc107; padding: 10px; border-radius: 4px;">⚠️ Secret Key is confidential and must not be shared</p><p>An authorization token is returned (valid for 1 hour) and must be included in all subsequent API calls.</p><p>Secret Key can be generated and managed from the account's Developer page.</p><p>The legacy password-based method (<code>GET https://api.liveconsent.com/LCSWS/account/authentication</code>) remains available but will be deprecated in the future.</p><p>We recommend all new integrations use this method instead.</p></section>API function usage type: <b>Standard</b>

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "LiveConsent",
    "description": "LiveConsent Web Service is a REST based web service which allows access to the LiveConsent platform through LiveConsent API.<br><br>In order to use the LiveConsent API, you must have a valid `API key` obtained from the LiveConsent Support.<br><ol><li></b> Create an account on [https://app.liveconsent.com](https://app.liveconsent.com) and/or [https://demo.liveconsent.com](https://demo.liveconsent.com) (LiveConsent test platform)<br><li>For a developer account validation, please send a request to support@liveconsent.com with the following information:<ul><li><b>email:</b> the email address associated with your LiveConsent account</li><li><b>default_callback_url (optional):</b> a valid https URL for your callback script</li><li><b>application_name (optional):</b> the name of your application; this name will be used for the button that will make a redirection to a specified URL (default_return_url or a custom URL defined for each recipient)</li><li><b>default_return_url (optional):</b> The base URL for the recipient redirection after he signed/rejected the document</li></ul><li>You will receive an API key, associated to your developer account.</ol>",
    "contact": {
      "name": "Support LiveConsent",
      "url": "https://www.liveconsent.com/contact/",
      "email": "support@liveconsent.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.8"
  },
  "servers": [
    {
      "url": "https://api.liveconsent.com/LCSWS",
      "description": "LiveConsent API",
      "variables": {}
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Authentication to Liveconsent"
    }
  ],
  "paths": {
    "/account/auth/api-secret-key": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Authentication Secret Key (recommended)",
        "description": "<section><p>This authentication function is the recommended alternative of using a secret key for API integrations.</p><p>It uses:</p><ul><li><code>username</code> - account email </li><li><code>developer_key</code> - API Key (public identifier) </li><li><code>secret_key</code> - Secret Key (confidential) </li></ul><p style=\"color: #856404; background-color: #fff3cd; border: 1px solid #ffc107; padding: 10px; border-radius: 4px;\">⚠️ Secret Key is confidential and must not be shared</p><p>An authorization token is returned (valid for 1 hour) and must be included in all subsequent API calls.</p><p>Secret Key can be generated and managed from the account's Developer page.</p><p>The legacy password-based method (<code>GET https://api.liveconsent.com/LCSWS/account/authentication</code>) remains available but will be deprecated in the future.</p><p>We recommend all new integrations use this method instead.</p></section>API function usage type: <b>Standard</b>",
        "operationId": "authenticationPostSecretKey",
        "requestBody": {
          "description": "Authentication Secret Key Request Body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticationSecretKey"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK: authorization token is returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseAuthenticationSecretKey"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request: the LCS server could not understand the request due to invalid syntax. Request Data Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            }
          },
          "403": {
            "description": "Access denied: IP not allowed for this API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseForbidden"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ResponseError": {
        "type": "object",
        "properties": {
          "return_code": {
            "type": "integer",
            "description": "Error code number",
            "format": "int32",
            "example": 1
          },
          "description": {
            "type": "string",
            "description": "Error description",
            "example": "Error: invalid input data format - invalid structure"
          }
        }
      },
      "ResponseAuthenticationSecretKey": {
        "required": [
          "authorization_token",
          "expires_at",
          "username"
        ],
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Username of the authentication user",
            "format": "email",
            "example": "api_user_01@liveconsent.com"
          },
          "authorization_token": {
            "type": "string",
            "description": "Token with limited validity for authenticated user to access the LCS API",
            "format": "uuid",
            "example": "e73df0cc-bc5e-48d4-82f0-6adc74ad105a"
          },
          "expires_at": {
            "type": "string",
            "description": "Expiration date and time of the authorization token in ISO 8601 format",
            "format": "date-time",
            "example": "2025-12-31T23:59:59Z"
          }
        }
      },
      "ResponseForbidden": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Access denied: IP not allowed for this API key",
            "example": "Access denied: IP not allowed for this API key"
          }
        }
      },
      "AuthenticationSecretKey": {
        "required": [
          "developer_key",
          "secret_key",
          "username"
        ],
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "email address (used on LCS subscription)",
            "example": "api_user@liveconsent.com"
          },
          "secret_key": {
            "type": "string",
            "description": "secret key associated to the username",
            "example": "your_secret_key"
          },
          "developer_key": {
            "type": "string",
            "description": "web service developer key (provided by Liveconsent Support)",
            "example": "your_developer_key"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 95,
      "1": 145,
      "2": 111,
      "3": 140,
      "4": 37,
      "5": 235,
      "6": 234,
      "7": 0,
      "8": 97,
      "9": 129,
      "10": 217,
      "11": 11
    }
  }
}
```