# Utility Functions

### Create Character

* **Description:** Create a new character and get the character ID for it.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FzN0z0ash1G3Lsbu854OW%2Fimage.png?alt=media&#x26;token=b7c26f0f-6656-4dde-8d20-cc9eedf9ea99" alt=""><figcaption></figcaption></figure>

**Inputs:**

* **Char Name:** Name of the character.
* **Voice:** Voice name \[MALE/FEMALE].
* **Backstory:** Backstory for the new character.

**Outputs:**

#### ✅ \[On Success]

* **Char ID:** character id for the new character.

#### ⛔ \[On Failure]&#x20;

*Nothing is returned, check logs for details on why it failed.*

### Get All Character IDs

* **Description:** Get a list of character IDs belonging to the user.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fwp4WTbsNiFJP3YBqJmCP%2Fimage.png?alt=media&#x26;token=1cc6d238-a89d-4698-91c4-8e9e41bde13d" alt=""><figcaption></figcaption></figure>

**Outputs:**

#### ✅ \[On Success]

* C**har IDs**: list of characters.

#### ⛔ \[On Failure]&#x20;

*Nothing is returned, check logs for details on why it failed.*

### Get Character Details

* **Description:** Fetch all details of a character including backstory, voice, etc.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fj1Y4lXZPg8ADbwuey2SB%2Fimage.png?alt=media&#x26;token=e28c285b-3512-43c5-af4f-0b13a3738906" alt=""><figcaption></figcaption></figure>

**Inputs:**

* **Char ID:** Character ID for which to fetch all the details.

**Outputs:**

#### ✅ \[On Success]

* **Character Name:** Name of your character.&#x20;
* **Voice Type:** Voice name.&#x20;
* **Backstory:** Character backstory.
* **Has Ready Player Me Link:** True if the avatar is configured on the website.
* **Ready Player Me Link:** The avatar link to be used to download.

#### ⛔ \[On Failure]&#x20;

*Nothing is returned, check logs for details on why it failed.*

### Update Character&#x20;

* **Description:** Update a particular character.

<figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FCxrhfgqTl4lb7wTdVeKD%2Fimage.png?alt=media&#x26;token=d1043767-ecc1-4fd2-90d2-a95969a7d023" alt=""><figcaption></figcaption></figure>

**Inputs:**

* **Char ID:** Character ID to be updated.
* **New Voice:** Voice name or \[MALE/FEMALE].
* **New Backstory:** Updated backstory.
* **New Char Name:** Name of the character.

{% hint style="info" %}
For the list of supported voices, please refer to the [Voice List API](https://docs.convai.com/api-docs/api-reference/core-api-reference/character-crafting-apis/voice-list-api).
{% endhint %}

{% hint style="info" %}
To update a subset of properties, such as Voice and Name only, leave the other fields empty and the update will only affect the specified fields with values.
{% endhint %}

**Outputs:**

#### ✅ \[On Success]

*Nothing is returned.*

⛔ \[On Failure]&#x20;

*Nothing is returned, check logs for details on why it failed.*
