Skip to main content
DELETE
/
1
/
compositions
/
{compositionID}
/
rules
/
{objectID}
curl
curl --request DELETE \
  --url https://algolia_application_id.algolia.net/1/compositions/my_composition_object_id/rules/lorem \
  --header 'accept: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'
// Initialize the client
var client = new CompositionClient(
new CompositionConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);

// Call the API
var response = await client.DeleteCompositionRuleAsync("1234", "5678");

// print the response
Console.WriteLine(response);
// Initialize the client
final client = CompositionClient(
appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');

// Call the API
final response = await client.deleteCompositionRule(
compositionID: "1234",
objectID: "5678",
);

// print the response
print(response);
// Initialize the client
client, err := composition.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}

// Call the API
response, err := client.DeleteCompositionRule(client.NewApiDeleteCompositionRuleRequest(
"1234", "5678"))
if err != nil {
// handle the eventual error
panic(err)
}


// print the response
print(response)
// Initialize the client
CompositionClient client = new CompositionClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");

// Call the API
TaskIDResponse response = client.deleteCompositionRule("1234", "5678");

// print the response
System.out.println(response);
// Initialize the client
const client = compositionClient('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');

// Call the API
const response = await client.deleteCompositionRule({ compositionID: '1234', objectID: '5678' });


// print the response
console.log(response);
// Initialize the client
val client = CompositionClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")

// Call the API
var response = client.deleteCompositionRule(compositionID = "1234", objectID = "5678")


// print the response
println(response)
// Initialize the client
$client = CompositionClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');

// Call the API
$response = $client->deleteCompositionRule(
'1234',
'5678',
);


// print the response
var_dump($response);
# Initialize the client
# In an asynchronous context, you can use CompositionClient instead, which exposes the exact same methods.
client = CompositionClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")

# Call the API
response = client.delete_composition_rule(
composition_id="1234",
object_id="5678",
)


# print the response
print(response)
# Initialize the client
client = Algolia::CompositionClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")

# Call the API
response = client.delete_composition_rule("1234", "5678")


# print the response
puts(response)
// Initialize the client
val client = CompositionClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")

// Call the API
val response = Await.result(
client.deleteCompositionRule(
compositionID = "1234",
objectID = "5678"
),
Duration(100, "sec")
)

// print the response
println(response)
// Initialize the client
let client = try CompositionClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY")

// Call the API
let response = try await client.deleteCompositionRule(compositionID: "1234", objectID: "5678")

// print the response
print(response)
{
  "taskID": 1514562690001
}
{
"message": "Invalid Application-Id or API-Key"
}
{
"message": "Invalid Application-Id or API-Key"
}
{
"message": "Invalid Application-Id or API-Key"
}
{
"message": "Invalid Application-Id or API-Key"
}
Required ACL: editSettings

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Path Parameters

compositionID
string
required

Unique Composition ObjectID. Composition unique identifier.

Example:

"my_composition_object_id"

objectID
string
required

Unique identifier of a rule object.

Response

OK

taskID
integer<int64>
required

Unique identifier of a task.

A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the task operation and this task ID.

Example:

1514562690001

Last modified on March 23, 2026