Authorization

To access the Logic API, you will need to provide an authorization token. This token is used to authenticate your requests and ensure that only authorized users can access your documents.

Step 1: Creating an API key

api keys To create an API key, go to the API Keys page in the Logic Dashboard. Click on the “Create a new secret key” button and follow the prompts to generate a new key. Make sure to copy the key and store it in a secure location, as you will not be able to see it again after you close the dialog.

Step 2: Setting the environment variable

You can set the environment variable in your terminal by running the following command:
export LOGIC_API_TOKEN=ls-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note that setting the environment variable this way will only persist for the current terminal session. If you open a new terminal window, you will need to set the environment variable again. To set the environment variable permanently, you can add the above command to your shell configuration file (e.g., .bashrc, .bash_profile, or .zshrc for MacOS/Linux, or System Properties for Windows).

Step 3: Verifying the environment variable

Verify your enviroment variable is set correctly by running the following command in your terminal:
echo $LOGIC_API_TOKEN
If this returns your API key, you have correctly set your environment variable.

Try Making a Request

Now that you have your API token set up, you can try making a request to the Logic API.
Learn more about how to execute a document using the API in the Executing a Document section.
If you need more information about how documents work in the API, check out the Input Schema and Output Schema sections of the API Documentation.