> For the complete documentation index, see [llms.txt](https://docs.epic-ai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.epic-ai.com/api-dokumentation/contact-variables.md).

# Contact Variables

## Lists all custom variables of a contact

> \
> \
> \*\*Required Permission:\*\* \`chatbots.contacts.variables.list\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Contact variables","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/contacts/variables/{contactId}":{"get":{"operationId":"ConversationContactVariableController_listVariables[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The Id of the chatbot.","schema":{"type":"string"}},{"name":"contactId","required":true,"in":"path","description":"The Id of the contact.","schema":{"type":"string"}}],"responses":{"200":{"description":"The list of contact variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListVariablesResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Lists all custom variables of a contact","tags":["Contact variables"],"description":"\n\n**Required Permission:** `chatbots.contacts.variables.list`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ListVariablesResponseDto":{"type":"object","properties":{"variables":{"description":"The list of conversation variables.","type":"array","items":{"$ref":"#/components/schemas/VariableDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["variables"]},"VariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the variable (corresponds to the global variable ID)."},"name":{"type":"string","description":"The programmatic name of the variable."},"type":{"type":"string","description":"The data type of the variable."},"value":{"type":"string","description":"The value assigned in this conversation."},"updated":{"type":"string","description":"The timestamp of the last update."}},"required":["id","name","type","value","updated"]}}}}
```

## Deletes all custom variables of a contact

> \
> \
> \*\*Required Permission:\*\* \`chatbots.contacts.variables.delete\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Contact variables","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/contacts/variables/{contactId}":{"delete":{"operationId":"ConversationContactVariableController_deleteVariables[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The Id of the chatbot.","schema":{"type":"string"}},{"name":"contactId","required":true,"in":"path","description":"The Id of the contact.","schema":{"type":"string"}}],"responses":{"200":{"description":"The deletion result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteVariablesResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Deletes all custom variables of a contact","tags":["Contact variables"],"description":"\n\n**Required Permission:** `chatbots.contacts.variables.delete`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"DeleteVariablesResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion operation was successful."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## Gets a specific custom variable of a contact

> \
> \
> \*\*Required Permission:\*\* \`chatbots.contacts.variables.get\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Contact variables","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/contacts/variables/{contactId}/{variableId}":{"get":{"operationId":"ConversationContactVariableController_getVariable[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The Id of the chatbot.","schema":{"type":"string"}},{"name":"variableId","required":true,"in":"path","description":"The Id of the variable.","schema":{"type":"string"}},{"name":"contactId","required":true,"in":"path","description":"The Id of the contact.","schema":{"type":"string"}}],"responses":{"200":{"description":"The requested variable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Gets a specific custom variable of a contact","tags":["Contact variables"],"description":"\n\n**Required Permission:** `chatbots.contacts.variables.get`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"VariableResponseDto":{"type":"object","properties":{"variable":{"description":"The variable.","allOf":[{"$ref":"#/components/schemas/VariableDto"}]},"error":{"type":"string","description":"Optional error message."}}},"VariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the variable (corresponds to the global variable ID)."},"name":{"type":"string","description":"The programmatic name of the variable."},"type":{"type":"string","description":"The data type of the variable."},"value":{"type":"string","description":"The value assigned in this conversation."},"updated":{"type":"string","description":"The timestamp of the last update."}},"required":["id","name","type","value","updated"]}}}}
```

## Sets or updates the value of a custom variable of a contact

> \
> \
> \*\*Required Permission:\*\* \`chatbots.contacts.variables.edit\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Contact variables","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/contacts/variables/{variableId}":{"put":{"operationId":"ConversationContactVariableController_assignValueToVariable[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The Id of the chatbot.","schema":{"type":"string"}},{"name":"variableId","required":true,"in":"path","description":"The Id of the variable whose value is to be set.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignValueToVariableRequestDto"}}}},"responses":{"200":{"description":"The updated variable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableResponseDto"}}}},"400":{"description":"Invalid input data."},"403":{"description":"Insufficient permissions."}},"summary":"Sets or updates the value of a custom variable of a contact","tags":["Contact variables"],"description":"\n\n**Required Permission:** `chatbots.contacts.variables.edit`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"AssignValueToVariableRequestDto":{"type":"object","properties":{"value":{"type":"string","description":"The new value to be assigned to the variable."},"contactId":{"type":"string","description":"The id of the contact to assign the variable to."}},"required":["value"]},"VariableResponseDto":{"type":"object","properties":{"variable":{"description":"The variable.","allOf":[{"$ref":"#/components/schemas/VariableDto"}]},"error":{"type":"string","description":"Optional error message."}}},"VariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the variable (corresponds to the global variable ID)."},"name":{"type":"string","description":"The programmatic name of the variable."},"type":{"type":"string","description":"The data type of the variable."},"value":{"type":"string","description":"The value assigned in this conversation."},"updated":{"type":"string","description":"The timestamp of the last update."}},"required":["id","name","type","value","updated"]}}}}
```
