# Connections

APIs for managing connections to external systems.

DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.

## List connection templates

> Lists all connections templates. \
> \
> A connection's template defines the type of the connection, and the schema of it's\
> configuration.\
> &#x20;(DEPRECATED: Use provisioning instead)

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_TemplateType":{"type":"string","enum":["Not Applicable","SQLRunner","Kubernetes","InProc","Connect","Alert Channel","Audit Channel","SchemaRegistry"]},"agent_ConnectionTemplateResponse":{"required":["name","templateVersion","version","enabled","builtIn","category","type","metadata","jsonSchema","creatable"],"type":"object","properties":{"name":{"type":"string","description":"The name of the template"},"templateVersion":{"type":"integer"},"version":{"type":"string"},"enabled":{"type":"boolean"},"builtIn":{"type":"boolean"},"category":{"$ref":"#/components/schemas/agent_TemplateCategory"},"type":{"$ref":"#/components/schemas/agent_TemplateType"},"kind":{"$ref":"#/components/schemas/agent_TemplateType"},"metadata":{"$ref":"#/components/schemas/agent_ConnectionTemplateMetadata"},"configuration":{"type":"array","items":{"$ref":"#/components/schemas/agent_ConnectionProperty"},"description":"Array of objects describing the schema of each configuration property for connections of this type"},"jsonSchema":{"$ref":"#/components/schemas/agent_JsonObject"},"creatable":{"type":"boolean"}}},"agent_TemplateCategory":{"type":"string","enum":["Connection","Application","Channel","Deployment"]},"agent_ConnectionTemplateMetadata":{"required":["author"],"type":"object","properties":{"author":{"type":"string"},"description":{"type":"string"}}},"agent_ConnectionProperty":{"required":["key","displayName","type","required","mounted","provided"],"type":"object","properties":{"key":{"type":"string","description":"The key of the property"},"displayName":{"type":"string"},"placeholder":{"type":"string"},"description":{"type":"string"},"type":{"$ref":"#/components/schemas/agent_ConnectionPropertyType"},"enumValues":{"type":"array","items":{"type":"string"},"description":"For enum properties, the set of valid values","minItems":1},"required":{"type":"boolean"},"mounted":{"type":"boolean","description":"Denotes a file property which expects an [uploaded file reference](#operation/uploadFile) as its value"},"provided":{"type":"boolean"}}},"agent_ConnectionPropertyType":{"required":["name","displayName"],"type":"object","properties":{"name":{"$ref":"#/components/schemas/agent_KeyDataType"},"displayName":{"type":"string"}}},"agent_KeyDataType":{"type":"string","description":"The data type of the property","enum":["STRING","ARRAY","MULTILINE","SECRET","DOUBLE","LONG","BOOLEAN","BASE64","ENUM","MAP"]},"agent_JsonObject":{"type":"object","description":"JSON Schema representation of the configuration properties"},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/connection/connection-templates":{"get":{"tags":["agent_Connections"],"summary":"List connection templates","description":"Lists all connections templates. \n\nA connection's template defines the type of the connection, and the schema of it's\nconfiguration.\n (DEPRECATED: Use provisioning instead)","operationId":"listConnectionTemplates","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","description":"Filter by template kind","required":false,"schema":{"$ref":"#/components/schemas/agent_TemplateType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/agent_ConnectionTemplateResponse"}}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Add a new connection

> Adds a new connection

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_AddConnectionApiRequestV2":{"required":["name","templateName"],"type":"object","properties":{"name":{"type":"string","description":"Name of the connection"},"tags":{"type":"array","items":{"type":"string"}},"templateName":{"type":"string","description":"The [template](#operation/listConnectionTemplates) of the connection","minLength":1},"configuration":{"type":"object","description":"The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates)"}}},"agent_AddConnectionResponse":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the connection"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/connection/connections":{"post":{"tags":["agent_Connections"],"summary":"Add a new connection","description":"Adds a new connection","operationId":"createConnection","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AddConnectionApiRequestV2"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AddConnectionResponse"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Validate a connection

> Validates the connection

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_TestConnectionApiRequestV2":{"required":["name","templateName"],"type":"object","properties":{"name":{"type":"string"},"templateName":{"type":"string","description":"The [template](#operation/listConnectionTemplates) of the connection","minLength":1},"configuration":{"type":"object","description":"The configuration of the connection. The schema of this object is defined by the [template configuration](#operation/listConnectionTemplates)"},"update":{"type":"boolean","description":"*true* if testing an update to an existing connection, *false* if testing a new connection"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/connection/connections/test":{"post":{"tags":["agent_Connections"],"summary":"Validate a connection","description":"Validates the connection","operationId":"testConnection","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_TestConnectionApiRequestV2"}}},"required":true},"responses":{"200":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Get connection details

> Returns the connection details

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_ConnectionJsonResponseV2WithLrn":{"required":["name","lrn","templateVersion","templateName","builtIn","createdBy","createdAt","modifiedBy","modifiedAt","configuration","deletable"],"type":"object","properties":{"name":{"type":"string","description":"Name of the connection"},"lrn":{"type":"string","description":"A Lenses resource name identifier"},"templateVersion":{"type":"integer"},"templateName":{"type":"string","description":"The [template](#operation/listConnectionTemplates) of the connection"},"builtIn":{"type":"boolean"},"createdBy":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"modifiedBy":{"type":"string"},"modifiedAt":{"type":"integer","format":"int64"},"configuration":{"type":"object"},"tags":{"type":"array","items":{"type":"string"}},"deletable":{"type":"boolean"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/connection/connections/{name}":{"get":{"tags":["agent_Connections"],"summary":"Get connection details","description":"Returns the connection details","operationId":"getConnection","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","description":"The name of the connection","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_ConnectionJsonResponseV2WithLrn"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Update connection details

> Updates the connection details

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_UpsertConnectionApiRequestV2":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"templateName":{"type":"string","minLength":1},"configuration":{"type":"object"}}},"agent_AddConnectionResponse":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"Name of the connection"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Conflict":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v2/connection/connections/{name}":{"put":{"tags":["agent_Connections"],"summary":"Update connection details","description":"Updates the connection details","operationId":"updateConnection","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","description":"The name of the connection","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_UpsertConnectionApiRequestV2"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_AddConnectionResponse"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"409":{"description":"The supplied identifier is already being used by another resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Conflict"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Delete a connection

> Deletes the connection

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Conflict":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/connection/connections/{name}":{"delete":{"tags":["agent_Connections"],"summary":"Delete a connection","description":"Deletes the connection","operationId":"deleteConnection","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","description":"The name of the connection","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":""},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"409":{"description":"The supplied identifier is already being used by another resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Conflict"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```

## Upload a file

> Upload a file

```json
{"openapi":"3.0.0","info":{"title":"Lenses API","version":"6.1"},"tags":[{"name":"agent_Connections","description":"APIs for managing connections to external systems.\n\n DEPRECATED: This endpoint is deprecated and will be removed in a future version. Use provisioning APIs instead.\n"}],"servers":[{"url":"{server}","variables":{"server":{"default":"https://api.example.com"}}}],"security":[{"bearerAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The bearer token can be obtained by creating a ServiceAccount.\n"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"session_id","description":"On successful SAML/SSO login, the API will set a cookie with a session id.\n"}},"schemas":{"agent_MultiPartBody":{"required":["file"],"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"agent_FileMetadataEntity":{"required":["id","filename","uploadedBy","uploadedAt","size"],"type":"object","properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"uploadedBy":{"type":"string"},"uploadedAt":{"type":"string","format":"date-time"},"size":{"type":"integer","format":"int64"},"contentType":{"type":"string"}}},"agent_BadRequest":{"required":["error"],"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"error":{"type":"string"},"errorType":{"type":"string"}}},"agent_FieldError":{"required":["field","error"],"type":"object","properties":{"field":{"type":"string"},"error":{"type":"string"},"lineNumber":{"type":"integer"},"columnNumber":{"type":"integer"}}},"agent_Unauthorized":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_LicenseError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_Forbidden":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_NotFound":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}},"agent_InternalError":{"required":["error"],"type":"object","properties":{"error":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/agent_FieldError"}},"errorType":{"type":"string"}}}}},"paths":{"/api/v1/environments/{environment}/proxy/api/v1/files":{"post":{"tags":["agent_Connections"],"summary":"Upload a file","description":"Upload a file","operationId":"uploadFile","parameters":[{"name":"environment","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/agent_MultiPartBody"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_FileMetadataEntity"}}}},"400":{"description":"The request input was invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_BadRequest"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Unauthorized"}}}},"402":{"description":"The purchased Lenses license does not provide access to this feature","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_LicenseError"}}}},"403":{"description":"Authorisation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_Forbidden"}}}},"404":{"description":"The requested resource cannot be found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_NotFound"}}}},"500":{"description":"An internal server error has occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/agent_InternalError"}}}}}}}}}
```
