# 24006: Invalid resource state

Log Type: TWILIO

Log Level: ERROR

## Description

The resource exists but is in a state that prevents the requested operation. The resource must transition through intermediate states before it can accept the requested action.

### Possible causes

* You attempted to transition an operation to a status that is not reachable from its current status (for example, moving a `RUNNING` operation back to `PENDING`).
* You attempted to create a snapshot for an audience that has been deleted or is in a terminal state.
* The resource is currently being modified by another asynchronous operation and cannot accept changes until that operation completes.

### Possible solutions

* Retrieve the resource with a `GET` request and inspect its current state. The `detail` field in the error response describes the invalid transition (for example, "Cannot transition from RUNNING to PENDING").
* If an asynchronous operation is in progress, poll the operation endpoint (`GET /preview/Operations/{operationId}`) until its status reaches a terminal state (`SUCCEEDED` or `FAILED`), then retry.
* If the resource is in a terminal state that cannot be modified, create a new resource instead.

#### Additional resources

* [Audiences API reference](/docs/segment/audiences/api)
