---
title: Deleting connections
description: You can invoke the web service to delete connections.
component: pingfederate
version: 13.1
page_id: pingfederate:developers_reference_guide:pf_delet_connect
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/developers_reference_guide/pf_delet_connect.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: July 5, 2022
section_ids:
  code-sample: Code sample
---

# Deleting connections

You can invoke the web service to delete connections.

The web service exposes the following method for connection deletion.

```
public void deleteConnection( String entityId, String role) throws IOException
```

The `entityId` parameter is the connection ID, which identifies the connection to be deleted. The `role` parameter is the connection role, identity provider (IdP) or service provider (SP).

## Code sample

The following example uses the Apache AXIS libraries to invoke this web service to delete a connection.

```
Service service = new Service();
Call call = (Call) service.createCall();
call.setUsername("username");
call.setPassword("password");
call.setTargetEndpointAddress(
	"https://localhost:9999/pf-mgmt-ws/ws/ConnectionMigrationMgr"
	);
call.setOperationName("deleteConnection");
call.invoke(new Object[]{"entityid", "SP"});
```
