curl --request POST \
--url https://api-dev.narrative.io/app-invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "https://example.com/invite",
"installation_id": 42,
"data": {
"key": "value"
},
"display_name": "Partner onboarding invite",
"invitee_name": "Jane Smith",
"tags": [
"onboarding"
]
}
'import requests
url = "https://api-dev.narrative.io/app-invites"
payload = {
"base_url": "https://example.com/invite",
"installation_id": 42,
"data": { "key": "value" },
"display_name": "Partner onboarding invite",
"invitee_name": "Jane Smith",
"tags": ["onboarding"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: 'https://example.com/invite',
installation_id: 42,
data: {key: 'value'},
display_name: 'Partner onboarding invite',
invitee_name: 'Jane Smith',
tags: ['onboarding']
})
};
fetch('https://api-dev.narrative.io/app-invites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/app-invites",
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([
'base_url' => 'https://example.com/invite',
'installation_id' => 42,
'data' => [
'key' => 'value'
],
'display_name' => 'Partner onboarding invite',
'invitee_name' => 'Jane Smith',
'tags' => [
'onboarding'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/app-invites"
payload := strings.NewReader("{\n \"base_url\": \"https://example.com/invite\",\n \"installation_id\": 42,\n \"data\": {\n \"key\": \"value\"\n },\n \"display_name\": \"Partner onboarding invite\",\n \"invitee_name\": \"Jane Smith\",\n \"tags\": [\n \"onboarding\"\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))
}HttpResponse<String> response = Unirest.post("https://api-dev.narrative.io/app-invites")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"https://example.com/invite\",\n \"installation_id\": 42,\n \"data\": {\n \"key\": \"value\"\n },\n \"display_name\": \"Partner onboarding invite\",\n \"invitee_name\": \"Jane Smith\",\n \"tags\": [\n \"onboarding\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/app-invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"https://example.com/invite\",\n \"installation_id\": 42,\n \"data\": {\n \"key\": \"value\"\n },\n \"display_name\": \"Partner onboarding invite\",\n \"invitee_name\": \"Jane Smith\",\n \"tags\": [\n \"onboarding\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"activated_at": null,
"app": {
"id": 100,
"name": "Test App",
"slug": "test-app"
},
"code": "abc123def456ghi789jkl012",
"company": {
"id": 42,
"logo": "https://example.com/logo.png",
"name": "Acme Corp"
},
"created_at": "2025-01-01T00:00:00Z",
"data": {
"key": "value"
},
"display_name": "Partner onboarding invite",
"invitee_name": "Jane Smith",
"status": "pending",
"tags": [
"onboarding",
"partner"
],
"updated_at": "2025-01-01T00:00:00Z",
"url": "https://example.com/invite?code=abc123def456ghi789jkl012"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Create an app invite
Creates a new app invite for a company.
Requires an app client credentials token. The invite is created in pending status
and includes a generated invite code.
curl --request POST \
--url https://api-dev.narrative.io/app-invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "https://example.com/invite",
"installation_id": 42,
"data": {
"key": "value"
},
"display_name": "Partner onboarding invite",
"invitee_name": "Jane Smith",
"tags": [
"onboarding"
]
}
'import requests
url = "https://api-dev.narrative.io/app-invites"
payload = {
"base_url": "https://example.com/invite",
"installation_id": 42,
"data": { "key": "value" },
"display_name": "Partner onboarding invite",
"invitee_name": "Jane Smith",
"tags": ["onboarding"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: 'https://example.com/invite',
installation_id: 42,
data: {key: 'value'},
display_name: 'Partner onboarding invite',
invitee_name: 'Jane Smith',
tags: ['onboarding']
})
};
fetch('https://api-dev.narrative.io/app-invites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/app-invites",
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([
'base_url' => 'https://example.com/invite',
'installation_id' => 42,
'data' => [
'key' => 'value'
],
'display_name' => 'Partner onboarding invite',
'invitee_name' => 'Jane Smith',
'tags' => [
'onboarding'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/app-invites"
payload := strings.NewReader("{\n \"base_url\": \"https://example.com/invite\",\n \"installation_id\": 42,\n \"data\": {\n \"key\": \"value\"\n },\n \"display_name\": \"Partner onboarding invite\",\n \"invitee_name\": \"Jane Smith\",\n \"tags\": [\n \"onboarding\"\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))
}HttpResponse<String> response = Unirest.post("https://api-dev.narrative.io/app-invites")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"https://example.com/invite\",\n \"installation_id\": 42,\n \"data\": {\n \"key\": \"value\"\n },\n \"display_name\": \"Partner onboarding invite\",\n \"invitee_name\": \"Jane Smith\",\n \"tags\": [\n \"onboarding\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/app-invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"https://example.com/invite\",\n \"installation_id\": 42,\n \"data\": {\n \"key\": \"value\"\n },\n \"display_name\": \"Partner onboarding invite\",\n \"invitee_name\": \"Jane Smith\",\n \"tags\": [\n \"onboarding\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"activated_at": null,
"app": {
"id": 100,
"name": "Test App",
"slug": "test-app"
},
"code": "abc123def456ghi789jkl012",
"company": {
"id": 42,
"logo": "https://example.com/logo.png",
"name": "Acme Corp"
},
"created_at": "2025-01-01T00:00:00Z",
"data": {
"key": "value"
},
"display_name": "Partner onboarding invite",
"invitee_name": "Jane Smith",
"status": "pending",
"tags": [
"onboarding",
"partner"
],
"updated_at": "2025-01-01T00:00:00Z",
"url": "https://example.com/invite?code=abc123def456ghi789jkl012"
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}{
"error": "Unauthorized",
"error_description": "You are not authorized to use this endpoint."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for creating a new app invite.
The base URL for the invite link. Must be a valid URI with a scheme and host.
"https://example.com/invite"
The ID of the app installation to create the invite for.
42
Optional custom JSON data to associate with the invite.
{ "key": "value" }
An optional display name for the invite. Maximum 1000 characters.
"Partner onboarding invite"
An optional name for the invitee. Maximum 1024 characters.
"Jane Smith"
A list of tags to associate with the invite. Each tag is max 128 characters.
["onboarding"]
Response
Successfully created the app invite.
An app invite with full details.
Unique identifier for the app invite.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Summary information about an app.
Show child attributes
Show child attributes
{
"id": 100,
"name": "Test App",
"slug": "test-app"
}
The 24-character invite code.
"abc123def456ghi789jkl012"
Summary information about a company.
Show child attributes
Show child attributes
{
"id": 42,
"logo": "https://example.com/logo.png",
"name": "Acme Corp"
}
The timestamp when the invite was created.
"2025-01-01T00:00:00Z"
The lifecycle status of an app invite.
pending, active, archived "pending"
The timestamp when the invite was last updated.
"2025-01-15T10:30:00Z"
The full invite URL constructed from the base URL and invite code.
"https://example.com/invite?code=abc123def456ghi789jkl012"
The timestamp when the invite was activated, or null if not yet activated.
"2025-01-15T10:30:00Z"
Custom JSON data associated with the invite.
{ "key": "value" }
An optional display name for the invite.
"Partner onboarding invite"
An optional name for the invitee. Maximum 1024 characters.
"Jane Smith"
A list of tags associated with the invite. Each tag is max 128 characters.
["onboarding", "partner"]
Was this page helpful?

