Create and Update Account

POST /api/v1_1/account

post
Account

https://{domain}.customersuccessbox.com/api/v1_1/account
POST Account allows you to create or update an account.
Request
Response
Request
Headers
Authentication
required
string
Bearer {api_key}
Content-Type
required
string
application/json
Body Parameters
parent_account_id
optional
string
A unique immutable identifier for the external parent account stored in CSB as lowercase
account_id
required
string
A unique immutable identifier for the external account stored in CSB as lowercase
Response
200: OK
{
"success": true
}
400: Bad Request
// Empty Body
{
"success": false,
"errors": [
"No data available."
],
"errors_by_attributes": []
}
// If account id empty or not present
{
"success": false,
"errors": [
"account_id does not exist."
],
"errors_by_attributes": [
{
"account_id": [
"account_id does not exist."
]
}
]
}
// Max Lenght Increased
{
"success": false,
"errors": [
"The name may not be greater than 191 characters."
],
"errors_by_attributes": [
{
"name": [
"The name may not be greater than 191 characters."
]
}
]
}
// If Account as Domain Configured
{
"success": false,
"errors": [
"account_id must be a valid domain name."
],
"errors_by_attributes": [
{
"account_id": [
"account_id must be a valid domain name."
]
}
]
}
// If account is blocked in system
{
"success": false,
"errors": [
"account_id blocked by system."
],
"errors_by_attributes": [
{
"account_id": [
"account_id blocked by system."
]
}
]
}
// If account and parent account are same
{
"success": false,
"errors": [
"account_id and parent_account_id can't be same."
],
"errors_by_attributes": [
{
"parent_account_id": [
"account_id and parent_account_id can't be same."
]
}
]
}
// If you send non numeric value to numeric fields
{
"success": false,
"errors": [
"Account ACME343re, licenses has invalid integer value."
],
"errors_by_attributes": [
{
"licenses": [
"Account ACME343re, licenses has invalid integer value."
]
}
]
}
// If you send non bolean value
{
"success": false,
"errors": [
"Account ACME343re, custom_Is_Valid has invalid boolean value."
],
"errors_by_attributes": [
{
"custom_Is_Valid": [
"Account ACME343re, custom_Is_Valid has invalid boolean value."
]
}
]
}
// If not a valid data and datetime value
{
"success": false,
"errors": [
"Account ACME343re, custom_External_Created_On has invalid date value.",
"Account ACME343re, custom_External_Created_At has invalid datetime value."
],
"errors_by_attributes": [
{
"custom_External_Created_On": [
"Account ACME343re, custom_External_Created_On has invalid date value."
],
"custom_External_Created_At": [
"Account ACME343re, custom_External_Created_At has invalid datetime value."
]
}
]
}
401: Unauthorized
{
"success": false,
"error": "Unauthenticated.",
"status": 403
}
500: Internal Server Error
{
"success": false,
"errors": [
"Internal Server Error. Please Connect to Customer Support."
],
"errors_by_attributes": []
}

Body example

Refer to available fields in Account Resource for attributes that can be set and updated for an Account using this call.

Only those fields are allowed which aren't marked as Read-only.

{
"account_id": "ACME343rq",
"name": "Acme Inc."
}
{
"account_id": "ACME343rq",
"parent_account_id": "ACME3463qw",
"name": "Acme Inc."
}

CURL request example

curl --location --request POST "https://{domain}.customersuccessbox.com/api/v1_1/account" \
--header "Authorization: Bearer {api_key}" \
--header "Content-Type: application/json" \
--data "{
\"parent_account_id\": \"ACME3463qw\",
\"account_id\": \"ACME343rq\",
\"name\": \"Acme Inc.\"
}"