> For the complete documentation index, see [llms.txt](https://docs.indicio.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.indicio.tech/developer/indicio-proven-r/api-reference/connections.md).

# Connections

Endpoints for managing connections

## Get all connections

> This endpoint retrieves all connections.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Connections","description":"Endpoints for managing connections"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/connections":{"get":{"summary":"Get all connections","description":"This endpoint retrieves all connections.","tags":["Connections"],"parameters":[{"in":"query","name":"sort-field","schema":{"type":"string"},"description":"The field to sort by (default updated_at)."},{"in":"query","name":"sort-direction","schema":{"type":"string"},"description":"The direction to sort (ASC or DESC, default DESC)."},{"in":"query","name":"page-size","schema":{"type":"integer"},"description":"The number of connections per page (default 20)."},{"in":"query","name":"current-page","schema":{"type":"integer"},"description":"The current page number (default 1)."},{"in":"query","name":"item-count","schema":{"type":"integer"},"description":"The total number of items."},{"in":"query","name":"state-filter","schema":{"type":"string"},"description":"If provided, returns only connections with this state."},{"in":"query","name":"contact-id","schema":{"type":"string"},"description":"If provided, returns only connections for this contact_id."}],"responses":{"200":{"description":"A list of connections","content":{"application/json":{"schema":{"type":"object","properties":{"params":{"type":"object","properties":{"sort":{"type":"array","items":{"type":"string"}},"pageSize":{"type":"string"},"currentPage":{"type":"integer"},"pageCount":{"type":"integer"},"itemCount":{"type":"integer"},"stateFilter":{"type":"string","nullable":true},"contactIdFilter":{"type":"string","nullable":true}}},"rows":{"type":"array","items":{"type":"object","properties":{"connection_id":{"type":"string"},"state":{"type":"string"},"my_did":{"type":"string"},"alias":{"type":"string"},"request_id":{"type":"string"},"invitation_key":{"type":"string"},"invitation_msg_id":{"type":"string"},"invitation_mode":{"type":"string"},"invitation_url":{"type":"string"},"invitation":{"type":"object","properties":{"@type":{"type":"string"},"@id":{"type":"string"},"label":{"type":"string"},"handshake_protocols":{"type":"array","items":{"type":"string"}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"recipientKeys":{"type":"array","items":{"type":"string"}},"serviceEndpoint":{"type":"string"}}}}}},"accept":{"type":"string"},"initiator":{"type":"string"},"their_role":{"type":"string"},"their_did":{"type":"string"},"their_public_did":{"type":"string"},"their_label":{"type":"string"},"routing_state":{"type":"string"},"inbound_connection_id":{"type":"string"},"error_msg":{"type":"string"},"contact_id":{"type":"string"},"transaction_role":{"type":"string"},"discovered_features":{"type":"array","items":{"type":"object","properties":{"pid":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}}}}},"wallet_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Get a connection by ID

> This endpoint retrieves a connection by its id.

```json
{"openapi":"3.0.0","info":{"title":"Proven API","version":"1.0.0"},"tags":[{"name":"Connections","description":"Endpoints for managing connections"}],"servers":[{"url":"https://proven-4-2-test.proven.indicio.tech"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/connections/{connection_id}":{"get":{"summary":"Get a connection by ID","description":"This endpoint retrieves a connection by its id.","tags":["Connections"],"parameters":[{"in":"path","name":"connection_id","required":true,"schema":{"type":"string"},"description":"The connection id of the connection to retrieve."}],"responses":{"200":{"description":"Connection record retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"connection_id":{"type":"string"},"state":{"type":"string"},"my_did":{"type":"string"},"alias":{"type":"string"},"request_id":{"type":"string"},"invitation_key":{"type":"string"},"invitation_msg_id":{"type":"string"},"invitation_mode":{"type":"string"},"invitation_url":{"type":"string"},"invitation":{"type":"object","properties":{"@type":{"type":"string"},"@id":{"type":"string"},"label":{"type":"string"},"handshake_protocols":{"type":"array","items":{"type":"string"}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"recipientKeys":{"type":"array","items":{"type":"string"}},"serviceEndpoint":{"type":"string"}}}}}},"accept":{"type":"string"},"initiator":{"type":"string"},"their_role":{"type":"string"},"their_did":{"type":"string"},"their_public_did":{"type":"string"},"their_label":{"type":"string"},"routing_state":{"type":"string"},"inbound_connection_id":{"type":"string"},"error_msg":{"type":"string"},"contact_id":{"type":"string"},"transaction_role":{"type":"string"},"discovered_features":{"type":"array","items":{"type":"object","properties":{"pid":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}}}}},"wallet_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}},"401":{"description":"Unauthorized."},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```
