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/123/magic/" \
-H "Content-Type: application/json" \
-H "Company-Id: 123" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.getkini.com/companies/123/magic/"
headers = {
"Content-Type": "application/json",
"Company-Id": "123",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.post(url, headers=headers)
print(response.json())
const response = await fetch("https://api.getkini.com/companies/123/magic/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Company-Id": "123",
"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/123/magic/", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Company-Id", "123")
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/123/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'] = '123'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"data": "example_string"
}
{
"data": "example_string"
}
{
"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
RequiredBearer API Key Authentication. Include your API key in the Authorization header.
Bearer API Key Authentication. Include your API key in the Authorization header.
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. Bearer API Key Authentication. Include your API key in the Authorization header.
Path Parameters
idinteger
RequiredUnique Kini ID of the company
Headers
Company-Idinteger
RequiredKini ID of the company the key is associated with
Responses
datastring
URL of the existing active magic link
Was this page helpful?