# Configuration

## Get all configurations

> Retrieves all configurations of index providers. The returned response contains search and write keys.

```json
{"openapi":"3.0.0","info":{"title":"Indexing Service","version":"v1"},"tags":[{"name":"Configuration"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["indexing.search_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"indexing.search_view":"Needed to read an index provider configuration","indexing.search_manage":"Needed to manage an index provider configuration"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"The tenant that the caller is acting upon.\n\nPlease note that this value is always lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}},"schemas":{"IndexConfiguration":{"title":"IndexConfiguration","allOf":[{"$ref":"#/components/schemas/IndexPublicConfiguration"},{"type":"object","properties":{"writeKey":{"type":"string","description":"API key used for write purposes."}}}]},"IndexPublicConfiguration":{"title":"IndexPublicConfiguration","type":"object","properties":{"searchKey":{"type":"string","description":"API Key used for search purposes."},"applicationId":{"type":"string","description":"Application id of an indexer provider."},"indexName":{"type":"string","description":"Identifier of an index."},"provider":{"type":"string","description":"Index provider name. Supported providers: Algolia - https://www.algolia.com","enum":["ALGOLIA"]},"active":{"type":"boolean","description":"Indicates if the configuration is active or not."}}},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"description":"Classification of the error type","type":"string"},"message":{"description":"Descriptive error message for debugging","type":"string"},"details":{"type":"array","description":"Error details","items":{"type":"string"}}}}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/indexing/{tenant}/configurations":{"get":{"summary":"Get all configurations","description":"Retrieves all configurations of index providers. The returned response contains search and write keys.","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IndexConfiguration"}}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"}},"operationId":"GET-indexing-list-configs","tags":["Configuration"]}}}}
```

## Create a new configuration

> Creates a new index configuration. Currently supported providers:\
> \* Algolia - <https://www.algolia.com\\>
> \
> Identifier of a newly created configuration is a provider name.

```json
{"openapi":"3.0.0","info":{"title":"Indexing Service","version":"v1"},"tags":[{"name":"Configuration"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["indexing.search_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"indexing.search_view":"Needed to read an index provider configuration","indexing.search_manage":"Needed to manage an index provider configuration"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"The tenant that the caller is acting upon.\n\nPlease note that this value is always lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}},"schemas":{"IndexConfiguration":{"title":"IndexConfiguration","allOf":[{"$ref":"#/components/schemas/IndexPublicConfiguration"},{"type":"object","properties":{"writeKey":{"type":"string","description":"API key used for write purposes."}}}]},"IndexPublicConfiguration":{"title":"IndexPublicConfiguration","type":"object","properties":{"searchKey":{"type":"string","description":"API Key used for search purposes."},"applicationId":{"type":"string","description":"Application id of an indexer provider."},"indexName":{"type":"string","description":"Identifier of an index."},"provider":{"type":"string","description":"Index provider name. Supported providers: Algolia - https://www.algolia.com","enum":["ALGOLIA"]},"active":{"type":"boolean","description":"Indicates if the configuration is active or not."}}},"IndexCreationResponse":{"title":"IndexCreationResponse","type":"object","properties":{"id":{"type":"string","description":"Identifier of a newly created configuration."}}},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"description":"Classification of the error type","type":"string"},"message":{"description":"Descriptive error message for debugging","type":"string"},"details":{"type":"array","description":"Error details","items":{"type":"string"}}}}},"responses":{"BadRequest_400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/indexing/{tenant}/configurations":{"post":{"summary":"Create a new configuration","description":"Creates a new index configuration. Currently supported providers:\n* Algolia - https://www.algolia.com\n\nIdentifier of a newly created configuration is a provider name.","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexConfiguration"}}},"description":""},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexCreationResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest_400"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"}},"operationId":"POST-indexing-create-config","tags":["Configuration"]}}}}
```

## Get configuration by provider name

> Retrieves a single configuration by a provider name. Currently supported providers:\
> \* Algolia - <https://www.algolia.com>

```json
{"openapi":"3.0.0","info":{"title":"Indexing Service","version":"v1"},"tags":[{"name":"Configuration"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["indexing.search_view"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"indexing.search_view":"Needed to read an index provider configuration","indexing.search_manage":"Needed to manage an index provider configuration"}}}}},"schemas":{"IndexConfiguration":{"title":"IndexConfiguration","allOf":[{"$ref":"#/components/schemas/IndexPublicConfiguration"},{"type":"object","properties":{"writeKey":{"type":"string","description":"API key used for write purposes."}}}]},"IndexPublicConfiguration":{"title":"IndexPublicConfiguration","type":"object","properties":{"searchKey":{"type":"string","description":"API Key used for search purposes."},"applicationId":{"type":"string","description":"Application id of an indexer provider."},"indexName":{"type":"string","description":"Identifier of an index."},"provider":{"type":"string","description":"Index provider name. Supported providers: Algolia - https://www.algolia.com","enum":["ALGOLIA"]},"active":{"type":"boolean","description":"Indicates if the configuration is active or not."}}},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"description":"Classification of the error type","type":"string"},"message":{"description":"Descriptive error message for debugging","type":"string"},"details":{"type":"array","description":"Error details","items":{"type":"string"}}}}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"NotFound_404":{"description":"Resource has not been found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/indexing/{tenant}/configurations/{provider}":{"get":{"summary":"Get configuration by provider name","description":"Retrieves a single configuration by a provider name. Currently supported providers:\n* Algolia - https://www.algolia.com","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexConfiguration"}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"}},"tags":["Configuration"],"operationId":"GET-indexing-retrieve-config"}}}}
```

## Update configuration by provider name

> Updates an existing index configuration.

```json
{"openapi":"3.0.0","info":{"title":"Indexing Service","version":"v1"},"tags":[{"name":"Configuration"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["indexing.search_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"indexing.search_view":"Needed to read an index provider configuration","indexing.search_manage":"Needed to manage an index provider configuration"}}}}},"schemas":{"IndexConfiguration":{"title":"IndexConfiguration","allOf":[{"$ref":"#/components/schemas/IndexPublicConfiguration"},{"type":"object","properties":{"writeKey":{"type":"string","description":"API key used for write purposes."}}}]},"IndexPublicConfiguration":{"title":"IndexPublicConfiguration","type":"object","properties":{"searchKey":{"type":"string","description":"API Key used for search purposes."},"applicationId":{"type":"string","description":"Application id of an indexer provider."},"indexName":{"type":"string","description":"Identifier of an index."},"provider":{"type":"string","description":"Index provider name. Supported providers: Algolia - https://www.algolia.com","enum":["ALGOLIA"]},"active":{"type":"boolean","description":"Indicates if the configuration is active or not."}}},"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"description":"Classification of the error type","type":"string"},"message":{"description":"Descriptive error message for debugging","type":"string"},"details":{"type":"array","description":"Error details","items":{"type":"string"}}}}},"responses":{"BadRequest_400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"NotFound_404":{"description":"Resource has not been found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}}},"paths":{"/indexing/{tenant}/configurations/{provider}":{"put":{"summary":"Update configuration by provider name","description":"Updates an existing index configuration.","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexConfiguration"}}}},"responses":{"204":{"description":"Configuration updated"},"400":{"$ref":"#/components/responses/BadRequest_400"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"}},"operationId":"PUT-indexing-update-config","tags":["Configuration"]}}}}
```

## Delete configuration

> Deletes the configuration based on the provider name.

```json
{"openapi":"3.0.0","info":{"title":"Indexing Service","version":"v1"},"tags":[{"name":"Configuration"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["indexing.search_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"indexing.search_view":"Needed to read an index provider configuration","indexing.search_manage":"Needed to manage an index provider configuration"}}}}},"parameters":{"trait_tenant":{"name":"tenant","in":"path","required":true,"description":"The tenant that the caller is acting upon.\n\nPlease note that this value is always lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"NotFound_404":{"description":"Resource has not been found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}}},"schemas":{"errorMessage":{"title":"error","description":"Schema for API specified errors.","type":"object","properties":{"code":{"description":"Original HTTP error code, should be consistent with the response HTTP code","type":"integer"},"status":{"description":"Classification of the error type","type":"string"},"message":{"description":"Descriptive error message for debugging","type":"string"},"details":{"type":"array","description":"Error details","items":{"type":"string"}}}}}},"paths":{"/indexing/{tenant}/configurations/{provider}":{"delete":{"summary":"Delete configuration","description":"Deletes the configuration based on the provider name.","parameters":[{"$ref":"#/components/parameters/trait_tenant"}],"responses":{"204":{"description":"Configuration deleted"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"}},"operationId":"DELETE-indexing-remove-config","tags":["Configuration"]}}}}
```
