curl --request POST \
--url https://api.leadping.ai/organizations/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expiresInDays": 123,
"permissions": [
"<string>"
]
}
'import requests
url = "https://api.leadping.ai/organizations/api-keys/{id}"
payload = {
"name": "<string>",
"expiresInDays": 123,
"permissions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.leadping.ai/organizations/api-keys/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123,\n \"permissions\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.leadping.ai/organizations/api-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123,\n \"permissions\": [\n \"<string>\"\n ]\n}")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', expiresInDays: 123, permissions: ['<string>']})
};
fetch('https://api.leadping.ai/organizations/api-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadping.ai/organizations/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123,\n \"permissions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadping.ai/organizations/api-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'expiresInDays' => 123,
'permissions' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"secret": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"apiKey": {
"id": "<string>",
"name": "<string>",
"organization": {
"id": "<string>",
"name": "<string>"
},
"enabled": true,
"preview": "<string>",
"permissions": [
"<string>"
],
"issuedAt": "2023-11-07T05:31:56Z",
"firstUsedAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"totalUses": 123,
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z"
}
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Forbidden",
"status": 403,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"detail": "The request could not be completed."
}Creates an organization-owned API key.
The operation enforces organization ownership or platform-admin authorization and returns state suitable for membership, billing, and support workflows.
curl --request POST \
--url https://api.leadping.ai/organizations/api-keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expiresInDays": 123,
"permissions": [
"<string>"
]
}
'import requests
url = "https://api.leadping.ai/organizations/api-keys/{id}"
payload = {
"name": "<string>",
"expiresInDays": 123,
"permissions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.leadping.ai/organizations/api-keys/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123,\n \"permissions\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.leadping.ai/organizations/api-keys/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123,\n \"permissions\": [\n \"<string>\"\n ]\n}")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', expiresInDays: 123, permissions: ['<string>']})
};
fetch('https://api.leadping.ai/organizations/api-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadping.ai/organizations/api-keys/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expiresInDays\": 123,\n \"permissions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadping.ai/organizations/api-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'expiresInDays' => 123,
'permissions' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"secret": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"apiKey": {
"id": "<string>",
"name": "<string>",
"organization": {
"id": "<string>",
"name": "<string>"
},
"enabled": true,
"preview": "<string>",
"permissions": [
"<string>"
],
"issuedAt": "2023-11-07T05:31:56Z",
"firstUsedAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"totalUses": 123,
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z"
}
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Forbidden",
"status": 403,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"detail": "The request could not be completed."
}Authorizations
Authorization header using the Bearer scheme. Accepted values are Leadping user JWT access tokens and WorkOS organization API keys beginning with sk_.
Path Parameters
The organization ID that will own the API key.
Body
The key expiration selection. Null expiration means no limit.
Defines the display name and access configuration for a new Leadping organization API key.
Response
The API key was created successfully.
Returns a newly issued organization API key and its identifying metadata; the secret credential is shown only in this response.
Secret token returned once when the Leadping API key is issued.
Date and time when the organization API key issue expires.
Safe identifying and usage metadata for an organization API key. This model never contains the secret credential.
Show child attributes
Show child attributes

