Authentication
In order to use our API you need to get your X-Api-Key
first. Create an account, log in, within a project, on the bottom left corner click on API
.
Here is a quick tutorial:
From here, you can copy the X-Api-Key
and use it in your requests.
Authorizing in RESTful API
Calling the API requires an API Key. You can pass the API Key as a Bearer token in the Authorization
header:
import requests
url = "https://api.workflows.tryleap.ai/v1/runs"
payload = {
'workflow_id': workflow_id,
'input': {
'my_input_field_1': 'demo value',
...
},
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"X-Api-Key": API_KEY
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Authorizing in TypeScript SDK;
When initializing the SDK you can pass the API Key as a parameter:
import { Leap } from "@leap-ai/workflows";
const leap = new Leap({
apiKey: process.env.LEAP_API_KEY,
});
const response = await leap.workflowRuns.workflow(
{},
);
console.log(response.data);
Revoking an API Key
You can revoke an API Key at any time by clicking on the Revoke
button next to the API Key you want to revoke.
This will immediately revoke the API Key and any requests using that API Key will fail.
Need Assistance?
For queries or further assistance, kindly reach out via email at [email protected].
Thank you for choosing Leap!