curl --request PUT \
--url 'https://api.widgetic.com/v1/compositions/123e4567-e89b-12d3-a456-426614174000/managed-user' \
--header "Authorization: Bearer $WIDGETIC_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}'import { CompositionsApi } from '@widgetic/api-sdk-ts';
const compositionsApi = new CompositionsApi(process.env.WIDGETIC_API_KEY!);
const result = await compositionsApi.setCompositionManagedUser({
id: '123e4567-e89b-12d3-a456-426614174000',
managedUserReference: {
managedUserId: '123e4567-e89b-12d3-a456-426614174000',
managedUserExternalId: 'external-user-123',
},
});
console.log(result);import os
import api_sdk_py
configuration = api_sdk_py.Configuration(access_token=os.environ["WIDGETIC_API_KEY"])
with api_sdk_py.ApiClient(configuration) as api_client:
compositions_api = api_sdk_py.CompositionsApi(api_client)
result = compositions_api.set_composition_managed_user(
id="123e4567-e89b-12d3-a456-426614174000",
managed_user_reference={
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123",
},
)
print(result)package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
widgetic "github.com/widgetic/api-sdk-go"
)
func main() {
ctx := context.WithValue(context.Background(), widgetic.ContextAccessToken, os.Getenv("WIDGETIC_API_KEY"))
client := widgetic.NewAPIClient(widgetic.NewConfiguration())
managedUserReferenceJSON := `{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}`
var managedUserReference widgetic.ManagedUserReference
if err := json.Unmarshal([]byte(managedUserReferenceJSON), &managedUserReference); err != nil {
log.Fatal(err)
}
result, _, err := client.CompositionsAPI.SetCompositionManagedUser(ctx, "123e4567-e89b-12d3-a456-426614174000").
ManagedUserReference(managedUserReference).
Execute()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println(result)
}import com.widgetic.api.ApiClient;
import com.widgetic.api.ApiException;
import com.widgetic.api.Configuration;
import com.widgetic.api.JSON;
import com.widgetic.api.api.CompositionsApi;
import com.widgetic.api.model.ManagedUserReference;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws ApiException {
ApiClient client = Configuration.getDefaultApiClient();
client.setBearerToken(System.getenv("WIDGETIC_API_KEY"));
CompositionsApi compositionsApi = new CompositionsApi(client);
String managedUserReferenceJson = """
{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}
""";
ManagedUserReference managedUserReference = JSON.deserialize(managedUserReferenceJson, ManagedUserReference.class);
var result = compositionsApi.setCompositionManagedUser(
UUID.fromString("123e4567-e89b-12d3-a456-426614174000"),
managedUserReference
);
System.out.println(result);
}
}using System;
using Newtonsoft.Json;
using Widgetic.ApiSdk.Cs.Api;
using Widgetic.ApiSdk.Cs.Client;
using Widgetic.ApiSdk.Cs.Model;
var configuration = new Configuration
{
AccessToken = Environment.GetEnvironmentVariable("WIDGETIC_API_KEY")!,
};
var compositionsApi = new CompositionsApi(configuration);
var managedUserReference = JsonConvert.DeserializeObject<ManagedUserReference>("""
{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}
""")!;
var result = compositionsApi.SetCompositionManagedUser(
id: Guid.Parse("123e4567-e89b-12d3-a456-426614174000"),
managedUserReference: managedUserReference
);
Console.WriteLine(result);require 'api-sdk-rb'
ApiSdkRb.configure do |config|
config.access_token = ENV['WIDGETIC_API_KEY']
end
compositions_api = ApiSdkRb::CompositionsApi.new
result = compositions_api.set_composition_managed_user(
'123e4567-e89b-12d3-a456-426614174000',
{
managedUserId: '123e4567-e89b-12d3-a456-426614174000',
managedUserExternalId: 'external-user-123'
}
)
puts result<?php
require_once __DIR__ . '/vendor/autoload.php';
use WidgeticApi\Api\CompositionsApi;
use WidgeticApi\Configuration;
use WidgeticApi\Model\ManagedUserReference;
use WidgeticApi\ObjectSerializer;
$config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('WIDGETIC_API_KEY'));
$compositionsApi = new CompositionsApi(new GuzzleHttp\Client(), $config);
$managedUserReferenceJson = '{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}';
$managedUserReference = ObjectSerializer::deserialize(json_decode($managedUserReferenceJson), ManagedUserReference::class);
$result = $compositionsApi->setCompositionManagedUser(
id: '123e4567-e89b-12d3-a456-426614174000',
managed_user_reference: $managedUserReference,
);
print_r($result);{
"success": true,
"data": {
"id": "7d0b4c1a-2f6e-4f3a-9b1c-5e8a3d2c1b0f",
"managedUserId": "123e4567-e89b-12d3-a456-426614174000"
},
"meta": {
"page": 1,
"size": 20,
"total": 135,
"limit": 20,
"offset": 0,
"hasNextPage": true,
"hasPreviousPage": false,
"nextCursor": "<string>",
"warnings": [
"<string>"
]
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}Set a composition's managed user
Files a composition you made under a managed user, or moves it to another one, after it was created. Name the
managed user by Widgetic’s id (managedUserId) or by your own identifier for the user (managedUserExternalId),
never both. It must be one of your managed users, and switched on (409 MANAGED_USER_INACTIVE otherwise).
It changes whose composition this is and nothing else: its content, design, status, embed address and the entries
visitors left stay as they were. Like any change to a composition, it moves updatedAt. Reports read who a
composition is filed under when they are asked for, so the composition counts for its new managed user from then
on. Sending the managed user it already has is not an error, and changes nothing (updatedAt stays).
Only the account that made the composition can do this (404 for any other), and only with your own API key:
a call made for one managed user (an editor session, or the X-Managed-User-Id header) is refused with 403.
The API key needs the partner:write and content:write scopes.
curl --request PUT \
--url 'https://api.widgetic.com/v1/compositions/123e4567-e89b-12d3-a456-426614174000/managed-user' \
--header "Authorization: Bearer $WIDGETIC_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}'import { CompositionsApi } from '@widgetic/api-sdk-ts';
const compositionsApi = new CompositionsApi(process.env.WIDGETIC_API_KEY!);
const result = await compositionsApi.setCompositionManagedUser({
id: '123e4567-e89b-12d3-a456-426614174000',
managedUserReference: {
managedUserId: '123e4567-e89b-12d3-a456-426614174000',
managedUserExternalId: 'external-user-123',
},
});
console.log(result);import os
import api_sdk_py
configuration = api_sdk_py.Configuration(access_token=os.environ["WIDGETIC_API_KEY"])
with api_sdk_py.ApiClient(configuration) as api_client:
compositions_api = api_sdk_py.CompositionsApi(api_client)
result = compositions_api.set_composition_managed_user(
id="123e4567-e89b-12d3-a456-426614174000",
managed_user_reference={
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123",
},
)
print(result)package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
widgetic "github.com/widgetic/api-sdk-go"
)
func main() {
ctx := context.WithValue(context.Background(), widgetic.ContextAccessToken, os.Getenv("WIDGETIC_API_KEY"))
client := widgetic.NewAPIClient(widgetic.NewConfiguration())
managedUserReferenceJSON := `{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}`
var managedUserReference widgetic.ManagedUserReference
if err := json.Unmarshal([]byte(managedUserReferenceJSON), &managedUserReference); err != nil {
log.Fatal(err)
}
result, _, err := client.CompositionsAPI.SetCompositionManagedUser(ctx, "123e4567-e89b-12d3-a456-426614174000").
ManagedUserReference(managedUserReference).
Execute()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println(result)
}import com.widgetic.api.ApiClient;
import com.widgetic.api.ApiException;
import com.widgetic.api.Configuration;
import com.widgetic.api.JSON;
import com.widgetic.api.api.CompositionsApi;
import com.widgetic.api.model.ManagedUserReference;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws ApiException {
ApiClient client = Configuration.getDefaultApiClient();
client.setBearerToken(System.getenv("WIDGETIC_API_KEY"));
CompositionsApi compositionsApi = new CompositionsApi(client);
String managedUserReferenceJson = """
{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}
""";
ManagedUserReference managedUserReference = JSON.deserialize(managedUserReferenceJson, ManagedUserReference.class);
var result = compositionsApi.setCompositionManagedUser(
UUID.fromString("123e4567-e89b-12d3-a456-426614174000"),
managedUserReference
);
System.out.println(result);
}
}using System;
using Newtonsoft.Json;
using Widgetic.ApiSdk.Cs.Api;
using Widgetic.ApiSdk.Cs.Client;
using Widgetic.ApiSdk.Cs.Model;
var configuration = new Configuration
{
AccessToken = Environment.GetEnvironmentVariable("WIDGETIC_API_KEY")!,
};
var compositionsApi = new CompositionsApi(configuration);
var managedUserReference = JsonConvert.DeserializeObject<ManagedUserReference>("""
{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}
""")!;
var result = compositionsApi.SetCompositionManagedUser(
id: Guid.Parse("123e4567-e89b-12d3-a456-426614174000"),
managedUserReference: managedUserReference
);
Console.WriteLine(result);require 'api-sdk-rb'
ApiSdkRb.configure do |config|
config.access_token = ENV['WIDGETIC_API_KEY']
end
compositions_api = ApiSdkRb::CompositionsApi.new
result = compositions_api.set_composition_managed_user(
'123e4567-e89b-12d3-a456-426614174000',
{
managedUserId: '123e4567-e89b-12d3-a456-426614174000',
managedUserExternalId: 'external-user-123'
}
)
puts result<?php
require_once __DIR__ . '/vendor/autoload.php';
use WidgeticApi\Api\CompositionsApi;
use WidgeticApi\Configuration;
use WidgeticApi\Model\ManagedUserReference;
use WidgeticApi\ObjectSerializer;
$config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('WIDGETIC_API_KEY'));
$compositionsApi = new CompositionsApi(new GuzzleHttp\Client(), $config);
$managedUserReferenceJson = '{
"managedUserId": "123e4567-e89b-12d3-a456-426614174000",
"managedUserExternalId": "external-user-123"
}';
$managedUserReference = ObjectSerializer::deserialize(json_decode($managedUserReferenceJson), ManagedUserReference::class);
$result = $compositionsApi->setCompositionManagedUser(
id: '123e4567-e89b-12d3-a456-426614174000',
managed_user_reference: $managedUserReference,
);
print_r($result);{
"success": true,
"data": {
"id": "7d0b4c1a-2f6e-4f3a-9b1c-5e8a3d2c1b0f",
"managedUserId": "123e4567-e89b-12d3-a456-426614174000"
},
"meta": {
"page": 1,
"size": 20,
"total": 135,
"limit": 20,
"offset": 0,
"hasNextPage": true,
"hasPreviousPage": false,
"nextCursor": "<string>",
"warnings": [
"<string>"
]
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Composition not found",
"timestamp": "2026-10-15T10:00:00.000Z",
"param": "name",
"docUrl": "<string>",
"suggestedAction": "<string>",
"retryAfter": 60,
"details": {},
"correlationId": "req_123e4567-e89b-12d3-a456-426614174000"
}
}Authorizations
Body
Which of your managed users to file something under (moving a composition, a widget, an upload or a workflow to another managed user). Send one of the two fields, never both. managedUserExternalId is the one most partners hold, so they never have to store Widgetic's id.
Response
The composition is filed under the managed user