# Embedding

> For AI agents: the index of these docs is at https://indrava.forumulate.com/docs/llms.txt (every page it lists has a Markdown version like this one).

## List the workspaces you created for your customers

**`GET http://localhost:4000/api/v1/embed/tenants`** — List the workspaces you created for your customers

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/embed/tenants" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/embed/tenants",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/embed/tenants", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Create (or update) a workspace for one of your customers

**`POST http://localhost:4000/api/v1/embed/tenants`** — Create (or update) a workspace for one of your customers

Idempotent on `externalId`, your own id for the customer. The first call returns `apiKey`: the tenant workspace's own key for the rest of this API (posts, media, analytics), shown once. Later calls return `apiKey: null`, rename the workspace and put it on your current plan. Tenants count against your plan's client limit; each tenant gets your plan's limits. With `webhookUrl`, every event of the tenant workspace (see Events) is sent there, signed with the returned `webhookSecret`.

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `externalId` | string | yes |  |
| `name` | string | yes |  |
| `webhookUrl` | string | no |  |

```json
{
  "externalId": "string",
  "name": "string",
  "webhookUrl": "string"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/embed/tenants" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"externalId":"string","name":"string","webhookUrl":"string"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"externalId":"string","name":"string","webhookUrl":"string"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/embed/tenants",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"externalId": "string", "name": "string", "webhookUrl": "string"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/embed/tenants", strings.NewReader(`{"externalId":"string","name":"string","webhookUrl":"string"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"externalId":"string","name":"string","webhookUrl":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"externalId":"string","name":"string","webhookUrl":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"externalId\":\"string\",\"name\":\"string\",\"webhookUrl\":\"string\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Replace a tenant workspace's API key

**`POST http://localhost:4000/api/v1/embed/tenants/{externalId}/key`** — Replace a tenant workspace's API key

Every earlier key of the tenant stops working. `apiKey` is shown once.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/embed/tenants/{externalId}/key" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/key', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/key",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/embed/tenants/{externalId}/key", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/key');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/key')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/key"))
    .header("Authorization", "Bearer $API_KEY")
    .method("POST", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Delete a tenant workspace and everything in it

**`DELETE http://localhost:4000/api/v1/embed/tenants/{externalId}`** — Delete a tenant workspace and everything in it

Channels are disconnected at their platforms, scheduled posts never publish, files are deleted and the tenant's keys stop working. Not reversible.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X DELETE "http://localhost:4000/api/v1/embed/tenants/{externalId}" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "DELETE",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "http://localhost:4000/api/v1/embed/tenants/{externalId}", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}"))
    .header("Authorization", "Bearer $API_KEY")
    .method("DELETE", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Get a one-hour link where your customer connects a channel

**`POST http://localhost:4000/api/v1/embed/tenants/{externalId}/connect`** — Get a one-hour link where your customer connects a channel

Send your customer's browser to `url`. They sign in at the platform and the channel is saved in their tenant workspace. With `redirectUrl` the browser then returns there with `status=connected&channels=<ids>` or `status=error&error=<message>` in the query; the tenant's `channel.connected` event fires either way. Sign-in platforms only.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `provider` | string | yes |  |
| `redirectUrl` | string | no |  |

```json
{
  "provider": "string",
  "redirectUrl": "string"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/embed/tenants/{externalId}/connect" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider":"string","redirectUrl":"string"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/connect', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"provider":"string","redirectUrl":"string"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/connect",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"provider": "string", "redirectUrl": "string"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/embed/tenants/{externalId}/connect", strings.NewReader(`{"provider":"string","redirectUrl":"string"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/connect');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"provider":"string","redirectUrl":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/connect')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"provider":"string","redirectUrl":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/connect"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"provider\":\"string\",\"redirectUrl\":\"string\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## List a tenant workspace's channels

**`GET http://localhost:4000/api/v1/embed/tenants/{externalId}/channels`** — List a tenant workspace's channels

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/channels', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/channels');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/channels')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/channels"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Disconnect one of a tenant workspace's channels

**`DELETE http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}`** — Disconnect one of a tenant workspace's channels

The same as `DELETE /channels/{id}` with the tenant's key: access is revoked at the platform, and a scheduled post left with no channel goes back to draft.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |
| `channelId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X DELETE "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "DELETE",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/channels/{channelId}"))
    .header("Authorization", "Bearer $API_KEY")
    .method("DELETE", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Get the plan a tenant workspace runs

**`GET http://localhost:4000/api/v1/embed/tenants/{externalId}/plan`** — Get the plan a tenant workspace runs

`plan` is what the tenant runs now; `followsPartner` is false when you chose a plan for it with `PUT /embed/tenants/{externalId}/plan`. `limits` use -1 for unlimited.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/plan', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/plan');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/plan')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/plan"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Choose the plan of one tenant workspace

**`PUT http://localhost:4000/api/v1/embed/tenants/{externalId}/plan`** — Choose the plan of one tenant workspace

Any plan up to your own: a tenant never runs above the plan you pay for, and drops with you when yours goes down. `plan: null` makes the tenant follow your plan again. A tenant holding an operator's grant keeps it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | string | yes |  |

```json
{
  "plan": "free"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X PUT "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"plan":"free"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/plan', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"plan":"free"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "PUT",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"plan": "free"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("PUT", "http://localhost:4000/api/v1/embed/tenants/{externalId}/plan", strings.NewReader(`{"plan":"free"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/plan');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"plan":"free"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/plan')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"plan":"free"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/plan"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("PUT", BodyPublishers.ofString("{\"plan\":\"free\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Read a tenant workspace's AI credit balance

**`GET http://localhost:4000/api/v1/embed/tenants/{externalId}/credits`** — Read a tenant workspace's AI credit balance

This month's `limit` and `used` for each kind. `limit` -1 = unlimited.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/credits" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/credits', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/credits",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/embed/tenants/{externalId}/credits", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/credits');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/credits')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/credits"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## List the members of a tenant workspace

**`GET http://localhost:4000/api/v1/embed/tenants/{externalId}/members`** — List the members of a tenant workspace

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/members" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/members', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/members",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/embed/tenants/{externalId}/members", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/members');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/members')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/members"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Add a member to a tenant workspace

**`POST http://localhost:4000/api/v1/embed/tenants/{externalId}/members`** — Add a member to a tenant workspace

Name the person by `userExternalId`, your own id for them: they join the tenant workspace as `role` when they sign in with that id, or at once when they already have. Roles: org:admin, org:member, org:editor, org:approver, org:client_reviewer.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `userExternalId` | string | yes |  |
| `role` | string | yes | One of: `org:admin` \| `org:member` \| `org:editor` \| `org:approver` \| `org:client_reviewer`. |

```json
{
  "userExternalId": "string",
  "role": "org:admin"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/embed/tenants/{externalId}/members" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"userExternalId":"string","role":"org:admin"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/members', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"userExternalId":"string","role":"org:admin"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/members",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"userExternalId": "string", "role": "org:admin"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/embed/tenants/{externalId}/members", strings.NewReader(`{"userExternalId":"string","role":"org:admin"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/members');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"userExternalId":"string","role":"org:admin"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/members')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"userExternalId":"string","role":"org:admin"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/members"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"userExternalId\":\"string\",\"role\":\"org:admin\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Remove a member from a tenant workspace

**`DELETE http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}`** — Remove a member from a tenant workspace

`userId` is the Atlas user id from the members list, or a `userExternalId` that has not signed in yet (its pending invitation is cancelled).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |
| `userId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X DELETE "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "DELETE",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}"))
    .header("Authorization", "Bearer $API_KEY")
    .method("DELETE", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Change a member's role in a tenant workspace

**`PATCH http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}`** — Change a member's role in a tenant workspace

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |
| `userId` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | string | yes | One of: `org:admin` \| `org:member` \| `org:editor` \| `org:approver` \| `org:client_reviewer`. |

```json
{
  "role": "org:admin"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X PATCH "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"role":"org:admin"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"role":"org:admin"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "PATCH",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"role": "org:admin"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("PATCH", "http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}", strings.NewReader(`{"role":"org:admin"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"role":"org:admin"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}')
req = Net::HTTP::Patch.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"role":"org:admin"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/members/{userId}"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("PATCH", BodyPublishers.ofString("{\"role\":\"org:admin\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Get a tenant workspace's branding and connect-page options

**`GET http://localhost:4000/api/v1/embed/tenants/{externalId}/branding`** — Get a tenant workspace's branding and connect-page options

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/embed/tenants/{externalId}/branding" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/branding', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/branding",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/embed/tenants/{externalId}/branding", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/branding');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/branding')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/branding"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Set a tenant workspace's branding and connect-page options

**`PUT http://localhost:4000/api/v1/embed/tenants/{externalId}/branding`** — Set a tenant workspace's branding and connect-page options

`logoUrl` and `faviconUrl` are https URLs; accent colours are #rrggbb. `connectProviders` limits the networks the tenant's connect page offers (platform ids from `GET /channels/providers`; null = all). `hideIndrava` needs the Agency plan on the tenant. The connect page and the app show the brand to the tenant's members and visitors.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `externalId` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `logoUrl` | string | yes |  |
| `faviconUrl` | string | yes |  |
| `accentLight` | string | yes |  |
| `accentDark` | string | yes |  |
| `supportEmail` | string | yes |  |
| `connectProviders` | string[] | yes |  |
| `hideIndrava` | boolean | yes |  |

```json
{
  "name": "string",
  "logoUrl": "string",
  "faviconUrl": "string",
  "accentLight": "string",
  "accentDark": "string",
  "supportEmail": "string",
  "connectProviders": [
    "string"
  ],
  "hideIndrava": true
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X PUT "http://localhost:4000/api/v1/embed/tenants/{externalId}/branding" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","logoUrl":"string","faviconUrl":"string","accentLight":"string","accentDark":"string","supportEmail":"string","connectProviders":["string"],"hideIndrava":true}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/embed/tenants/{externalId}/branding', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"name":"string","logoUrl":"string","faviconUrl":"string","accentLight":"string","accentDark":"string","supportEmail":"string","connectProviders":["string"],"hideIndrava":true}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "PUT",
    "http://localhost:4000/api/v1/embed/tenants/{externalId}/branding",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"name": "string", "logoUrl": "string", "faviconUrl": "string", "accentLight": "string", "accentDark": "string", "supportEmail": "string", "connectProviders": ["string"], "hideIndrava": True},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("PUT", "http://localhost:4000/api/v1/embed/tenants/{externalId}/branding", strings.NewReader(`{"name":"string","logoUrl":"string","faviconUrl":"string","accentLight":"string","accentDark":"string","supportEmail":"string","connectProviders":["string"],"hideIndrava":true}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/embed/tenants/{externalId}/branding');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"string","logoUrl":"string","faviconUrl":"string","accentLight":"string","accentDark":"string","supportEmail":"string","connectProviders":["string"],"hideIndrava":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/embed/tenants/{externalId}/branding')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","logoUrl":"string","faviconUrl":"string","accentLight":"string","accentDark":"string","supportEmail":"string","connectProviders":["string"],"hideIndrava":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/embed/tenants/{externalId}/branding"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("PUT", BodyPublishers.ofString("{\"name\":\"string\",\"logoUrl\":\"string\",\"faviconUrl\":\"string\",\"accentLight\":\"string\",\"accentDark\":\"string\",\"supportEmail\":\"string\",\"connectProviders\":[\"string\"],\"hideIndrava\":true}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

---

## For AI agents

- This page for a human reader: https://indrava.forumulate.com/docs/ref-embedding
- The whole space as one Markdown file: https://indrava.forumulate.com/docs/llms-full.txt
- Live search + fetch over MCP: https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp
  - Install (Claude CLI): `claude mcp add forumulate-docs --transport http https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
