---
title: "Reset a contact's state for a service"
method: DELETE
path: "/v1/projects/{project_id}/services/{id}/states/{contact_id}"
tags: ["Service"]
---

# Reset a contact's state for a service

`DELETE /v1/projects/{project_id}/services/{id}/states/{contact_id}`

## Request

- Base URL: `https://api.telerivet.com`
- URL: `https://api.telerivet.com/v1/projects/{project_id}/services/{id}/states/{contact_id}`
- Auth: one of:
  - HTTP basic
  - OAuth 2 (authorization code, authorization URL `https://telerivet.com/oauth/authorize`, token URL `https://api.telerivet.com/oauth/token`)

Resets the current state for a particular contact for the given service.

## Path parameters

- `project_id` string, required
- `id` string, required
- `contact_id` string, required

## Response `200`

Successful response

- ContactServiceState: Represents the current state of a particular contact for a particular Telerivet service. Some automated services (including polls) are 'stateful'. For polls, Telerivet needs to keep track of which question the contact is currently answering, and stores store the ID of each contact's current question (e.g. 'q1' or 'q2') as the ID of the contact's state for the poll service. Any type of conversation-like service will also need to store state for each contact. For this type of entity, the 'id' field is NOT a read-only unique ID (unlike all other types of entities). Instead it is an arbitrary string that identifies the contact's current state within your poll/conversation; many contacts may have the same state ID, and it may change over time. Additional custom fields may be stored in the 'vars'. Initially, the state 'id' for any contact is null. When saving the state, setting the 'id' to null is equivalent to resetting the state (so all 'vars' will be deleted); if you want to save custom variables, the state 'id' must be non-null. Many Telerivet services are stateless, such as auto-replies or keyword-based services where the behavior only depends on the current message, and not any previous messages sent by the same contact. Telerivet doesn't store any state for contacts that interact with stateless services.
  - `id` string: Arbitrary string representing the contact's current state for this service, e.g. 'q1', 'q2', etc.
  - `contact_id` string: ID of the contact
  - `service_id` string: ID of the service
  - `vars` object: Custom variables stored for this contact/service state. Only persisted when the state 'id' is non-null; saving with a null 'id' deletes the state and its variables. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _. Values may be strings, numbers, or boolean (true/false). String values may be up to 4096 bytes in length when encoded as UTF-8. Up to 100 variables are supported per object. Setting a variable to null will delete the variable.
  - `time_created` integer: Time the state was first created in Telerivet
  - `time_updated` integer: Time the state was last updated in Telerivet
  - `project_id` string: ID of the project this contact/service state belongs to

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key or Bearer token
- `404`: Resource not found

---

[API](https://skmtc.dev/telerivet/apis/telerivet-api.md) · [All operations](https://skmtc.dev/telerivet/apis/telerivet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telerivet/apis/telerivet-api/revisions/4e14b1c8d917?raw)
