Create a scoped client
Creates a scoped client bound to the authenticated company through the identity service. Rails fills in the company (org) and the acting administrator (actor) from the session; neither is read from the request. A confidential client’s secret is in this response and never again; a publishable client has no secret and is held to its allowed origins. Scopes are resource:verb (view is spelled read, write actions write). A publishable client is limited to the public token scopes. Returns 422 for a publishable client asking for any other scope, and when the identity service refuses the scopes, origins, or expiry. Requires a company admin Bearer token with the developer update permission, for a company whose credentials are scoped clients.
curl --request POST \
--url https://api.fluid.app/api/v2025-06/tokens/clients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Order sync",
"kind": "confidential",
"scopes": [
"orders:read"
],
"expires_at": null
}
'import requests
url = "https://api.fluid.app/api/v2025-06/tokens/clients"
payload = {
"name": "Order sync",
"kind": "confidential",
"scopes": ["orders:read"],
"expires_at": None
}
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({
name: 'Order sync',
kind: 'confidential',
scopes: ['orders:read'],
expires_at: null
})
};
fetch('https://api.fluid.app/api/v2025-06/tokens/clients', 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.fluid.app/api/v2025-06/tokens/clients",
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' => 'Order sync',
'kind' => 'confidential',
'scopes' => [
'orders:read'
],
'expires_at' => null
]),
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.fluid.app/api/v2025-06/tokens/clients"
payload := strings.NewReader("{\n \"name\": \"Order sync\",\n \"kind\": \"confidential\",\n \"scopes\": [\n \"orders:read\"\n ],\n \"expires_at\": null\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.fluid.app/api/v2025-06/tokens/clients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Order sync\",\n \"kind\": \"confidential\",\n \"scopes\": [\n \"orders:read\"\n ],\n \"expires_at\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v2025-06/tokens/clients")
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 \"name\": \"Order sync\",\n \"kind\": \"confidential\",\n \"scopes\": [\n \"orders:read\"\n ],\n \"expires_at\": null\n}"
response = http.request(request)
puts response.read_body{
"client": {
"client_id": "fci_kq3vx7m2n9p4r6t8w1y5z0b2c4",
"kind": "confidential",
"name": "Order sync",
"org": "0199a3f2-7c41-7e2b-9d5a-3f6b8c1e4a27",
"scopes": [
"orders:read"
],
"allowed_origins": [],
"grant_types": [
"client_credentials"
],
"created_at": "2026-10-01T12:00:00Z",
"expires_at": null,
"revoked_at": null,
"secret_rotated_at": null,
"previous_secret_expires_at": null
},
"client_secret": "fcs_example-only-shown-once",
"status": 201,
"meta": {
"request_uuid": "8b4e2f71-3c9a-4d6e-b1f0-5a7c9e2d4b18",
"timestamp": "2026-10-01T12:00:00Z"
}
}{
"message": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
A label shown to administrators.
A confidential client has a secret; a publishable one is held to its allowed origins instead.
confidential, publishable The resource:verb scopes the client may hold; may be empty. A publishable client may hold only the scopes a public token could (dam:upload, dam:browse, dam:unsplash, dam:ai_generate, media:read, products:read, enrollments:read, playlists:read, forms:read); any other is refused with 422 and needs a confidential client.
Required for a publishable client, refused for a confidential one. Each entry is scheme://host[:port].
When the client stops authenticating, or null for never.
Response
Created. Cache-Control is no-store; the secret is never shown again.
A client and, from a create or a rotate of a confidential client, its one-time secret.
A scoped client as the identity service's lifecycle API describes it (ScopedClient in services/identity/api/openapi.yaml), passed through by Rails. It never carries a secret or a digest.
Show child attributes
Show child attributes
Shown once. Absent for a publishable client.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.fluid.app/api/v2025-06/tokens/clients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Order sync",
"kind": "confidential",
"scopes": [
"orders:read"
],
"expires_at": null
}
'import requests
url = "https://api.fluid.app/api/v2025-06/tokens/clients"
payload = {
"name": "Order sync",
"kind": "confidential",
"scopes": ["orders:read"],
"expires_at": None
}
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({
name: 'Order sync',
kind: 'confidential',
scopes: ['orders:read'],
expires_at: null
})
};
fetch('https://api.fluid.app/api/v2025-06/tokens/clients', 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.fluid.app/api/v2025-06/tokens/clients",
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' => 'Order sync',
'kind' => 'confidential',
'scopes' => [
'orders:read'
],
'expires_at' => null
]),
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.fluid.app/api/v2025-06/tokens/clients"
payload := strings.NewReader("{\n \"name\": \"Order sync\",\n \"kind\": \"confidential\",\n \"scopes\": [\n \"orders:read\"\n ],\n \"expires_at\": null\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.fluid.app/api/v2025-06/tokens/clients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Order sync\",\n \"kind\": \"confidential\",\n \"scopes\": [\n \"orders:read\"\n ],\n \"expires_at\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v2025-06/tokens/clients")
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 \"name\": \"Order sync\",\n \"kind\": \"confidential\",\n \"scopes\": [\n \"orders:read\"\n ],\n \"expires_at\": null\n}"
response = http.request(request)
puts response.read_body{
"client": {
"client_id": "fci_kq3vx7m2n9p4r6t8w1y5z0b2c4",
"kind": "confidential",
"name": "Order sync",
"org": "0199a3f2-7c41-7e2b-9d5a-3f6b8c1e4a27",
"scopes": [
"orders:read"
],
"allowed_origins": [],
"grant_types": [
"client_credentials"
],
"created_at": "2026-10-01T12:00:00Z",
"expires_at": null,
"revoked_at": null,
"secret_rotated_at": null,
"previous_secret_expires_at": null
},
"client_secret": "fcs_example-only-shown-once",
"status": 201,
"meta": {
"request_uuid": "8b4e2f71-3c9a-4d6e-b1f0-5a7c9e2d4b18",
"timestamp": "2026-10-01T12:00:00Z"
}
}{
"message": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"pagination": {
"cursor": "<string>",
"limit": 123,
"prev_cursor": "<string>",
"next_cursor": "<string>",
"total_count": 123
}
}
}