cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/accounts/ACC0001/custom_objects/co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"custom_object_instances": {
"attributes": [
{
"name": "ATTRIBUTE_NAME",
"value": "Example value"
}
]
}
}'from exsited import build_client
client = build_client()
response = client.accounts.create_account_custom_object_instance(
"ACC0001",
"co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b",
{
"custom_object_instances": {
"attributes": [{"name": "ATTRIBUTE_NAME", "value": "Example value"}]
}
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.accounts.createAccountCustomObjectInstance(
'ACC0001',
'co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b',
{custom_object_instances: {attributes: [{name: 'ATTRIBUTE_NAME', value: 'Example value'}]}},
);
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->accounts->createAccountCustomObjectInstance(
'ACC0001',
'co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b',
[
'custom_object_instances' => [
'attributes' => [['name' => 'ATTRIBUTE_NAME', 'value' => 'Example value']],
],
],
);
print_r($response->data);
import com.exsited.Dto;
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Dto> response = client.accounts().createAccountCustomObjectInstance(
"ACC0001",
"co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b",
Map.of(
"custom_object_instances", Map.of(
"attributes", List.of(
Map.of("name", "ATTRIBUTE_NAME", "value", "Example value")))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Accounts.CreateAccountCustomObjectInstanceAsync(
"ACC0001",
"co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b",
new Dictionary<string, object?>
{
["custom_object_instances"] = new Dictionary<string, object?>
{
["attributes"] = new List<object?>
{
new Dictionary<string, object?>
{
["name"] = "ATTRIBUTE_NAME",
["value"] = "Example value",
},
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.accounts.createAccountCustomObjectInstance(
'ACC0001',
'co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b',
{
'custom_object_instances': {
'attributes': [
{'name': 'ATTRIBUTE_NAME', 'value': 'Example value'},
],
},
},
);
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Accounts().CreateAccountCustomObjectInstance(context.Background(), "ACC0001", "co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b", map[string]any{
"custom_object_instances": map[string]any{
"attributes": []any{
map[string]any{
"name": "ATTRIBUTE_NAME",
"value": "Example value",
},
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Accounts
Create a custom object instance
Creates an instance of a custom object on an account.
POST
/
accounts
/
{account_id}
/
custom_objects
/
{custom_object_id}
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/accounts/ACC0001/custom_objects/co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"custom_object_instances": {
"attributes": [
{
"name": "ATTRIBUTE_NAME",
"value": "Example value"
}
]
}
}'from exsited import build_client
client = build_client()
response = client.accounts.create_account_custom_object_instance(
"ACC0001",
"co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b",
{
"custom_object_instances": {
"attributes": [{"name": "ATTRIBUTE_NAME", "value": "Example value"}]
}
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.accounts.createAccountCustomObjectInstance(
'ACC0001',
'co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b',
{custom_object_instances: {attributes: [{name: 'ATTRIBUTE_NAME', value: 'Example value'}]}},
);
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->accounts->createAccountCustomObjectInstance(
'ACC0001',
'co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b',
[
'custom_object_instances' => [
'attributes' => [['name' => 'ATTRIBUTE_NAME', 'value' => 'Example value']],
],
],
);
print_r($response->data);
import com.exsited.Dto;
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Dto> response = client.accounts().createAccountCustomObjectInstance(
"ACC0001",
"co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b",
Map.of(
"custom_object_instances", Map.of(
"attributes", List.of(
Map.of("name", "ATTRIBUTE_NAME", "value", "Example value")))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Accounts.CreateAccountCustomObjectInstanceAsync(
"ACC0001",
"co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b",
new Dictionary<string, object?>
{
["custom_object_instances"] = new Dictionary<string, object?>
{
["attributes"] = new List<object?>
{
new Dictionary<string, object?>
{
["name"] = "ATTRIBUTE_NAME",
["value"] = "Example value",
},
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.accounts.createAccountCustomObjectInstance(
'ACC0001',
'co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b',
{
'custom_object_instances': {
'attributes': [
{'name': 'ATTRIBUTE_NAME', 'value': 'Example value'},
],
},
},
);
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Accounts().CreateAccountCustomObjectInstance(context.Background(), "ACC0001", "co_5d2a8f1c3b7e4a9d8c6b1e2f3a4d5c6b", map[string]any{
"custom_object_instances": map[string]any{
"attributes": []any{
map[string]any{
"name": "ATTRIBUTE_NAME",
"value": "Example value",
},
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Name the custom object by its
co_ id and send the instance under custom_object_instances. attributes must be a list of name and value pairs. The new instance comes back under custom_object_instance.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Path Parameters
The account's id, such as ACC0001. Not its uuid.
The custom object's co_ id.
Body
application/json
Show child attributes
Show child attributes
Response
The new instance, under custom_object_instance.