Manage Actors
Destroy Actor
Destroy an actor. The actor's onDestroy hook runs, then its state is deleted permanently.
DELETE https://api.rivet.dev/actors/{actor_id}
Examples
curl -X DELETE "https://api.rivet.dev/actors/$ACTOR_ID?namespace=$RIVET_NAMESPACE" \
-H "Authorization: Bearer $RIVET_TOKEN"
const endpoint = "https://api.rivet.dev";
const namespace = process.env.RIVET_NAMESPACE ?? "default";
const token = process.env.RIVET_TOKEN ?? "";
const actorId = "00000000-0000-0000-0000-000000000000";
const response = await fetch(
`${endpoint}/actors/${actorId}?namespace=${namespace}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
},
);
if (!response.ok) {
throw new Error(`Failed to destroy actor: ${await response.text()}`);
}
export {};
Authentication
Send your namespace token as a bearer token in the Authorization header. Every control plane request also requires the namespace query parameter. See Authentication.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
actor_id | string | Yes | ID of the actor. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Name of the namespace to operate in. |
Responses
200
{}