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. For a confidential client, discover the issuing environment’s token_endpoint at /.well-known/oauth-authorization-server on the identity issuer (production issuer https://identity.fluid.app). POST to that endpoint with HTTP Basic authentication (client_id and client_secret), Content-Type application/x-www-form-urlencoded, and grant_type=client_credentials. Send the returned access_token as Bearer to the API and exchange again before expires_in elapses (the default lifetime is 600 seconds). Store the secret only on the server. The scopes array contains separate strings. An empty array grants no scoped API actions. To read form submissions, request only forms:read. GET /api/v2025-06/tokens/clients returns the current list of valid scope names in supported_scopes; the Create API client screen displays these under Add a scope. A scope must also be grantable by the signed-in admin. For the underlying permissions consult GET /api/company/roles/structure for the resource and action required by the operation. Translate view to read and create/update/delete/destroy to write; preserve named actions. The publishable-client scope list is given under scopes below. 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
Body
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.
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.
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
}
}
}