Create Magic Link
Create or retrieve an active magic link for the Company. If an active link already exists, its URL is returned with status 200. Otherwise a new link is created and returned with status 201.
curl -X POST "https://api.getkini.com/companies/1/magic/" \
-H "Content-Type: application/json" \
-H "Company-Id: 1" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.getkini.com/companies/1/magic/"
headers = {
"Content-Type": "application/json",
"Company-Id": "1",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.post(url, headers=headers)
print(response.json())
const response = await fetch("https://api.getkini.com/companies/1/magic/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Company-Id": "1",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("POST", "https://api.getkini.com/companies/1/magic/", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Company-Id", "1")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.getkini.com/companies/1/magic/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Company-Id'] = '1'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"data": "https://app.getkini.com/magic/EXAMPLEmagiclinktoken12345x/"
}
{
"data": "https://app.getkini.com/magic/EXAMPLEmagiclinktoken12345x/"
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
POST
/companies/{id}/magic/POST
Base URLstring
Target server for requests. Edit to use your own host.
Bearer Token
Bearer Tokenstring
RequiredAuthenticate every request with an API key from the Kini Partner App, sent as Authorization: Bearer <your_api_key>.
Authenticate every request with an API key from the Kini Partner App, sent as
Authorization: Bearer <your_api_key>.path
idinteger
RequiredUnique Kini ID of the company
header
Company-Idinteger
RequiredKini ID of the company the key is associated with
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token. Authenticate every request with an API key from the Kini Partner App, sent as Authorization: Bearer \<your_api_key\>.
Path Parameters
Headers
Responses
datastring
URL of the existing active magic link
Was this page helpful?